Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit f287d18

Browse files
committedApr 4, 2020
perf(detector): 检测运行时间
1 parent a94b057 commit f287d18

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎py/car_detector.py

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@description: 车辆类别检测器
88
"""
99

10+
import time
1011
import copy
1112
import cv2
1213
import numpy as np
@@ -111,6 +112,8 @@ def nms(rect_list, score_list):
111112

112113

113114
if __name__ == '__main__':
115+
start = time.time()
116+
114117
device = get_device()
115118
transform = get_transform()
116119
model = get_model(device=device)
@@ -181,5 +184,7 @@ def nms(rect_list, score_list):
181184
print(nms_scores)
182185
draw_box_with_text(dst, nms_rects, nms_scores)
183186

187+
end = time.time()
188+
print('detect time: %d s' % (end - start))
184189
cv2.imshow('img', dst)
185190
cv2.waitKey(0)

0 commit comments

Comments
 (0)
Failed to load comments.