Sign in Get started

Exports

Build and download a dataset export in 12 formats, including COCO, YOLO, YOLO-OBB, Pascal VOC, CVAT and Pictograph JSON: the frozen snapshot training reads.

View as Markdown
On this page

An export is a ZIP of a dataset’s annotations in one format, optionally with its images.

Formats

format Description
pictograph (default) Pictograph JSON, the format the SDK reads
darwin V7 Darwin JSON 2.0, one file per image; imports into V7 as is
coco COCO detection and instance segmentation; polygon holes as RLE
yolo YOLO (darknet) .txt, one file per image
yolo_obb Ultralytics YOLO-OBB oriented boxes: class x1 y1 x2 y2 x3 y3 x4 y4, normalized
yolo_pose Ultralytics YOLO-Pose: a box plus x y v per joint, joints grouped by instance_id
dota DOTA oriented boxes (labelTxt/): four corners in pixels plus the class name
cvat CVAT XML; rotated boxes as <box rotation="...">
pascal_voc Pascal VOC XML, one file per image
datumaro Datumaro JSON, CVAT’s native dataset format
labelme LabelMe JSON, one file per image
csv Flat CSV, boxes only
  • Rotated boxes - yolo_obb, dota and cvat keep the angle exactly; other formats get the four corners as a polygon. yolo_obb exports every annotation type: a box at angle 0, a polygon as its minimum-area rotated rectangle.
  • Keypoints - a box format (coco, yolo, yolo_obb, yolo_pose, pascal_voc, dota) gets the box around each object’s points, each side at least 5% of the image’s shorter side, so a single landmark still has a learnable box. darwin, csv, labelme and datumaro keep the points’ exact extent.

create

Build an export.

Source: Exports.create

Arg Type Default Notes
dataset str required Dataset name or id
name str required Unique within the dataset, up to 100 characters
format ExportFormat "pictograph" One of the formats
include_images bool False Also include the original images
class_filter list[str] | None None Only these classes’ annotations; an image left with none is still exported
status_filter str | None None Only images in this stage: new, annotate, review or complete
organize_by_split bool False Group files into train/, valid/ and test/ (split layout)
wait bool True Wait until the export finishes
poll_interval float 2.0 Seconds between checks
timeout float 300.0 Max seconds to wait
export = client.exports.create(
    dataset="my-dataset",
    name="for-yolov8",
    format="yolo",
    include_images=True,
    class_filter=["car", "truck"],
    status_filter="complete",
    timeout=600.0,
)
print(export.id, export.status, export.image_count, export.annotation_count)
pictograph exports create my-dataset \
  --name for-yolov8 \
  --format yolo \
  --include-images \
  --class-filter car,truck \
  --status-filter complete \
  --timeout 600
curl -s -X POST "https://api.pictograph.io/api/v1/developer/exports/" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dataset": "my-dataset", "name": "for-yolov8", "format": "yolo",
       "include_images": true, "class_filter": ["car", "truck"],
       "status_filter": "complete"}'

Returns Export

Export · 17 fields
class Export(BaseModel):
    """A dataset export - produced asynchronously, downloaded as a ZIP."""
    id: str
    dataset_id: str
    dataset_name: str
    name: str
    format: Literal['pictograph', 'darwin', 'coco', 'yolo', 'yolo_obb', 'yolo_pose', 'dota', 'pascal_voc', 'cvat', 'datumaro', 'labelme', 'csv']
    include_images: bool = False
    # Only these classes' annotations; None for all.
    class_filter: list[str] | None = None
    # Only images at this stage; None for all.
    status_filter: str | None = None
    status: Literal['pending', 'processing', 'completed', 'failed']
    # Why it failed.
    error_message: str | None = None
    # ZIP size in bytes.
    file_size: int | None = None
    image_count: int | None = None
    annotation_count: int | None = None
    created_at: datetime
    # After this, the ZIP may be deleted.
    expires_at: datetime | None = None
    # Signed download URL; on get and list, not on create.
    download_url: str | None = None
    organization_id: str | None = None

With wait=False, and always over REST, the export comes back pending; follow it with wait_for_completion or get.

list

One page of your organization’s exports.

Source: Exports.list

Arg Type Default Notes
dataset str | None None Only this dataset’s exports
status str | None None Only exports in this state: pending, processing, completed or failed
limit int 100 Page size
offset int 0 Items to skip
for e in client.exports.list(limit=20):
    print(e.dataset_name, e.name, e.status)
pictograph exports list --dataset my-dataset --status completed -n 20
curl -s "https://api.pictograph.io/api/v1/developer/exports/?dataset=my-dataset&status=completed&limit=20" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns list[Export]

