/scivision_huggingface

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Hugging Face classification plugin for scivision

Model repository for the scivision project that enables loading of image classification models from Hugging Face.

Classifies images as one of the 1000 ImageNet classes.

Via the scivision API, the top 10 downloaded Image Classification models from Hugging Face (of models with a model card, last updated 9th May 2022) can be installed, loaded and run. The list of models is as follows:

  1. microsoft_swin_tiny_patch4_window7_224
  2. microsoft_beit_base_patch16_224
  3. google_vit_base_patch16_224
  4. microsoft_beit_base_patch16_224_pt22k_ft22k
  5. facebook_deit_base_distilled_patch16_224
  6. microsoft_swin_large_patch4_window7_224
  7. google_vit_base_patch32_384
  8. nvidia_mit_b0
  9. microsoft_swin_base_patch4_window7_224
  10. microsoft_swin_small_patch4_window7_224

and a bonus model I found just for fun...

Bonus: imjeffhi_pokemon_classifier

Models in this list can be loaded and used on data with a few lines of code, e.g.

from scivision import load_pretrained_model
this_repo = 'https://github.com/alan-turing-institute/scivision_huggingface'
model = load_pretrained_model(this_repo, model='microsoft_swin_tiny_patch4_window7_224')

You can then use the loaded model's predict function on image data loaded via scivision (see the user guide for details on how data is loaded via the scivision catalog):

model.predict(<image data>)