tryolabs / luminoth

Deep Learning toolkit for Computer Vision.
https://tryolabs.com
BSD 3-Clause "New" or "Revised" License
2.4k stars 399 forks source link

Improvements for the CSV reader #216

Closed nagitsu closed 6 years ago

nagitsu commented 6 years ago

Fixes issues and adds better documentation.

CSVReader now accepts the following directory structure only:

.                  
├── train          
│   ├── image_1.jpg
│   ├── image_2.jpg
│   └── image_3.jpg
├── val            
│   ├── image_4.jpg
│   ├── image_5.jpg
│   └── image_6.jpg
├── train.csv      
└── val.csv

That is, a file named {split}.csv with the annotations and a directory named {split}/ with the images.

The annotation file expects the following format:

image_id,xmin,ymin,xmax,ymax,label
image_1.jpg,26,594,86,617,cat     
image_1.jpg,599,528,612,541,car   
image_2.jpg,393,477,430,552,dog   

The CSV header may be skipped by overriding the headers reader option (with lumi dataset transform -o header=False), in which case the columns option will be used (specified as comma-separated list of fields). If this is done, the above six columns be present. Extra columns will be ignored.