Instructions to use thegoatcc/classpulse-edge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use thegoatcc/classpulse-edge with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("thegoatcc/classpulse-edge", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Download core/base_module.py from thegoatcc/classpulse-edge: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/core/base_module.py
- Command line
-
hf download hf://thegoatcc/classpulse-edge/core/base_module.py
-
curl -L -o base_module.py https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/core/base_module.py
1.68 kB
| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from typing import Optional | |
| from core.config_manager import ConfigManager | |
| from core.state import FrameContext | |
| class BaseModelWrapper(ABC): | |
| """Uniform adapter contract for HailoRT (.hef), ONNX (.onnx), MediaPipe (.task), or PC mocks.""" | |
| def load(self) -> None: | |
| """Load pre-cached offline model weights into NPU/CPU memory.""" | |
| def process(self, context: FrameContext) -> FrameContext: | |
| """Run inference and enrich FrameContext in-place.""" | |
| def close(self) -> None: | |
| """Release hardware/NPU handles cleanly on shutdown.""" | |
| class PipelineModule(ABC): | |
| """Plug-and-play Lego brick governed by ConfigManager Zero-Deletion Toggling.""" | |
| def __init__( | |
| self, | |
| name: str, | |
| config: ConfigManager, | |
| branch: Optional[str] = None, | |
| wrapper: Optional[BaseModelWrapper] = None, | |
| ) -> None: | |
| self.name = name | |
| self.config = config | |
| self.branch = branch | |
| self.wrapper = wrapper | |
| def initialize(self) -> None: | |
| if self.wrapper is not None: | |
| self.wrapper.load() | |
| def execute(self, context: FrameContext) -> FrameContext: | |
| if not self.config.is_active(self.name, self.branch): | |
| return context | |
| return self.run(context) | |
| def run(self, context: FrameContext) -> FrameContext: | |
| """Module-specific business logic operating on FrameContext.""" | |
| def shutdown(self) -> None: | |
| if self.wrapper is not None: | |
| self.wrapper.close() |