ImageCleaner - sort by class


I’d like to run the ImageCleaner, but instead of the order of the images showing up by top_losses, I’d like it to go through all the images of one class at a time.

I can try sorting the ds and idxs objects, but that seems like it will be tough because I’ll need to zip them together, but they aren’t primitive lists.

Another option is to sort by DataBunch before creating my learner. But I can’t find a function to sort a DataBunch.

Can anyone help come up with a way to pass the images sorted by class to the ImageCleaner?



Look into ClassConfusion. I developed the widget for that exactly :slight_smile:

1 Like

Wow! That looks useful. It looks like that widget let’s me see the confused images, and it even lets you go through the classes in a particular order.

But to delete or relabel them, I need to go and manually do that. I like the ImageCleaner widget, because I can just sit there and click through all my images and it will do the rest for me in a csv file.

So ImageCleaner gives me exactly what I need, except it doesn’t go through them in class by class (most confused or otherwise), but rather in order of top_losses. This is a problem for me because I have to context switch and think about if each image is correct which involved googling it and so on.

If I can get it to go through all my images that are labelled Class-1, it’s much quicker because I know what I’m looking for.

I think I can get it to work, I just need to reorder the ds and idsx before passing it into ImageCleaner so they’re in an order that keeps all the classes together rather than top losses which jumps around from class to class.

So all I need really is to know how to reorder the ds and idxs objects, and I have to sort them together. I’ve found on StackExchange an example with lists using zip and sorted, but the problem is that is with lists. Because the ds and idxs objects are more complicated data structures, I need to figure our how to zip them and sort them by a particular attribute.

1 Like

Perhaps you can merge the ideas for ClassConfusion and modify how we search for classes to get you them? :slight_smile:

1 Like