Spaces:
Sleeping
Sleeping
Download tiny_trigger/models.py from build-small-hackathon/tiny-trigger: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/build-small-hackathon/tiny-trigger/resolve/498b1c6598afd1f1fbdbf455287c016ad656d8ab/tiny_trigger/models.py
- Command line
-
hf download hf://spaces/build-small-hackathon/tiny-trigger@498b1c6598afd1f1fbdbf455287c016ad656d8ab/tiny_trigger/models.py
-
curl -L -o models.py https://huggingface.co/spaces/build-small-hackathon/tiny-trigger/resolve/498b1c6598afd1f1fbdbf455287c016ad656d8ab/tiny_trigger/models.py
1.07 kB
| from __future__ import annotations | |
| from typing import Any, Literal | |
| from pydantic import BaseModel, Field | |
| class Detection(BaseModel): | |
| frame_index: int = Field(ge=0) | |
| timestamp_sec: float = Field(ge=0.0) | |
| label: str | |
| confidence: float = Field(ge=0.0, le=1.0) | |
| bbox_xyxy: tuple[float, float, float, float] | |
| bbox_xyxy_norm: tuple[float, float, float, float] | |
| class FrameSample(BaseModel): | |
| frame_index: int = Field(ge=0) | |
| timestamp_sec: float = Field(ge=0.0) | |
| class VideoProcessResult(BaseModel): | |
| output_video_path: str | |
| classes: list[str] | |
| detections: list[Detection] | |
| frames: list[FrameSample] = Field(default_factory=list) | |
| processed_frames: int | |
| source_fps: float | |
| output_fps: float | |
| class ActionEvent(BaseModel): | |
| rule: str | |
| action: str | |
| type: Literal["simulate", "webhook"] | |
| frame_index: int | |
| timestamp_sec: float | |
| status: str = "pending" | |
| url: str | None = None | |
| payload: dict[str, Any] = Field(default_factory=dict) | |
| response_status: int | None = None | |
| error: str | None = None | |