Commit ba0b15f2 authored by jack's avatar jack

Merge branch 'master' of gitlab.ubocare.com:jiajunjie/face_detect

update
parents 0c0aff4e 6b585429
......@@ -86,4 +86,5 @@ class DarknetYolo:
k=k+1
return lists
else:
print("Cann't detect objects,please check image!")
#print("Cann't detect objects,please check image!")
return []
......@@ -2,6 +2,9 @@ import cv2 as cv
import os.path
import darknet as interface
import argparse
import sys
import time
import datetime
configPath='hat-obj-test.cfg'
......@@ -54,9 +57,14 @@ while cv.waitKey(1) < 0:
cap.release()
break
detections_lists = []
t1 = time.time()
detections_lists = yolo.getdetresults(frame)
print(len(detections_lists ))
t = time.time()
print(int(round((t-t1) * 1000)))
if detections_lists:
print(len(detections_lists ))
for i in range( len(detections_lists) ):
# get x,y,w,h
x1 = detections_lists[i][0]
......@@ -71,5 +79,9 @@ while cv.waitKey(1) < 0:
text = "{}: {:.4f}".format(label, confidence )
cv.putText(frame, text, (x1, y1 - 5), cv.FONT_HERSHEY_SIMPLEX,
0.5, color, 1, lineType=cv.LINE_AA)
else:
print(0)
cv.imshow("Tag", frame)
#print(detections_lists)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment