Conversion
The conversion module provides structured reporting for format transformations, tracking what information is preserved, lost, or transformed during conversion.Overview
When converting between formats, not all information can always be preserved. Panlabel analyzes your dataset and target format to report:- Warnings: Information that will be lost (e.g., metadata, attributes)
- Info: Policy decisions (e.g., ID assignment, coordinate precision)
- Counts: Input vs output statistics (e.g., dropped images)
Format Enum
TheFormat enum identifies annotation formats:
Lossiness Classification
Formats are classified by how much IR information they can preserve:| Format | Lossiness | Notes |
|---|---|---|
| IR JSON | Lossless | The IR itself - preserves everything |
| COCO | Conditional | May lose dataset name, some attributes |
| CVAT | Lossy | Drops metadata, licenses, confidence |
| Label Studio | Lossy | Drops metadata, licenses, most attributes |
| TFOD | Lossy | Drops metadata, images without annotations |
| YOLO | Lossy | Drops metadata, confidence, attributes |
| VOC | Lossy | Drops metadata, confidence, some attributes |
Building Conversion Reports
build_conversion_report
Analyze a conversion before executing it:ConversionReport
The report structure contains detailed conversion information:Display for human-readable output:
ConversionCounts
Counts of dataset elements:- Images without annotations are dropped (TFOD)
- Categories not referenced by annotations are dropped (TFOD)
ConversionIssue
Individual conversion issues:Issue Codes
Stable, machine-readable codes for each type of issue:Usage Patterns
Check Before Converting
Analyze Multiple Targets
JSON Export
The report is serializable for programmatic use:Complete Example
Next Steps
- Understand the Intermediate Representation types
- Learn about Format I/O functions
- Use Validation to check dataset quality