CoolFace
Apppublic

rdat/fastai-prac-guitar-classifier

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes
App README

Guitar Type Image Classifier

This is an image classifier app that identifies a guitar's type based on its image. This was done as a quick mini-project to try out the FastAI+Gradio+HF Spaces stack. The model itself has been fine-tuned from ResNet18 using the FastAI API.

List of guitar types in this app's scope:

  1. 1.Acoustic Bass Guitar
  2. 2.What it sounds like
  3. 3.Archtop Guitar
  4. 4.What it sounds like
  5. 5.Classical Guitar
  6. 6.What it sounds like
  7. 7.Electric Bass Guitar
  8. 8.What it sounds like
  9. 9.Electric Guitar
  10. 10.What it sounds like
  11. 11.Flat-top Guitar
  12. 12.What it sounds like

Assumptions and Caveats:

  • —Semi-acoustic guitars of all types have been kept in the acoustic category.
  • —There was some manual data cleaning done between data augmentation and model fine-tuning. The details are described in the train.py script.

Observations:

  • —The most commonly confused category pairs are acoustic bass : classical and classical : flat-top. This makes sense because apart from the headstock and the strings themselves, these 3 categories are largely similar. Higher resolution images for training should help the model in doing a better job of distinguishing betweeen these categories.
  • —The fine-tuning works well despite being given less than 200 images per class and only 5 training epochs.

Using the app:

  1. 1.The app can be accessed at https://huggingface.co/spaces/rdat/fastai-prac-guitar-classifier. Add an image to the input area and click submit to get the model's inference along with probability percentages.
  2. 2.The train.py script can be executed with the appropriate config parameters to train (fine-tune) a new model.

Next Steps:

  1. 1.Add a component to the Gradio interface that lets the user play a sample of the instrument when its corresponding example image is selected.
  2. 2.Experiment with more recent ResNet models and supply them with more data for fine-tuning.
  3. 3.Perform more extensive hyperparameter tuning.
  4. 4.Add performance metrics to the README file.
Notes:
1. All external links fall under the Creative Commons license.
2. Check out the HF Spaces configuration reference at https://huggingface.co/docs/hub/spaces-config-reference