Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detect.py --hide-conf --hide-labels --line-thickness options #2658

Merged
merged 9 commits into from
Apr 23, 2021
Prev Previous commit
Next Next commit
command line option for line thickness and hiding labels
  • Loading branch information
Ashafix committed Apr 23, 2021
commit e486e9f81e4fde3533eba96569ef612d23fc4764
5 changes: 3 additions & 2 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def detect(save_img=False):
f.write(('%g ' * len(line)).rstrip() % line + '\n')

if save_img or opt.save_crop or view_img: # Add bbox to image
c = int(cls) # integer class
if not opt.hide_labels:
label = f'{names[int(cls)]} {conf:.2f}'
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=opt.line_thickness)
label = f'{names[c]} {conf:.2f}'
plot_one_box(xyxy, im0, label=label, color=colors[c], line_thickness=opt.line_thickness)

# Print time (inference + NMS)
print(f'{s}Done. ({t2 - t1:.3f}s)')
Expand Down