Skip to content

Instantly share code, notes, and snippets.

View nitroxplunge's full-sized avatar
🤖

Isaac Wilcove nitroxplunge

🤖
View GitHub Profile
import tensorflow as tf
import numpy as np
import base64
import csv
import os
from PIL import Image
import io
def int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
import tensorflow as tf
from tf_trt_models.detection import download_detection_model, build_detection_graph
import tensorflow.contrib.tensorrt as trt
class Model:
def __init__(self, trt_graph, input_names):
self.config = tf.ConfigProto()
self.config.gpu_options.allow_growth = True
self.tf_session = tf.Session(config=self.config)
import xml.etree.cElementTree as ET
import os
from PIL import Image
import argparse
parser = argparse.ArgumentParser(description='Convert label files between datatypes.')
parser.add_argument('directory', metavar='d', type=str, nargs='+',
help='The directory of the dataset')
parser.add_argument('-r', action='store_true',
default=False, help='Replace the existing label files')
@nitroxplunge
nitroxplunge / csv-to-tfrecord.py
Last active March 3, 2021 10:44
Convert a .csv file in VOC format to .tfrecord
import tensorflow as tf
import numpy as np
import base64
import csv
import os
from PIL import Image
import io
def int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))