Run this model with HF Jobs
Run sheniz/vigora-photo-classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/sheniz/vigora-photo-classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/sheniz/vigora-photo-classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use sheniz/vigora-photo-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sheniz/vigora-photo-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="sheniz/vigora-photo-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("sheniz/vigora-photo-classifier") model = AutoModelForImageClassification.from_pretrained("sheniz/vigora-photo-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Vigora photo classifier
Sorts photos attached to emergency reports in Vigora into three classes, so the 112 operator sees at a glance whether the photo matches the reported incident.
| class | Bulgarian | confirms incident type |
|---|---|---|
fire |
пожар | fire |
accident |
катастрофа | accident |
normal |
нищо опасно | - |
fire: fire or smokeaccident: a car crashnormal: nothing dangerous
How it was made
Fine-tuned from google/vit-base-patch16-224-in21k (ViT) with the transformers Trainer: 4 epochs, learning rate 5e-05, batch size 32, the best epoch chosen by validation macro F1.
Images: 1920 train, 240 validation, 240 test, balanced across the three classes, resized to at most 512 px, with exact and near duplicates removed so the same photo is never in both train and test.
| dataset | license | images used |
|---|---|---|
| Vertex-Test/FireSmokeDataset | apache-2.0 | 800 |
| hiennguyen9874/traffic-accident-detection | unknown / неизвестен | 1200 |
| frgfm/imagenette | apache-2.0 (Images are a subset of ImageNet, whose terms of access allow non-commercial research and educational use only.) | 400 |
The training data includes images with an unknown license and images whose terms allow non-commercial use only, so this model is not licensed for commercial use.
Test results
Accuracy 0.954, macro F1 0.954 on 240 test images.
| class | precision | recall | F1 | images |
|---|---|---|---|---|
| fire | 0.952 | 0.988 | 0.969 | 80 |
| accident | 0.938 | 0.950 | 0.944 | 80 |
| normal | 0.974 | 0.925 | 0.949 | 80 |
Limitations
- Trained on a few thousand images; it can be wrong, especially on unusual angles, night photos, or scenes unlike the training data.
- Used only as a signal for the 112 operator, never to reject a report.
- Public datasets are mostly web and dashcam images; results on real phone photos may be lower.
Usage
from transformers import pipeline
classifier = pipeline("image-classification", model="sheniz/vigora-photo-classifier")
classifier("photo.jpg")
Vigora: класификатор на снимки
Разпределя снимките към сигналите във Vigora в три класа, за да може операторът на 112 веднага да види дали снимката отговаря на подадения сигнал.
| клас | значение | потвърждава тип сигнал |
|---|---|---|
fire |
пожар | fire |
accident |
катастрофа | accident |
normal |
нищо опасно | - |
fire(пожар): огън или димaccident(катастрофа): пътнотранспортно произшествиеnormal(нищо опасно): няма нищо опасно на снимката
Как е обучен
Дообучен от google/vit-base-patch16-224-in21k (ViT) с transformers Trainer: 4 епохи, скорост на обучение 5e-05, размер на партидата 32; избрана е най-добрата епоха по macro F1 на валидационните данни.
Снимки: 1920 за обучение, 240 за валидация, 240 за тест, по равно от трите класа, намалени до най-много 512 px, без еднакви и почти еднакви снимки, така че една и съща снимка никога не е и в обучението, и в теста.
| набор от данни | лиценз | използвани снимки |
|---|---|---|
| Vertex-Test/FireSmokeDataset | apache-2.0 | 800 |
| hiennguyen9874/traffic-accident-detection | unknown / неизвестен | 1200 |
| frgfm/imagenette | apache-2.0 (Images are a subset of ImageNet, whose terms of access allow non-commercial research and educational use only.) | 400 |
Част от данните са с неизвестен лиценз или позволяват само некомерсиална употреба, затова моделът не е лицензиран за комерсиална употреба.
Резултати от теста
Точност 0.954, macro F1 0.954 върху 240 тестови снимки.
| клас | прецизност | пълнота | F1 | снимки |
|---|---|---|---|---|
| пожар | 0.952 | 0.988 | 0.969 | 80 |
| катастрофа | 0.938 | 0.950 | 0.944 | 80 |
| нищо опасно | 0.974 | 0.925 | 0.949 | 80 |
Ограничения
- Обучен е върху няколко хиляди снимки; може да греши, особено при необичаен ъгъл, нощни снимки или сцени, различни от данните за обучение.
- Използва се само като сигнал за оператора на 112 и никога не отхвърля сигнал.
- Публичните набори са главно снимки от интернет и видеорегистратори; върху истински снимки от телефон резултатите може да са по-ниски.
- Downloads last month
- 37
Model tree for sheniz/vigora-photo-classifier
Base model
google/vit-base-patch16-224-in21k