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: 854 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 | """The vendored harness imports the vendored inference pool, not a repo path."""
from __future__ import annotations
from pathlib import Path
from camstack_train._vendor import PIPELINE_PYTHON, ensure_pipeline_on_path
def test_harness_resolves_the_vendored_pool():
ensure_pipeline_on_path()
from camstack_train._vendor.camstack_eval.pipeline import _pipeline
pool, postprocessors = _pipeline()
assert Path(pool.__file__).resolve().parent == PIPELINE_PYTHON
assert "yolo" in postprocessors
def test_pool_letterbox_is_grey_114():
ensure_pipeline_on_path()
import inference_pool
from PIL import Image
arr, scale, pad = inference_pool.letterbox(Image.new("RGB", (64, 32), (0, 0, 0)), 64)
assert arr.shape == (64, 64, 3) and pad == (0, 16) and scale == 1.0
assert abs(float(arr[0, 0, 0]) - 114 / 255) < 1e-6
|