Overview
- Path type: CSV file (
.csv) - Lossiness: Lossy (see below)
- Bbox format: Normalized XYXY
[xmin, ymin, xmax, ymax](0..1) - Use case: TensorFlow training, simple CSV-based workflows
CSV Structure
TFOD CSV uses a simple tabular format with 8 columns:Columns
| Column | Type | Description |
|---|---|---|
filename | string | Image filename |
width | integer | Image width in pixels |
height | integer | Image height in pixels |
class | string | Category/class name |
xmin | float | Left edge (normalized 0..1) |
ymin | float | Top edge (normalized 0..1) |
xmax | float | Right edge (normalized 0..1) |
ymax | float | Bottom edge (normalized 0..1) |
Bounding Box Format
TFOD uses normalized XYXY coordinates (0.0 to 1.0):Conversion Example
TFOD CSV row:xmin = 0.1 × 640 = 64.0ymin = 0.2 × 480 = 96.0xmax = 0.5 × 640 = 320.0ymax = 0.8 × 480 = 384.0
[64.0, 96.0, 320.0, 384.0]
Reader Behavior
Reading Process
- Parse CSV file with header row
- Validate consistent dimensions per filename
- Build image map (filename → width, height)
- Build category map (class name → CategoryId)
- Assign deterministic IDs:
- Image IDs: by filename (lexicographic)
- Category IDs: by class name (lexicographic)
- Annotation IDs: by CSV row order
Dimension Validation
Each filename must have consistent dimensions across all rows:Writer Behavior
Writing Process
- Validate all annotation references (images, categories)
- Build lookup maps
- Convert pixel bboxes to normalized coordinates
- Sort rows by annotation ID (deterministic output)
- Write CSV with header
Coordinate Precision
Normalized floats written with full precision:Lossiness
TFOD CSV is very lossy. Only basic annotation data is preserved.Preserved ✓
- Image filenames and dimensions
- Category names
- Bounding box coordinates (normalized ↔ pixel conversion)
Not Preserved ✗
- Dataset-level metadata/licenses
- Image-level license/date metadata
- Annotation confidence/attributes
- Category supercategory
- Custom attributes
- Images without annotations
Limitations
No Images Without Annotations
TFOD CSV cannot represent images without bounding boxes: Input IR:No Metadata
No support for:- Dataset info
- Licenses
- Image dates
- Annotation confidence
- Custom attributes
Row-Based Only
Each row represents one annotation. Cannot store image-level or dataset-level data.Usage
Read TFOD CSV
tfod-csv
Write TFOD CSV
Deterministic Output
Rows are sorted by annotation ID for stable diffs:Example Dataset
Complete TFOD CSV example:- 3 images (img1.jpg, img2.jpg, img3.jpg)
- 3 categories (person, car, dog, cat, bicycle)
- 6 annotations total
See Also
COCO Format
More feature-rich JSON format
Format Overview
Compare all supported formats