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

Commit a7a6614

Browse files
committed
style(test): 调整时间测试
1 parent f287d18 commit a7a6614

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: py/car_detector.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ def nms(rect_list, score_list):
112112

113113

114114
if __name__ == '__main__':
115-
start = time.time()
116-
117115
device = get_device()
118116
transform = get_transform()
119117
model = get_model(device=device)
@@ -149,6 +147,7 @@ def nms(rect_list, score_list):
149147

150148
# tmp_score_list = list()
151149
# tmp_positive_list = list()
150+
start = time.time()
152151
for rect in rects:
153152
xmin, ymin, xmax, ymax = rect
154153
rect_img = img[ymin:ymax, xmin:xmax]
@@ -170,6 +169,8 @@ def nms(rect_list, score_list):
170169
positive_list.append(rect)
171170
# cv2.rectangle(dst, (xmin, ymin), (xmax, ymax), color=(0, 0, 255), thickness=2)
172171
print(rect, output, probs)
172+
end = time.time()
173+
print('detect time: %d s' % (end - start))
173174

174175
# tmp_img2 = copy.deepcopy(dst)
175176
# draw_box_with_text(tmp_img2, tmp_positive_list, tmp_score_list)
@@ -184,7 +185,5 @@ def nms(rect_list, score_list):
184185
print(nms_scores)
185186
draw_box_with_text(dst, nms_rects, nms_scores)
186187

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

0 commit comments

Comments
 (0)