Basic Conversion
Theconvert command translates datasets from one format to another:
Common Conversion Workflows
COCO to YOLO
Convert a COCO JSON file to YOLO directory structure:This creates a YOLO directory with
labels/ subdirectory containing normalized center-format .txt files.YOLO to COCO
Convert a YOLO directory to COCO JSON:Note: YOLO → COCO conversion is lossy because YOLO lacks dataset-level metadata.
Pascal VOC to COCO
Convert Pascal VOC XML annotations to COCO:VOC attributes like
pose, truncated, difficult, and occluded are preserved as annotation attributes in the IR but may be dropped depending on the target format.Lossiness and the --allow-lossy Flag
Not all annotation formats carry the same information. When you convert between formats, some fields may not have an equivalent in the target format - that’s what Panlabel calls lossiness.
Rather than silently dropping data, Panlabel tells you exactly what would be lost and requires you to opt in with --allow-lossy.
Lossiness Categories
Formats are classified by their information preservation relative to the IR:| Format | Lossiness | Notes |
|---|---|---|
ir-json | Lossless | Canonical representation, preserves everything |
coco | Conditional | Lossless for basic detection, may lose custom attributes |
cvat | Lossy | Drops dataset-level metadata |
label-studio | Lossy | Drops dataset metadata; rotations flattened to axis-aligned boxes |
tfod | Lossy | Drops dataset metadata, category supercategories, and images without annotations |
yolo | Lossy | Drops all dataset-level and image-level metadata |
voc | Lossy | Drops dataset-level metadata and some image metadata |
The format-level classification is a general capability signal. Conversions are actually blocked only when the conversion report contains one or more
warning severity issues for your specific dataset.Example: Blocked Conversion
When converting COCO to YOLO without--allow-lossy:
Stable Issue Codes
Every conversion report includes stable issue codes designed for programmatic use:Warning Codes (Block Conversion)
| Code | Meaning |
|---|---|
drop_dataset_info | Dataset-level metadata is dropped |
drop_licenses | License list is dropped |
drop_image_metadata | Image metadata fields (license/date) are dropped |
drop_category_supercategory | Category supercategory is dropped |
drop_annotation_confidence | Annotation confidence values are dropped |
drop_annotation_attributes | Annotation attributes are dropped |
drop_images_without_annotations | Images without annotations will not appear (TFOD behavior) |
label_studio_rotation_dropped | Rotated boxes flattened to axis-aligned envelopes |
Info Codes (Never Block)
Info codes document deterministic policies and never block conversion. Examples:yolo_writer_float_precision- YOLO normalized float precision policyyolo_writer_empty_label_files- Empty label files created for unannotated imagesvoc_reader_coordinate_policy- VOC coordinate handling (no 0/1-based adjustment)tfod_writer_row_order- TFOD writer deterministic row order
Conversion Reports
Every conversion generates a report explaining what happened.Text Report (Default)
JSON Report
For programmatic consumption:Best Practices
Use IR JSON as an Interchange Format
When performing multiple conversions, useir-json as an intermediate step to preserve maximum information:
Validate Before Converting
By default, Panlabel validates input before conversion. Use--strict to treat warnings as errors:
Understand Your Format’s Limitations
Before converting, check what information your target format can preserve:ir-json or coco as your target format.
Inspect Conversion Reports Programmatically
For automation pipelines, parse JSON reports to make decisions:Related Commands
validate- Validate datasets before conversionstats- Analyze dataset statisticsdiff- Compare datasets before and after conversionlist-formats- View all supported formats