Skip to content

Instantly share code, notes, and snippets.

@wlstyql
wlstyql / yolov4.py
Created October 8, 2020 04:27 — forked from YashasSamaga/yolov4.py
YOLOv4 inference using OpenCV DNN
import cv2
import time
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)]
class_names = []
with open("classes.txt", "r") as f:
class_names = [cname.strip() for cname in f.readlines()]