You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else: # If this box belongs to a new image file
self.labels.append(np.stack(current_labels, axis=0)) # appending the PREVIOUS labels
self.filenames.append(os.path.join(self.images_path, current_file)) # appending the PREVIOUS filenames
current_labels = []
current_file = i[0] # This will never be added, we are on the last line/iteration of loop
current_labels.append(i[1:]) # This will never be added, we are on the last line/iteration of loop
Proposal to fix (which I'm using and worked okay:
else: # If this box belongs to a new image file
self.labels.append(np.stack(current_labels, axis=0))
self.filenames.append(os.path.join(self.images_path, current_file))
current_labels = []
current_file = i[0]
current_labels.append(i[1:])
if idx == len(data)-1: # If this is the last line of the CSV file
self.labels.append(np.stack(current_labels, axis=0))
self.filenames.append(os.path.join(self.images_path, current_file))
Hope it helps!
The text was updated successfully, but these errors were encountered:
You're right, thank you for catching that, and thanks for the precise description.
It might be worthwhile mentioning that this bug only occurred if the last image of the dataset contains only one box.
Fixed now, and while I was at it I did a tiny bit of refactoring of parse_csv(), too. Two if-statements in there were unnecessary, and i is a terrible name for anything that is not an index.
Hey I think I found a bug in
ssd_batch_geneartor.parse_csv
. The issue comes from an example file as so:The last c.jpg will not be added to filenames and labels. It is skipped.
Notice that the last row is a new file (important because your logic looks at this condition).
The error appears here.
Proposal to fix (which I'm using and worked okay:
Hope it helps!
The text was updated successfully, but these errors were encountered: