CoolFace
Apppublic

PlanetEyeFarm12/construction-deforestation-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

๐Ÿ—๏ธ 4-Model Construction Ensemble Detection API

Runs 4 YOLOv8 models simultaneously on any video:

ColorModelClasses
๐Ÿ”ด RedDeforestationaxe, deforestation, person
๐ŸŸข GreenConstruction Materialsbrick, cement_bag, pipe, rebar
๐Ÿ”ต BluePPE SafetyHardhat, NO-Hardhat, Safety Vest, NO-Safety Vest...
๐ŸŸก YellowConstruction Equipmentexcavator, crane, bulldozer, truck...

API Endpoints

MethodEndpointDescription
GET/Info + model classes
GET/healthHealth check
GET/classesList all classes per model
POST/detect/videoUpload video โ†’ ZIP (annotated.mp4 + annotation.txt)
POST/detect/jsonUpload video โ†’ JSON snapshot log

Quick Usage

python
import requests, zipfile

# Get annotated video + annotation log
with open("site_video.mp4", "rb") as f:
    r = requests.post(
        "https://YOUR-SPACE.hf.space/detect/video?snapshot_every=2",
        files={"file": f},
        timeout=600
    )

with open("results.zip", "wb") as f:
    f.write(r.content)

with zipfile.ZipFile("results.zip") as z:
    z.extractall(".")
# โ†’ annotated.mp4 + annotation.txt