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
camstack-train 0.1.0: YOLOv9 root detector fine-tune (job.json in, result.json + bundle.tar out)
ebeed67 verified Download tests/test_contract.py from camstack/camstack-trainer: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/camstack/camstack-trainer/resolve/main/tests/test_contract.py
- Command line
-
hf download hf://camstack/camstack-trainer/tests/test_contract.py
-
curl -L -o test_contract.py https://huggingface.co/camstack/camstack-trainer/resolve/main/tests/test_contract.py
1.35 kB
| """result.json validates against the published model; the schemas are current.""" | |
| from __future__ import annotations | |
| import io | |
| import json | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| from camstack_train.events import Emitter | |
| from camstack_train.manifest import failed_result | |
| from camstack_train.result_model import TrainingResult | |
| from camstack_train.run import Deps, run_job | |
| from .fakes import FakeToolchain, detector_factory, fake_fetch, fake_trainer | |
| from .test_run import setup | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_succeeded_result_matches_the_model(tmp_path, make_export, job_dict): | |
| job, paths = setup(tmp_path, make_export, job_dict) | |
| deps = Deps(fetch=fake_fetch, trainer=fake_trainer, toolchain=FakeToolchain(fail=("coreml",)), | |
| detector=detector_factory(), emitter=Emitter(io.StringIO())) | |
| assert run_job(job, paths, deps) == 0 | |
| TrainingResult.model_validate(json.loads((paths.out / "result.json").read_text())) | |
| def test_failed_result_matches_the_model(): | |
| TrainingResult.model_validate(failed_result("k", {"stage": "prepare", "code": "bad-spec", "message": "m"})) | |
| def test_checked_in_schemas_are_current(): | |
| proc = subprocess.run([sys.executable, str(ROOT / "tools" / "gen_schemas.py"), "--check"], capture_output=True, text=True) | |
| assert proc.returncode == 0, proc.stdout | |