I am continuing from my first lesson of bird_or_forest and following along the second lesson on fastbook. I am trying to run the following cell:
cleaner = ImageClassifierCleaner (learn)
cleaner
Where learn is of type vision_learner
The output is stuck with a message
Loading widget…
There are no dropdown boxes to allow me to edit or delete.
Also, the images are printed in column not horizontal.
I am on Kaggel and I am on Firefox browser on Mac, if that matters.
Nope. That is still an open issue. There are some reports about this. My understanding so far is that it has got to do with ipywidgets. As suggested here, I tried to upgrade ipywidgets, and I got an incompatibility error.
This issue is discussed here too. But, no solution.
Please update this issue if have this resolved.
Chiming in here. I can’t get ImageClassifierCleaner to work on kaggle or on Jupyter on my local machine. I’ve searched the forums and tried all the suggestions I’ve found.
Struggled with this myself for several days trying to get ImageClassifierCleaner running in Kaggle.
A few findings that may (or may not) be useful for others:
The ImageClassifierCleaner class depends on ipywidgets. It was unclear if ipywidgets works on Kaggle - it does. After installing various dependency combinations, I was able to get the FastAI Vision widgets working with the default, preinstalled versions of fastai and ipywidgets on Kaggle (as of 3/19/24)
ImageClassifierCleaner does not seem to be able to handle large datasets. The best I could manage was 7 categories with 30 training examples in each (~210 images in total).
Loading 210 images into ImageClassifierCleaner was a struggle. I wasn’t able to edit the full data set at once - the widget would freeze when changing categories.
Re-running the cell with the cleaner code would allow me to continue editing to an extent. Eventually even re-running the cell would freeze before I could get through the full data set.
“Restart & Clear Cell Outputs” on the Kaggle session would allow me to restart clean and walk through the entire notebook again to resume cleaning. It took several iterations of restarting the notebook to fully clean all seven image categories.
Edits (delete/change) do not seem to be persisted on the cleaner object when changing categories. I needed to run cleaner.delete / cleaner.change before changing categories.
Limiting the maximum number of images displayed helped, cleaner = ImageClassifierCleaner(learn, max_n=5) for instance. I was able to progressively expand cleaning by increasing n_max and iterating. Ultimately I was forced to load the full dataset as I am not aware of any way to paginate the data for cleaning.
This helped me to finally see the images in kaggle. Then I edit the images for a particular class and then run the next line of code to do the deletion or movement.
for idx in cleaner.delete(): cleaner.fns[idx].unlink()
for idx,cat in cleaner.change(): shutil.move(str(cleaner.fns[idx]), path/cat)
Unfortunately once you do that you cannot rerun the cell with the ImageClassifierCleaner, to view the updates you made, since it will throw a file not found error. So you may have to create the learner and retrain if you want to keep editing that particular class