CoolFace
Apppublic

PlanetEyeFarm12/construction-deforestation-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
README.md51 linesDownload Raw Back to root
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