tryolabs / luminoth

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

Convert and use JPG / PNG files #138

Closed ViktorWb closed 6 years ago

ViktorWb commented 6 years ago

I have a number of folders containing JPG and PNG images, how can I import these files and use them with luminoth? We have tried to convert these to a tfrecords format but with our current implementation we get a lot of errors during training. Do you have any sample code for how to do this properly?

IanTayler commented 6 years ago

Hi, @Fearify !

Currently our implementation of object detection datasets assume images saved to tfrecors to be encoded in JPEG in this line. That's easily fixable, so I'll get onto it.

The abstract class used for defining object detection readers is defined at object_detection_reader.py. If you want to see a few examples, check out the implementations over at luminoth/tools/dataset/readers/object_detection, of which flat_reader.py and csv_reader.py are probably the simplest.

Some of the readers assume your images have a specific extension (e.g. the pascalvoc reader assumes your images have a .jpg extension). On the other hand, flat_reader.py shows how to make your reader extension-agnostic.

If you have any other questions, don't hesitate to ask!

IanTayler commented 6 years ago

Hi, @Fearify ! We now support PNGs, so I'm closing this issue. If your problem still hasn't been fixed with the latest code at master, then feel free to re-open it with an explanation of what issues you are encountering.