Add HuggingFace Model Wrapper for Multi-Class Classification #3710
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
*The results of running the existing models are from workstation, and for the hugging face model, the results are from a different machine, so it is difficult to compare the time directly. Just a note.
Checked models
I haven't checked them all (too many models), but most of the models in the list below are available.
https://huggingface.co/models?pipeline_tag=image-classification
How to test
Install transformers
pip install transformers
API Examples
CLI Examples
(venv) ~/otx$ otx train \ --model otx.algo.classification.huggingface_model.HuggingFaceModelForMulticlassCls \ --model.model_name_or_path facebook/deit-tiny-patch16-224 \ --data_root /datasets/otx_v2_dataset/multiclass_classification/multiclass_food101_large \ --work_dir otx-workspace-hf-cli --max_epochs 3
Checklist
License
Feel free to contact the maintainers if that's a concern.