Export · 17 fields
class Export(BaseModel):
    """A dataset export - produced asynchronously, downloaded as a ZIP."""
    id: str
    dataset_id: str
    dataset_name: str
    name: str
    format: Literal['pictograph', 'darwin', 'coco', 'yolo', 'yolo_obb', 'yolo_pose', 'dota', 'pascal_voc', 'cvat', 'datumaro', 'labelme', 'csv']
    include_images: bool = False
    # Only these classes' annotations; None for all.
    class_filter: list[str] | None = None
    # Only images at this stage; None for all.
    status_filter: str | None = None
    status: Literal['pending', 'processing', 'completed', 'failed']
    # Why it failed.
    error_message: str | None = None
    # ZIP size in bytes.
    file_size: int | None = None
    image_count: int | None = None
    annotation_count: int | None = None
    created_at: datetime
    # After this, the ZIP may be deleted.
    expires_at: datetime | None = None
    # Signed download URL; on get and list, not on create.
    download_url: str | None = None
    organization_id: str | None = None

iter

Every export, fetched page by page.

Source: Exports.iter

Arg Type Default Notes
dataset str | None None Only this dataset’s exports
status str | None None Only exports in this state: pending, processing, completed or failed
page_size int 100 Items fetched per request
max_total int | None None Stop after this many items
for e in client.exports.iter(page_size=50):
    print(e.dataset_name, e.name, e.status)
pictograph exports list --limit 1000
curl -s "https://api.pictograph.io/api/v1/developer/exports/?limit=100&offset=100" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns OffsetPager[Export]

Export · 17 fields
class Export(BaseModel):
    """A dataset export - produced asynchronously, downloaded as a ZIP."""
    id: str
    dataset_id: str
    dataset_name: str
    name: str
    format: Literal['pictograph', 'darwin', 'coco', 'yolo', 'yolo_obb', 'yolo_pose', 'dota', 'pascal_voc', 'cvat', 'datumaro', 'labelme', 'csv']
    include_images: bool = False
    # Only these classes' annotations; None for all.
    class_filter: list[str] | None = None
    # Only images at this stage; None for all.
    status_filter: str | None = None
    status: Literal['pending', 'processing', 'completed', 'failed']
    # Why it failed.
    error_message: str | None = None
    # ZIP size in bytes.
    file_size: int | None = None
    image_count: int | None = None
    annotation_count: int | None = None
    created_at: datetime
    # After this, the ZIP may be deleted.
    expires_at: datetime | None = None
    # Signed download URL; on get and list, not on create.
    download_url: str | None = None
    organization_id: str | None = None

get

One export, by dataset and name or id.

Source: Exports.get

Arg Type Default Notes
dataset str required Dataset name or id
export str required Export name or id
export = client.exports.get(
    dataset="my-dataset",
    export="for-yolov8",
)
print(export.status, export.image_count)
pictograph exports get my-dataset for-yolov8
curl -s "https://api.pictograph.io/api/v1/developer/exports/for-yolov8?dataset=my-dataset" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns Export

Export · 17 fields
class Export(BaseModel):
    """A dataset export - produced asynchronously, downloaded as a ZIP."""
    id: str
    dataset_id: str
    dataset_name: str
    name: str
    format: Literal['pictograph', 'darwin', 'coco', 'yolo', 'yolo_obb', 'yolo_pose', 'dota', 'pascal_voc', 'cvat', 'datumaro', 'labelme', 'csv']
    include_images: bool = False
    # Only these classes' annotations; None for all.
    class_filter: list[str] | None = None
    # Only images at this stage; None for all.
    status_filter: str | None = None
    status: Literal['pending', 'processing', 'completed', 'failed']
    # Why it failed.
    error_message: str | None = None
    # ZIP size in bytes.
    file_size: int | None = None
    image_count: int | None = None
    annotation_count: int | None = None
    created_at: datetime
    # After this, the ZIP may be deleted.
    expires_at: datetime | None = None
    # Signed download URL; on get and list, not on create.
    download_url: str | None = None
    organization_id: str | None = None

download

Download an export’s ZIP to a local file. A failed download never leaves a partial file at output_path.

Source: Exports.download

Arg Type Default Notes
dataset str required Dataset name or id
export str required Export name or id
output_path str | Path required Where to write it; missing folders are created
chunk_size int 8388608 Bytes per download chunk
progress Callable[[int, int], None] | None None Called with (bytes_so_far, total_bytes); total_bytes is 0 when the size is unknown
from pathlib import Path

client.exports.download(
    dataset="my-dataset",
    export="for-yolov8",
    output_path=Path("./my-dataset.zip"),
)
pictograph exports download my-dataset for-yolov8 -o ./my-dataset.zip
# The endpoint returns a signed download_url valid for 60 minutes, generated
# fresh on every call; fetch the ZIP from it.
curl -s "https://api.pictograph.io/api/v1/developer/exports/for-yolov8/download?dataset=my-dataset" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns Path

wait_for_completion

