Skip to content

Instantly share code, notes, and snippets.

@mrbemani
mrbemani / auto_gen_from_video.py
Created August 21, 2020 10:27
generate samples from video using opencv
# -*- encoding: utf-8 -*-
import sys
import os
import argparse
import time
import cv2
PATH = os.path.abspath(os.path.dirname(__file__))
@mrbemani
mrbemani / mjpeg_stream_using_flask.py
Created July 20, 2020 08:14
use flask to push image sequence as mjpeg stream.
# learnt
# import cv2
# import flask and initialize app ...
# define global pushed_frame and frame_is_ready variable
def generateStreamFrame():
# grab global references to the output frame
global pushed_frame, frame_is_ready
@mrbemani
mrbemani / cv_stereo_show.py
Created July 5, 2020 05:57
show stereo camera images side-by-side using opencv
# -*- coding: utf-8 -*-
__author__ = 'Shi Qi'
import sys
import os
import argparse
import numpy as np
import cv2
@mrbemani
mrbemani / cv_calib_mono.py
Created July 5, 2020 05:54
calibrate mono camera using opencv
# -*- coding: utf-8 -*-
__author__ = 'Shi Qi'
import sys
import os
import argparse
import json
import numpy as np
import cv2
@mrbemani
mrbemani / tf_eval.py
Last active July 4, 2020 05:11
tensorflow_evaluate
#!/usr/bin/env python
# coding: utf-8
# In[1]:
MODEL_NAME = "keras_model"
GRAM_USAGE = 2048
INPUT_WIDTH = 224
INPUT_HEIGHT = 224
INPUT_CHANNEL = 3