Instructions to use dima806/headgear_image_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dima806/headgear_image_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="dima806/headgear_image_detection") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("dima806/headgear_image_detection") model = AutoModelForImageClassification.from_pretrained("dima806/headgear_image_detection") - Inference
- Notebooks
- Google Colab
- Kaggle
Returns headgear type given an image.
See https://www.kaggle.com/code/dima806/headgear-image-detection-vit for more details.
Classification report:
precision recall f1-score support
BERET 1.0000 0.9565 0.9778 115
FEDORA 0.9913 1.0000 0.9956 114
SOMBERO 1.0000 1.0000 1.0000 115
HARD HAT 1.0000 1.0000 1.0000 115
FEZ 1.0000 0.9912 0.9956 114
ZUCCHETTO 1.0000 0.9912 0.9956 114
TOP HAT 1.0000 1.0000 1.0000 115
DEERSTALKER 0.9913 1.0000 0.9956 114
ASCOT CAP 0.9500 1.0000 0.9744 114
PORK PIE 0.9739 0.9825 0.9782 114
MILITARY HELMET 1.0000 1.0000 1.0000 115
BICORNE 1.0000 0.9912 0.9956 114
FOOTBALL HELMET 1.0000 1.0000 1.0000 115
MOTARBOARD 0.9913 1.0000 0.9956 114
BOATER 1.0000 1.0000 1.0000 115
PITH HELMET 0.9913 1.0000 0.9956 114
SOUTHWESTER 1.0000 0.9912 0.9956 114
BOWLER 0.9912 0.9825 0.9868 114
GARRISON CAP 1.0000 0.9912 0.9956 114
BASEBALL CAP 1.0000 1.0000 1.0000 115
accuracy 0.9939 2288
macro avg 0.9940 0.9939 0.9939 2288
weighted avg 0.9940 0.9939 0.9939 2288
- Downloads last month
- 2,057
Model tree for dima806/headgear_image_detection
Base model
google/vit-base-patch16-224-in21k