Hello all,
If you’ve been using the FileDeleter
widget to clean your data, some changes came out today that may interest you. source
FileDeleter
was removed in favor of two new widgets: ImageDeleter
and ImageRelabeler
.
ImageDeleter
is essentially the same as the old FileDeleter
.
ImageRelabeler
renders the files you pass in and lets you re-label them. This is to find mis-categorized images in your data directory. NOTE: ImageRelabeler
currently only works with files where labels were created from the names of their parent directory (i.e. with .from_folder()). The widget moves mislabeled photos from the incorrect parent directory to the properly-labeled parent directory.
To relabel an image, just click the proper label in the widget dropdown.
Both widgets take a formatted dataset from DatasetFormatter
. You can easily specify which dataset you’d like to render by passing in DatasetType.Valid
, DatasetType.Train
or DatasetType.Test
to the ds_type
keyword arg in DatasetFormatter.from_toplosses
.
All three classes are available in fastai.widgets
.
Example use:
ds, idxs = DatasetFormatter().from_toplosses(learn, ds_type=DatasetType.Train)
ImageRelabeler(ds, idxs)
# or
ImageDeleter(ds, idxs)
Real docs for these are coming soon!