Spaces:
Sleeping
Sleeping
| """ | |
| export_coco.py — CLI entrypoint for the COCO JSON export stage. | |
| Usage: | |
| uv run python scripts/export_coco.py | |
| uv run python scripts/export_coco.py --labeled-dir data/labeled --output data/labeled/coco_export.json | |
| """ | |
| from __future__ import annotations | |
| import logging | |
| from pathlib import Path | |
| import click | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| from autolabel.export import run_export | |
| from autolabel.config import settings | |
| from autolabel.utils import setup_logging | |
| def main(labeled_dir: Path, output: Path, verbose: bool) -> None: | |
| """Export accepted annotations from LABELED_DIR to COCO JSON format.""" | |
| setup_logging(logging.DEBUG if verbose else logging.INFO) | |
| run_export(labeled_dir=labeled_dir, output_path=output, cfg=settings) | |
| if __name__ == "__main__": | |
| main() | |