Skip to content

Instantly share code, notes, and snippets.

Fernando Camargo fernandocamargoti

View GitHub Profile
import functools
import os
import warnings
from glob import glob
from multiprocessing import Pool
from pathlib import Path
from typing import Optional, Iterator, List
import numpy as np
import ujson as json
import json
from typing import NamedTuple, Tuple
import PIL.Image
import numpy as np
from bentoml import BentoService, api, env, ver, artifacts
from bentoml.artifact import KerasModelArtifact, TextFileArtifact, TensorflowSavedModelArtifact
from bentoml.handlers import ImageHandler
import tensorflow as tf
from tensorflow.keras import Model
fernandocamargoti /
Created Apr 29, 2020
Conditional Augmenter
import imgaug.augmenters as iaa
import numpy as np
class Conditional(iaa.Augmenter):
"""Apply child augmenter(s) for images wich a given conditional comes true.
Let ``C`` be one or more child augmenters given to
Let ``p`` be the fraction of images (or other data) to augment.
View gist:5d330c6ec37578c5fb72bc39524ccd91
INFO: [pid 14484] Worker Worker(salt=140992192, workers=1,, username=fernando, pid=14484) running EvaluateIfoodModel(model_module=recommendation.task.model.m
atrix_factorization, model_cls=MatrixFactorizationTraining, model_task_id=MatrixFactorizationTraining____500_False_4bb5a61c77, limit_list_size=50, nofilter_iteractions_test=False, task_hash=no
ne, num_processes=16, bandit_policy=none, bandit_policy_params={}, bandit_weights=none, batch_size=100000, plot_histogram=False, no_offpolicy_eval=False)
2020-01-23 13:36:38,335 : INFO : [pid 14484] Worker Worker(salt=140992192, workers=1,, username=fernando, pid=14484) running EvaluateIfoodModel(model_module=
recommendation.task.model.matrix_factorization, model_cls=MatrixFactorizationTraining, model_task_id=MatrixFactorizationTraining____500_False_4bb5a61c77, limit_list_size=50, nofilter_iteractio
ns_test=False, task_hash=none, num_processes=16, bandit_policy=none, bandit_policy_params={}, band
fernandocamargoti /
Created Apr 13, 2018
Rede Neural implementada com numpy
import numpy as np
from typing import List, Callable, Tuple
import math
def shuffle(a: np.ndarray, b: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
assert len(a) == len(b)
p = np.random.permutation(len(a))
return a[p], b[p]
View danfe_nfce_80.jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version using JasperReports Library version 6.3.0 -->
<!-- 2016-11-24T10:44:25 -->
<jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation="" name="danfe_nfce_80" pageWidth="226" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="214" leftMargin="2" rightMargin="10" topMargin="2" bottomMargin="2" uuid="5ce393bf-1e81-4d5c-8158-54fb1fa7db75">
<property name="" value="pixel"/>
<property name="" value="mm"/>
<property name="" value="ZmlsaWFsIEFTICw2OCwyLGI4NDNiMGE4LTgzOTEtNDU1MC05YzZkLTEzMmZjZDkxYTE0OTs="/>
<property name="" value="pixel"/>
<property name="

My Darktable Workflow

Basic workflow

  • Copy a film roll (a directory of RAW images) into a directory on the machine running Darktable.
  • Import the film roll into Darktable.
  • Review the images using lighttable mode and remove any images that are beyond repair.
  • Take a snapshot of the image so we can do a before and after comparison.
  • Adjust the white balance.
  • Exposure compensation and recovery.
View fragment_comissarios.xml
<?xml version="1.0" encoding="utf-8"?>
<include layout="@layout/progress_bar" />
fernandocamargoti /
Created Jun 16, 2014
TipoDeIngressoParaComissarioCard - Updated
package com.meubilhete.pontodevenda.ui.card;
import android.content.Context;
import android.content.res.Resources;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
View card_tipo_de_ingresso_para_comissario.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
You can’t perform that action at this time.