PlanetEyeFarm12/construction-deforestation-api
0
1---2title: 4-Model Construction Ensemble API3emoji: ๐๏ธ4colorFrom: green5colorTo: red6sdk: docker7pinned: false8---9 10# ๐๏ธ 4-Model Construction Ensemble Detection API11 12Runs **4 YOLOv8 models simultaneously** on any video:13 14| Color | Model | Classes |15|-------|-------|---------|16| ๐ด Red | Deforestation | axe, deforestation, person |17| ๐ข Green | Construction Materials | brick, cement_bag, pipe, rebar |18| ๐ต Blue | PPE Safety | Hardhat, NO-Hardhat, Safety Vest, NO-Safety Vest... |19| ๐ก Yellow | Construction Equipment | excavator, crane, bulldozer, truck... |20 21## API Endpoints22 23| Method | Endpoint | Description |24|--------|----------|-------------|25| GET | `/` | Info + model classes |26| GET | `/health` | Health check |27| GET | `/classes` | List all classes per model |28| POST | `/detect/video` | Upload video โ ZIP (annotated.mp4 + annotation.txt) |29| POST | `/detect/json` | Upload video โ JSON snapshot log |30 31## Quick Usage32 33```python34import requests, zipfile35 36# Get annotated video + annotation log37with open("site_video.mp4", "rb") as f:38 r = requests.post(39 "https://YOUR-SPACE.hf.space/detect/video?snapshot_every=2",40 files={"file": f},41 timeout=60042 )43 44with open("results.zip", "wb") as f:45 f.write(r.content)46 47with zipfile.ZipFile("results.zip") as z:48 z.extractall(".")49# โ annotated.mp4 + annotation.txt50```51 