Skip to content

Instantly share code, notes, and snippets.

Fernando Camargo fernandocamargoti

View GitHub Profile
View dataset.py
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
View consolidation.py
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
fernandocamargoti / aug.py
Created Apr 29, 2020
Conditional Augmenter
View aug.py
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
:class:`~imgaug.augmenters.meta.Conditional`.
Let ``p`` be the fraction of images (or other data) to augment.
View gist:5d330c6ec37578c5fb72bc39524ccd91
INFO: [pid 14484] Worker Worker(salt=140992192, workers=1, host=ufgdeepfood.RadSquare.cloud, 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, host=ufgdeepfood.RadSquare.cloud, 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
fernandocamargoti / multilayer_perceptron.py
Created Apr 13, 2018
Rede Neural implementada com numpy
View multilayer_perceptron.py
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 6.3.0.final using JasperReports Library version 6.3.0 -->
<!-- 2016-11-24T10:44:25 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" 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="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="mm"/>
<property name="com.jaspersoft.studio.data.sql.tables" value="ZmlsaWFsIEFTICw2OCwyLGI4NDNiMGE4LTgzOTEtNDU1MC05YzZkLTEzMmZjZDkxYTE0OTs="/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio
View darktable-workflow.md

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"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/progress_bar" />
@fernandocamargoti
fernandocamargoti / TipoDeIngressoParaComissarioCard.java
Created Jun 16, 2014
TipoDeIngressoParaComissarioCard - Updated
View TipoDeIngressoParaComissarioCard.java
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="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
You can’t perform that action at this time.