Spaces:
Running on Zero
Running on Zero
|
Download docs/deployment.md from muhammadpriv001/Object-Intelligence-Backend: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/muhammadpriv001/Object-Intelligence-Backend/resolve/main/docs/deployment.md
- Command line
-
hf download hf://spaces/muhammadpriv001/Object-Intelligence-Backend/docs/deployment.md
-
curl -L -o deployment.md https://huggingface.co/spaces/muhammadpriv001/Object-Intelligence-Backend/resolve/main/docs/deployment.md
1.13 kB
| # Deployment Guide: Hugging Face Spaces & Local Hosting | |
| ## Hugging Face Spaces Deployment (Gradio Backend) | |
| Deploying the Object Intelligence Platform to Hugging Face Spaces is straightforward using Gradio and Python. | |
| ### Steps to Deploy on HF Spaces: | |
| 1. **Create Space**: Go to [Hugging Face Spaces](https://huggingface.co/new-space) and create a new Space. Select **Gradio** as the Space SDK. | |
| 2. **Repository Upload**: Push all repository files (`app.py`, `requirements.txt`, `backend/`, `object_intelligence/`, `docs/`, `examples/`). | |
| 3. **Automatic Dependency Resolution**: HF Spaces reads `requirements.txt` and automatically installs `ultralytics`, `torch`, `torchvision`, `gradio`, `fastapi`, and dependencies. | |
| 4. **ZeroGPU / GPU Acceleration**: If using Hugging Face ZeroGPU or T4 GPU Space, PyTorch and Ultralytics automatically leverage CUDA acceleration. On standard CPU Spaces, PyTorch automatically runs CPU inference. | |
| --- | |
| ## Local Deployment | |
| ```bash | |
| # Install dependencies | |
| pip install -r requirements.txt | |
| # Run app | |
| python app.py | |
| ``` | |
| The application will launch a Gradio interface at `http://0.0.0.0:7860`. | |