File size: 1,126 Bytes
4346a4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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`.