What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-17 01:25:17
tensorflow lite raspberry pi object detection using usb webcam
import time import re import numpy as np from tflite_runtime.interpreter import Interpreter import cv2 CAMERA_WIDTH = 640 CAMERA_HEIGHT = 480 def load_labels(path): """Loads the labels file. Supports files with or without index number... Add solution -
Python 2022-02-13 11:55:02
facerecognizer python
import face_recognition import os import cv2 KNOWN_FACES_DIR = 'known_faces' UNKNOWN_FACES_DIR = 'unknown_faces' TOLERANCE = 0.6 FRAME_THICKNESS = 3 FONT_THICKNESS = 2 MODEL = 'cnn' # default: 'hog', other one can be 'cnn' - CUDA accelerated (if availa... Add solution -
Python 2022-02-02 20:50:46
python opencv draw rectangle
image = cv2.imread(path) start_point = (5, 5) end_point = (220, 220) # Blue color in BGR color = (255, 0, 0) # Line thickness of 2 px thickness = 2 # Using cv2.rectangle() method # Draw a rectangle with blue line borders of thickness of 2... Add solution -
Python 2022-01-30 21:35:03
how to convert yolo format annotation t nomrla PYTHON
dh,dw,_ = img.shape f = open('image_100.txt','r') data = f.readline() f.close() data = data.split(' ') x_cen = float(data[1]) y_cen = float(data[2]) w = float(data[3]) h = float(data[4].replace('\n', '')) left = int((x_cen - (w / 2)) * dw) right = in... Add solution -
Other 2021-10-21 20:19:13
Onject ssd detection code
import cv2thres = 0.45 # Threshold to detect objectcap = cv2.VideoCapture(1)cap.set(3,1280)cap.set(4,720)cap.set(10,70)classNames= []classFile = 'coco.names'with open(classFile,'rt') as f: classNames = f.read().rstrip('\n').split('\n')configPath = 'ssd... Add solution -
Python 2021-10-14 00:25:13
object color detection python program youtube
# Python code for Multiple Color Detection import numpy as np import cv2 # Capturing video through webcam webcam = cv2.VideoCapture(0) # Start a while loop while(1): # Reading the video from the # webcam in image frames _... Add solution -
Python 2021-10-13 21:49:04
cut out faces from photos in dir python
import cv2 import sys imagePath = sys.argv[1] image = cv2.imread(imagePath) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) faceCascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml") faces = faceCascade.... Add solution -
Python 2021-10-09 09:15:05
stackoverflow ocr,cropping letters
import cv2 import numpy as np #import image image = cv2.imread('image.png') #grayscale gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) cv2.imshow('gray', gray) cv2.waitKey(0) #binary ret,thresh = cv2.threshold(gray,127,255,cv2.THRESH_BINARY_INV) cv2.imsh... Add solution