Skip to content

Instantly share code, notes, and snippets.

def __init__(self, threshold, batch_size, video_path, out_path):
self.preprocessed_image_queue = Queue(10)
def preprocess_image(self, i, img, img_size):
img = preprocess_image(img, img_size)
self.preprocessed_image_queue.put((i, img), timeout=0.1)
print(self.preprocessed_image_queue.qsize())
def main(self):
ts = []
@2p990i9hpral
2p990i9hpral / paste_image.py
Created May 21, 2019 04:42
paste small image to large image using numpy(openCV)
blank_img = np.zeros([max(img_w, img_h)*2, max(img_w, img_h)*2, img.shape[2]], np.uint8)
blank_img[0:img_h, 0:img_w] = img
@2p990i9hpral
2p990i9hpral / make_car_classes.py
Last active May 17, 2019 08:18
CompCars Dataset images to car classes
import os
import shutil
from tqdm import tqdm
def copytree(src, dst, symlinks=False, ignore=None):
if not os.path.isdir(dst):
os.mkdir(dst)
@2p990i9hpral
2p990i9hpral / crop_images.py
Last active May 17, 2019 08:11
crop CompCars Dataset images
import os
import cv2
import shutil
from tqdm import tqdm
root_img_path = os.path.abspath("./image")
root_label_path = os.path.abspath("./label")
out_img_path = os.path.abspath("./out_path")
#-*- coding:utf-8 -*-
import os
from tqdm import tqdm
def returnFileList(dirname, extract):
fileList = []
filenames = os.listdir(dirname)
for filename in filenames:
ext = os.path.splitext(filename)[-1]
#-*- coding:utf-8 -*-
import os
import sys
CURRENT_DIR = os.getcwd()
def progressBar(value, endvalue, bar_length=20):
percent = float(value) / endvalue
arrow = '-' * int(round(percent * bar_length)-1) + '>'
spaces = ' ' * (bar_length - len(arrow))
import socket
import time
HOST = '10.8.0.1'
PORT = 2323
ADDR = (HOST,PORT)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDR)
imgFile = "./image.jpg"
import socket
import os
import time
import sys
import time
src = "./save/"
def fileName():
dte = time.localtime()
python
import tensorflow as tf
hello = tf.constant('hello, tensorflow world')
sess = tf.Session()
print(sess.run(hello))
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HINSTANCE g_hInst;
HWND hWndMain;
LPCTSTR lpszClass = TEXT("Hexa2");
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance