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_spec.py from camstack/camstack-trainer: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/camstack/camstack-trainer/resolve/main/tests/test_spec.py
- Command line
-
hf download hf://camstack/camstack-trainer/tests/test_spec.py
-
curl -L -o test_spec.py https://huggingface.co/camstack/camstack-trainer/resolve/main/tests/test_spec.py
1.73 kB
| from __future__ import annotations | |
| import json | |
| import pytest | |
| from camstack_train.errors import EXIT_BAD_SPEC, TrainerError | |
| from camstack_train.spec import load_job, parse_job | |
| def test_valid_job_parses(job_dict): | |
| job = parse_job(job_dict) | |
| assert job.job_key == job_dict["jobKey"] | |
| assert job.int8_gate.max_map50_drop == 0.02 | |
| assert job.baseline.onnx_url.startswith("https://") | |
| def test_unknown_schema_exits_64(job_dict): | |
| job_dict["schema"] = "camstack.training/v2" | |
| with pytest.raises(TrainerError) as err: | |
| parse_job(job_dict) | |
| assert err.value.exit_code == EXIT_BAD_SPEC | |
| assert err.value.code == "unknown-schema" | |
| def test_refusals_are_bad_spec(job_dict, mutate): | |
| mutate(job_dict) | |
| with pytest.raises(TrainerError) as err: | |
| parse_job(job_dict) | |
| assert err.value.exit_code == EXIT_BAD_SPEC | |
| def test_load_job_reports_unreadable_json(tmp_path): | |
| path = tmp_path / "job.json" | |
| path.write_text("{nope") | |
| with pytest.raises(TrainerError) as err: | |
| load_job(path) | |
| assert err.value.exit_code == EXIT_BAD_SPEC | |
| def test_load_job_roundtrip(tmp_path, job_dict): | |
| path = tmp_path / "job.json" | |
| path.write_text(json.dumps(job_dict)) | |
| assert load_job(path).catalog.id == job_dict["catalog"]["id"] | |