Metadata-Version: 2.4
Name: labeltify
Version: 0.3.0
Summary: Upload frames and optional annotations into LabelTify with a pipeline token.
Author: CleverTify
Project-URL: Homepage, https://labeltify.com
Project-URL: Source, https://github.com/CleverTify/LabelTify/tree/main/clients/python
Keywords: labeltify,annotation,computer-vision,deepstream,active-learning,dataset
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"

# labeltify

Upload frames, and optionally their annotations, into [LabelTify](https://labeltify.com) from DeepStream, OpenCV, Ultralytics, or any Python pipeline. The only thing it needs is a pipeline token.

```sh
pip install labeltify
```

1. On the dataset **Upload** page, create a pipeline token.
2. Upload:

```python
from labeltify import LabelTifyClient

client = LabelTifyClient("labeltify_…")  # or set LABELTIFY_TOKEN and call LabelTifyClient()

img = client.upload_image(
    "DATASET_ID",
    jpeg_bytes,
    filename="cam01.jpg",
    camera="cam-01",
    pipeline="ds-prod",
    trigger="low_confidence",
)
client.upload_file("DATASET_ID", "frames/cam02.jpg", camera="cam-02")
```

The token knows its org, so you don't pass one. Timeouts, `429`, and `5xx` responses are retried with exponential backoff (`max_retries=4` by default). Anything else raises `LabelTifyError` with the API's message and `.status`.

Annotations are optional. When you pass `labels` (COCO, LabelTify, or YOLO JSON bytes), `work_state` is required: `done`, `in_progress`, `unsure`, or `untouched`. There is no default; the client raises `LabelTifyError` before sending if it is missing. Images with no labels stay untouched.

Send model proposals to the Loop review queue:

```python
client.propose(
    "DATASET_ID",
    img["id"],
    [{"type": "bbox", "id": "p1", "classId": "car", "box": {"x": 0.1, "y": 0.1, "w": 0.2, "h": 0.2}, "source": "model", "confidence": 0.4}],
    model_ref="deepstream@1",
    uncertainty=0.8,
)
```

Boxes are normalized `[0,1]`. Camera, pipeline, and trigger are stored on the image so Loop can filter by them.

Local API: `LabelTifyClient("labeltify_…", base_url="http://localhost:8787")`.

## Develop

```sh
pip install -e "clients/python[test]"
pytest clients/python/tests
```

Bump `version` in `pyproject.toml` to publish. Each new version that lands on `main` is published to PyPI by `.github/workflows/publish-python.yml`.
