beaconverter is a tool to switch between several CNN data types.
At the moment, it includes:
- YOLO (You Only Look Once)
- PascalVOC (Pascal Visual Object Classes)
- COCO (COmmun Object in Context)
- TFRecord (TensorFlow Record)
pip install pillow
pip install numpy
pip install tensorflow
pip install object_detection
- Open example.py
- Depending on your current datatype, uncomment the necessary reader
- Adjust its inputs with directories
- Depending on datatype you want, uncomment the necessary writer
- Adjust its inputs with outputs directories
For example if you have YOLO datas and you want to convert to PascalVOC datas:
reader = YoloReader()
mediator = reader.translate2mediator(dataDir= './data/yolo_data/source', namesFname='./data/yolo_data/classes.names')
writer = PascalVocWriter()
writer.write(mediator=mediator, outputAnnotDir='./data/yolo_data/pascalvoc_annot/')
If you want to convert a dataset from COCO to TFRecord, it's strongly recommended to set enableDownload to True (in TfrecordsWriter.write). COCO dataset is the only datas type that does not include raw images or filepaths in its structure. Therefore we have to download images from coco/flickr URL, specified in COCO annotations, to build TFRecords file.
- Handle sub-bboxs for PascalVOC reading and for all writing