Wait for an export created with wait=False to be completed or failed.

Source: Exports.wait_for_completion

Arg Type Default Notes
dataset str required Dataset name or id
export str required Export name or id
poll_interval float 2.0 Seconds between checks
timeout float 300.0 Max seconds to wait
export = client.exports.wait_for_completion(
    dataset="my-dataset",
    export="nightly",
    timeout=300.0,
)
# create already waits; --no-wait opts out.
pictograph exports create road-signs --name v1 --format coco
# Poll until status is completed or failed.
curl -s "https://api.pictograph.io/api/v1/developer/exports/v1?dataset=road-signs" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns Export

Export · 17 fields
class Export(BaseModel):
    """A dataset export - produced asynchronously, downloaded as a ZIP."""
    id: str
    dataset_id: str
    dataset_name: str
    name: str
    format: Literal['pictograph', 'darwin', 'coco', 'yolo', 'yolo_obb', 'yolo_pose', 'dota', 'pascal_voc', 'cvat', 'datumaro', 'labelme', 'csv']
    include_images: bool = False
    # Only these classes' annotations; None for all.
    class_filter: list[str] | None = None
    # Only images at this stage; None for all.
    status_filter: str | None = None
    status: Literal['pending', 'processing', 'completed', 'failed']
    # Why it failed.
    error_message: str | None = None
    # ZIP size in bytes.
    file_size: int | None = None
    image_count: int | None = None
    annotation_count: int | None = None
    created_at: datetime
    # After this, the ZIP may be deleted.
    expires_at: datetime | None = None
    # Signed download URL; on get and list, not on create.
    download_url: str | None = None
    organization_id: str | None = None

delete

Delete an export and its ZIP. Needs an admin key. A download in progress fails.

Source: Exports.delete

Arg Type Default Notes
dataset str required Dataset name or id
export str required Export name or id
client.exports.delete(
    dataset="my-dataset",
    export="for-yolov8",
)
pictograph exports delete my-dataset for-yolov8 --yes
curl -s -X DELETE "https://api.pictograph.io/api/v1/developer/exports/for-yolov8?dataset=my-dataset" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY"

Returns None

bulk_delete

Delete up to 10,000 exports by id in one request. Needs an admin key. An id that matches nothing is listed in not_found, so running it again still succeeds.

Source: Exports.bulk_delete

Arg Type Default Notes
exports Sequence[str] required Export ids (from list); duplicates are ignored
res = client.exports.bulk_delete(
    exports=[
        "b4d1c7e2-3f58-4a90-8c6b-1d2e3f4a5b6c",
        "c5e2d8f3-4a69-4b01-9d7c-2e3f4a5b6c7d",
    ],
)
print(res.succeeded, res.not_found, res.count)
pictograph exports bulk-delete \
  b4d1c7e2-3f58-4a90-8c6b-1d2e3f4a5b6c \
  c5e2d8f3-4a69-4b01-9d7c-2e3f4a5b6c7d --yes
curl -s -X POST "https://api.pictograph.io/api/v1/developer/exports/bulk-delete" \
  -H "X-API-Key: $PICTOGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"exports": ["b4d1c7e2-3f58-4a90-8c6b-1d2e3f4a5b6c",
                   "c5e2d8f3-4a69-4b01-9d7c-2e3f4a5b6c7d"]}'

Returns BulkDeleteResult

BulkDeleteResult · 3 fields
class BulkDeleteResult(BaseModel):
    """What a bulk delete removed."""
    # Ids that existed and were deleted.
    succeeded: list[str] = []
    # Ids that were not found.
    not_found: list[str] = []
    # How many were deleted.
    count: int = 0

    # The same as succeeded.
    @property
    def deleted(self) -> list[str]: ...

Train/valid/test split layout

Give each image a split with client.images.set_split, then export with organize_by_split=True: images and their annotations go into train/, valid/ and test/, and an image with no split goes into train/.

export = client.exports.create(
    dataset="my-dataset",
    name="yolo-split",
    format="yolo",
    include_images=True,
    organize_by_split=True,
)
pictograph exports create my-dataset --name yolo-split \
  --format yolo --include-images --organize-by-split

The resulting YOLO ZIP has one root data.yaml pointing at train: train/images, val: valid/images, test: test/images plus a root classes.txt, so it trains with Ultralytics as-is. COCO writes its manifest per split (train/annotations.json, and so on); every per-image format nests its files under the split directory. A dataset with no assigned splits keeps the flat layout.

Common errors

Status Exception Cause
403 ForbiddenError A key below admin (delete, bulk_delete)
404 NotFoundError The dataset or export doesn’t exist
409 ConflictError The dataset already has an export with that name, or a bare export name matches exports in several datasets (pass dataset)
422 ValidationError An unknown format or status_filter
- PollTimeoutError The wait passed timeout; the export keeps building
Copied to clipboard