Skip to content

Instantly share code, notes, and snippets.

View denisb411's full-sized avatar

Denis Candido denisb411

  • Campinas - SP, Brazil
View GitHub Profile
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
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
@denisb411
denisb411 / argparser-template.py
Last active August 26, 2020 01:39
A template I use for my python scripts
from argparse import ArgumentParser
__author__ = ""
__date__ = ""
__version__ = ""
__description__ = ""
if __name__ == '__main__':
argParser = ArgumentParser(description=__description__,
epilog='Developed by ' + __author__ + ' in ' + __date__)
@denisb411
denisb411 / grafana-dashboard-script.js
Last active September 1, 2022 08:15
Grafana dashboard script with postMessage communication
/* global _ */
/*
* Complex scripted dashboard
* This script generates a dashboard object that Grafana can load. It also takes a number of user
* supplied URL parameters (in the ARGS variable)
*
* Return a dashboard object, or a function
*
* For async scripts, return a function, this function must take a single callback function as argument,