Closed valentinitnelav closed 2 years ago
Hm, how do we get rid of the github-actions bot regarding the message above "thank you for your interest in YOLOv5..."? :D
we should check this for the updated code.
Right now I'm using pandas dataframe and match images and labels by their file names.
class_df = pd.merge(image_df, label_df, on='file_names', how='outer')
outer will in theory keep the images without labels in the dataframe, but later on all nans can be disabled.
if not config.no_labels: df = df.dropna() df.reset_index(drop=True, inplace=True)
Hi @stark-t ,
I run today on a JupyterLab notebook a similar code taken from file
2_split_dataset.py
, lines:In my case,
os.listdir
doesn't return the file names in alphabetical order, so one needs to be extra careful with the correspondence between image and annotation file names.For example, if you display the first and last element of
temp
, you can getI think to solve this issue one needs to sort both lists before doing the shuffeling:
Then you get them aligned:
Not sure how this worked in your case, because otherwise, the YOLO model would have given complete random results since images do not get paired with their actual annotation files. Or maybe is a particular behavior only on Linux? I saw this suggested on SO here:
Whatever the case, to be defensive, we should always sort the two lists.
FYI: to check for equality I did this: