Yolov5: How do I use plot_results() function in yolo5

Created on 14 Oct 2020  路  8Comments  路  Source: ultralytics/yolov5

I know there is a silly answer for this but I am still unable to use plot_results() function in yolov5. Here is my code

from utils.general import plot_results
plot_results()

and it gives me the error message: No handles with labels found to put in legend.

Stale

Most helpful comment

@redwankarimsony you point it to the directory containing the results.txt you want to plot:
https://github.com/ultralytics/yolov5/blob/4d3680c81dad760e5d1ffe397ab2fc9169d9fb70/utils/general.py#L1275

For example:
plot_results(save_dir='runs/exp0')

All 8 comments

@redwankarimsony you point it to the directory containing the results.txt you want to plot:
https://github.com/ultralytics/yolov5/blob/4d3680c81dad760e5d1ffe397ab2fc9169d9fb70/utils/general.py#L1275

For example:
plot_results(save_dir='runs/exp0')

Thanks a lot @glenn-jocher

Hi,
I do as you said plot_results(save_dir='runs/exp_1') but I have the same error 'No handles with labels found to put in legend'
Do the names of predict labels and true labels have to have a specific name ?
Thank you

@constantinfite git pull to update your code and make sure you have actual results.txt files in the directory you are pointing to.

@glenn-jocher My files are like this

image

I don't have a results.txt file, this file regroups all the txt files ?

@constantinfite right.

plot_results() plots results.txt files.

You may want to start with the custom training tutorial, it explains all of this for new users:
https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data

Yes I was thinking that plot_results taking inference output but it's only validation output
thanks anyway @glenn-jocher

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dereyly picture dereyly  路  4Comments

xinxin342 picture xinxin342  路  3Comments

DucTaiVu picture DucTaiVu  路  3Comments

we1pingyu picture we1pingyu  路  3Comments

linhaoqi027 picture linhaoqi027  路  4Comments