P-Karthik-Mohan commited on
Commit
d9ea810
·
verified ·
1 Parent(s): e05fd05

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -13
README.md CHANGED
@@ -1,13 +1,18 @@
1
- ---
2
- title: Classifier
3
- emoji: 📉
4
- colorFrom: pink
5
- colorTo: gray
6
- sdk: gradio
7
- sdk_version: 5.46.1
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
1
+ # Cow Breed Classifier (Roboflow -> Hugging Face Space)
2
+
3
+ ## What to upload to the Space
4
+ - `dataset.zip` : export zip from Roboflow (pick YOLOv5 PyTorch or Pascal VOC when downloading).
5
+ - Place `dataset.zip` in the Space root (where `app.py` sits) before committing.
6
+
7
+ OR
8
+ - `model.pth` : If you already trained a model elsewhere, upload `model.pth` (the saved dict with keys `model_state` and `classes`) to skip training.
9
+
10
+ ## How it works
11
+ - On first start:
12
+ - If `model.pth` exists: the app loads it and serves predictions.
13
+ - Else if `dataset.zip` exists: app extracts it, converts detection labels -> classification folders, and trains a small ResNet18 model for a few epochs, then saves `model.pth`.
14
+ - Use the UI to upload images and see top-3 breed predictions.
15
+
16
+ ## Notes & tips
17
+ - 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.
18
+ - If training fails due to PyTorch issues in the Space build, train locally (or on Colab) and upload `model.pth`.