Spaces:
Configuration error
Configuration error
|
Download README.md from P-Karthik-Mohan/classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/P-Karthik-Mohan/classifier/resolve/main/README.md
- Command line
-
hf download hf://spaces/P-Karthik-Mohan/classifier/README.md
-
curl -L -o README.md https://huggingface.co/spaces/P-Karthik-Mohan/classifier/resolve/main/README.md
1.07 kB
Cow Breed Classifier (Roboflow -> Hugging Face Space)
What to upload to the Space
dataset.zip: export zip from Roboflow (pick YOLOv5 PyTorch or Pascal VOC when downloading).- Place
dataset.zipin the Space root (whereapp.pysits) before committing.
- Place
OR
model.pth: If you already trained a model elsewhere, uploadmodel.pth(the saved dict with keysmodel_stateandclasses) to skip training.
How it works
- On first start:
- If
model.pthexists: the app loads it and serves predictions. - Else if
dataset.zipexists: app extracts it, converts detection labels -> classification folders, and trains a small ResNet18 model for a few epochs, then savesmodel.pth.
- If
- Use the UI to upload images and see top-3 breed predictions.
Notes & tips
- Training on CPU (Hugging Face free Spaces) can be slow. Keep
NUM_EPOCHS=3(default) small. You can increase by setting an environment variable in the Space settings. - If training fails due to PyTorch issues in the Space build, train locally (or on Colab) and upload
model.pth.