Skip to content

Instantly share code, notes, and snippets.

@dscha09
dscha09 / dataset_to_tfrecord.py
Created January 9, 2019 05:54 — forked from saghiralfasly/dataset_to_tfrecord.py
Python script to create tfrecords from pascal VOC data set format (one class detection) for Object Detection API Tensorflow, where it divides dataset into (90% train.record and 10% test.record)
import os
import io
import glob
import hashlib
import pandas as pd
import xml.etree.ElementTree as ET
import tensorflow as tf
import random
from PIL import Image
@dscha09
dscha09 / UninstallTensorFlow.txt
Created September 13, 2018 03:46 — forked from supriya-gdptl/UninstallTensorFlow.txt
Steps to uninstall tensorflow
pip show tensorflow
pip uninstall tensorflow
# Tensorflow 1.4 works only with Python 3.5
# to install downgrade Python 3.6 to Python 3.5 in Anaconda
conda install python=3.5
# now install tensorflow 1.4
sudo apt-get install python3-pip python3-dev
pip install tensorflow
@dscha09
dscha09 / opencv_webcam_multithread.py
Created September 7, 2018 10:43 — forked from allskyee/opencv_webcam_multithread.py
opencv python camera frame grab and display on different threads with safe synchronization
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@dscha09
dscha09 / split-video-by-frame.py
Created August 20, 2018 09:41 — forked from keithweaver/split-video-by-frame.py
Using OpenCV takes a mp4 video and produces a number of images.
'''
Using OpenCV takes a mp4 video and produces a number of images.
Requirements
----
You require OpenCV 3.2 to be installed.
Run
----
Open the main.py and edit the path to the video. Then run: