Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 4_efficientdet/lib/infer_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ def Predict(self, img_path, class_list, vis_threshold = 0.4, output_folder = 'In
for box_id in range(boxes.shape[0]):
pred_prob = float(scores[box_id])
if pred_prob < vis_threshold:
break
continue
pred_label = int(labels[box_id])
xmin, ymin, xmax, ymax = boxes[box_id, :]
xmin, ymin, xmax, ymax = int(xmin), int(ymin), int(xmax), int(ymax)
color = colors[pred_label]
cv2.rectangle(output_image, (xmin, ymin), (xmax, ymax), color, 2)
text_size = cv2.getTextSize(class_list[pred_label] + ' : %.2f' % pred_prob, cv2.FONT_HERSHEY_PLAIN, 1, 1)[0]
Expand Down