-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
32 lines (25 loc) · 894 Bytes
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from lib.video_streamer import *
import os
# get root execution path
cwd = os.getcwd()
# darknet yolo configuration settings
thresh = 0.9
config_path = os.path.join(cwd, "cfg/suit-tiny.test.cfg")
weight_path = os.path.join(cwd, "cfg/suit-tiny.weights")
meta_path = os.path.join(cwd, "cfg/suit-tiny.data")
triplet_matcher_path = os.path.join(cwd, "cfg/triplet_semihard_final.keras")
# video configuration settings
proto_path = os.path.join(cwd, "assets/videos/neilman/")
# Init video constructor with suit config
video = VideoStreamer(proto_path, config_path, weight_path, meta_path, triplet_matcher_path, thresh)
video.start()
apparels = []
detections = []
while video.counter < video.frame_count:
frame = video.read()
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
video.stop()
cv2.destroyAllWindows()
break
cv2.destroyAllWindows()