Skip to content

Instantly share code, notes, and snippets.

View denisb411's full-sized avatar

Denis Candido denisb411

  • Campinas - SP, Brazil
View GitHub Profile
@denisb411
denisb411 / bashrc
Created July 12, 2025 00:55
my bashrc default configuration
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@denisb411
denisb411 / logging.py
Created January 28, 2025 03:09
logging
import logging
from datetime import datetime
class CustomFormatter(logging.Formatter):
"""Logging Formatter to add colors and count warning / errors"""
grey = "\x1b[38;21m"
yellow = "\x1b[33;21m"
light_blue = "\x1b[1;36m"
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from airflow.operators.subdag import SubDagOperator
from airflow.utils.task_group import TaskGroup
from random import uniform
from datetime import datetime
default_args = {
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from airflow.operators.subdag import SubDagOperator
from airflow.utils.task_group import TaskGroup
from random import uniform
from datetime import datetime
default_args = {
"""
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record
# Create test data:
python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record
"""
from __future__ import division
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record
# Create test data:
python generate_tfrecord.py --csv_input=images/test_labels.csv --image_dir=images/test --output_path=test.record
"""
from __future__ import division
import datetime
import os
import sys
from threading import Thread
from argparse import ArgumentParser
import io
from flask import Flask, render_template, Response
from flask import send_file
@denisb411
denisb411 / config-weights-relation.csv
Created February 21, 2020 20:58
Tensorflow's object detection config-weights relations, with the download link.
faster_rcnn_inception_resnet_v2_atrous_coco.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz
faster_rcnn_inception_resnet_v2_atrous_coco.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_lowproposals_coco_2018_01_28.tar.gz
faster_rcnn_inception_resnet_v2_atrous_cosine_lr_coco.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz
faster_rcnn_inception_resnet_v2_atrous_cosine_lr_coco.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_lowproposals_coco_2018_01_28.tar.gz
faster_rcnn_inception_resnet_v2_atrous_oid_v4.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz
faster_rcnn_inception_resnet_v2_atrous_oid_v4.config http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_
@denisb411
denisb411 / train-od.py
Last active March 6, 2020 12:58
Script used to facilitate the process of training of tensorflow object detection API
import os, sys
import shutil
from argparse import ArgumentParser
from random import randrange
from PIL import Image
import glob
import re
import xml.etree.ElementTree as ET
import pandas as pd
import tensorflow as tf