an enhanced version of the fastai image classifier cleaner

EnhancedImageClassifierCleaner Implementation

Import fastai widget dependencies and fastcore utility classes

Implement default file_mover that moves files when recategorized or relabeled that works with parent_label as the get_y datablock parameter.(This will not work with RegexLabeller since the label is not the parent directory)

parent_move_file[source]

parent_move_file(fn, newcat)

Implement the main widget EnhancedImageClassifierCleaner widget which in turn is based on the fastai ImageClassifierCleaner widget.

class EnhancedImageClassifierCleaner[source]

EnhancedImageClassifierCleaner(learn, file_mover=parent_move_file, opts=(), height=128, width=256, max_n=30) :: GetAttr

Inherit from this to have all attr accesses in self._xtra passed down to self.default

Usage Instructions

The images are segregated into Train and Valid datasets and are further segregated by category.

The images shown by the cleaner are ordered by the model's uncertainty. The images where the classifier is least confident about is shown first, and a total of the top 30 images (in order of least confidence) is listed (the theory being, that the images where the classifier most probably got it wrong are the ones where it was least confident about).

So after either selecting some images for deletion or changing their categories, You can click to the Apply button to apply the changes, or click on Reset to revert all your pending changes.

When cleaning your data, make sure to check on all categories for both Train and Valid datasets, and click on the Apply button to finalize the changes to your dataset.

cleaner = EnhancedImageClassifierCleaner(learn)
cleaner

pic of enhanced-image-classifier-cleaner widget