Skip to content

Instantly share code, notes, and snippets.

@dscha09
dscha09 / split-video-by-frame.py
Created Aug 20, 2018 — forked from keithweaver/split-video-by-frame.py
Using OpenCV takes a mp4 video and produces a number of images.
View split-video-by-frame.py
'''
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:
@dscha09
dscha09 / opencv_webcam_multithread.py
Created Sep 7, 2018 — forked from allskyee/opencv_webcam_multithread.py
opencv python camera frame grab and display on different threads with safe synchronization
View opencv_webcam_multithread.py
#!/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)
View UninstallTensorFlow.txt
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 / dataset_to_tfrecord.py
Created Jan 9, 2019 — 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)
View dataset_to_tfrecord.py
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