This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import os | |
| import time | |
| import sys | |
| import time | |
| src = "./save/" | |
| def fileName(): | |
| dte = time.localtime() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python | |
| import tensorflow as tf | |
| hello = tf.constant('hello, tensorflow world') | |
| sess = tf.Session() | |
| print(sess.run(hello)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
NewerOlder