> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/sdks/prelabels-review-and-export.md).

# Pre-labels, review, and export

Replace model pre-labels with each new model version, send them through review and export only approved items.

A common loop for robotics teams: a detector proposes labels, people correct them, and only reviewed items are exported for the next training run.

| Step                  | Call                                                                       |
| --------------------- | -------------------------------------------------------------------------- |
| 1. Upload frames      | `project.upload("./cell-04")`, then `batch.wait()`                         |
| 2. Import predictions | `project.annotation_imports.create(path, source_name="detector")`          |
| 3. Check and save     | Read `preview["counts"]` and `preview["issues"]`, then `commit()`          |
| 4. Review             | Annotators correct and submit; reviewers approve in the Workbench          |
| 5. Export             | `client.releases.create(project, export_type="COCO", completed_only=True)` |

The full runnable script is [Upload, label and export](https://docs.unitlab.ai/api-sdk-cli/get-started/upload-label-and-export.md).

## Import a new model version

Use the same `source_name` for every run of one model:

```python
imported = project.annotation_imports.create("./detector-v4.json", source_name="detector")
print(imported.preview["counts"])
imported.commit()
```

Labels people already changed are kept. Objects people deleted are not brought back. Pass `decisions=` to accept specific incoming changes.

## Gate by an automated check

```python
review = project.workflow.get_stage(stage_type="review")
for task in review.get_tasks():
    if passes_qa(task):
        task.claim()
        task.approve()
    else:
        task.claim()
        task.reject(reason="Box misses the gripper", comment="Check frames 40 to 55")
```

## Export only reviewed work

`completed_only=True` includes only items in a Complete stage. Labels must also pass the ontology's validation: an object missing a required property leaves its item out.

## Related

[Annotation imports](https://docs.unitlab.ai/api-sdk-cli/sdks/annotation-imports.md) · [Workflow stages and tasks](https://docs.unitlab.ai/api-sdk-cli/sdks/workflow-stages-and-tasks.md) · [Create and download releases](https://docs.unitlab.ai/api-sdk-cli/sdks/create-and-download-releases.md)
