Instructions to use camstack/camstack-trainer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use camstack/camstack-trainer 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("camstack/camstack-trainer", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
File size: 1,024 Bytes
ebeed67 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | """The trainer's one failure type and its exit codes."""
from __future__ import annotations
#: Process exit codes the hub reads.
EXIT_OK = 0
EXIT_BAD_SPEC = 64
EXIT_DATASET = 65
EXIT_INTERNAL = 70
class TrainerError(Exception):
"""A failure with a stage, a stable code and an exit code.
``message`` is shown to the operator: it never names a frame path or a
camera, only counts and codes.
"""
def __init__(self, stage: str, code: str, message: str, exit_code: int) -> None:
super().__init__(message)
self.stage = stage
self.code = code
self.message = message
self.exit_code = exit_code
def as_dict(self) -> dict[str, str]:
return {"stage": self.stage, "code": self.code, "message": self.message}
def spec_error(code: str, message: str) -> TrainerError:
return TrainerError("prepare", code, message, EXIT_BAD_SPEC)
def dataset_error(code: str, message: str) -> TrainerError:
return TrainerError("prepare", code, message, EXIT_DATASET)
|