Problem
The Models/species_mobilenetv3.pth file (6.0 MB) was committed directly to the Git repository using git add -f. While 6 MB is manageable today, as we add more models (freshness model, YOLO, etc.) the repository will become too large to clone.
Goal
Host all model weights on the Hugging Face Model Hub and download them at runtime, keeping Git for code only.
Acceptance Criteria
Commands Reference
pip install huggingface_hub
python -c "from huggingface_hub import hf_hub_download; hf_hub_download('jpdevhub/freshscan-models', 'species_mobilenetv3.pth', local_dir='Models/')"
Problem
The
Models/species_mobilenetv3.pthfile (6.0 MB) was committed directly to the Git repository usinggit add -f. While 6 MB is manageable today, as we add more models (freshness model, YOLO, etc.) the repository will become too large to clone.Goal
Host all model weights on the Hugging Face Model Hub and download them at runtime, keeping Git for code only.
Acceptance Criteria
https://huggingface.co/jpdevhub/freshscan-modelsspecies_mobilenetv3.pthto the HF Model Hubbackend/download_models.pyscript that useshuggingface_hubto download weights to a localModels/directory if not already presentbackend/startup.shupdated to callpython download_models.pybefore starting uvicornModels/directory added to.gitignoreModels/species_mobilenetv3.pthremoved from Git history usinggit filter-repoorgit-lfs migrate(or BFG Repo Cleaner)CONTRIBUTING.mdupdated with a note: 'Never commit .pth / .onnx / .bin model weights to Git'README.mdupdated with model download instructionsCommands Reference
pip install huggingface_hub python -c "from huggingface_hub import hf_hub_download; hf_hub_download('jpdevhub/freshscan-models', 'species_mobilenetv3.pth', local_dir='Models/')"