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/orchestrator.py from thegoatcc/classpulse-edge: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/core/orchestrator.py
- Command line
-
hf download hf://thegoatcc/classpulse-edge/core/orchestrator.py
-
curl -L -o orchestrator.py https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/core/orchestrator.py
1.29 kB
| from __future__ import annotations | |
| import logging | |
| from core.base_module import PipelineModule | |
| from core.config_manager import ConfigManager | |
| from core.state import FrameContext | |
| logger = logging.getLogger("classpulse.orchestrator") | |
| class PipelineOrchestrator: | |
| """Executes registered Lego modules sequentially over a shared FrameContext.""" | |
| def __init__(self, config: ConfigManager, modules: list[PipelineModule]) -> None: | |
| self.config = config | |
| self.modules = modules | |
| def startup(self) -> None: | |
| for mod in self.modules: | |
| logger.info("Initializing module: %s (branch=%s)", mod.name, mod.branch or "core") | |
| mod.initialize() | |
| def process_frame(self, context: FrameContext) -> FrameContext: | |
| for mod in self.modules: | |
| try: | |
| context = mod.execute(context) | |
| except Exception as exc: | |
| logger.exception("Module '%s' failed on frame %d: %s", mod.name, context.frame_index, exc) | |
| return context | |
| def shutdown(self) -> None: | |
| for mod in reversed(self.modules): | |
| try: | |
| mod.shutdown() | |
| except Exception as exc: | |
| logger.warning("Error shutting down module '%s': %s", mod.name, exc) |