Skip to content

Commit

Permalink
Pull upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sohang3112 committed Oct 19, 2023
2 parents f7a75db + 338f3bc commit eb1aafc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions classify/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,13 @@ def run(
'label': names[top_pred_index],
'confidence': f'{prob[top_pred_index]:.2f}'
})

# Write results
text = '\n'.join(f'{prob[j]:.2f} {names[j]}' for j in top5i)
if save_img or view_img: # Add bbox to image
annotator.text((32, 32), text, txt_color=(255, 255, 255))
if save_txt: # Write to file
with open(f'{txt_path}.txt', 'a') as f:
f.write(text + '\n')
# Write results
text = '\n'.join(f'{prob[j]:.2f} {names[j]}' for j in top5i)
if save_img or view_img: # Add bbox to image
annotator.text([32, 32], text, txt_color=(255, 255, 255))
if save_txt: # Write to file
with open(f'{txt_path}.txt', 'a') as f:
f.write(text + '\n')

# Stream results
im0 = annotator.result()
Expand Down

0 comments on commit eb1aafc

Please sign in to comment.