https://github.com/iamtodor/tensorflow_object_detection_create_coco_tfrecord
Convert coco dataset to tfrecord for the tensorflow detection API.
https://github.com/iamtodor/tensorflow_object_detection_create_coco_tfrecord
coco-dataset cocodataset object-detection tensorflow tfrecord
Last synced: 24 days ago
JSON representation
Convert coco dataset to tfrecord for the tensorflow detection API.
- Host: GitHub
- URL: https://github.com/iamtodor/tensorflow_object_detection_create_coco_tfrecord
- Owner: iamtodor
- Created: 2018-02-26T21:38:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-26T21:38:59.000Z (about 7 years ago)
- Last Synced: 2025-03-30T02:04:34.567Z (about 2 months ago)
- Topics: coco-dataset, cocodataset, object-detection, tensorflow, tfrecord
- Language: Python
- Homepage:
- Size: 358 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tensorflow_object_detection_create_coco_tfrecord
Convert coco dataset to tfrecord for the tensorflow detection API.
# Attention
1) For easy use of this script, Your coco dataset directory struture should like this :
```
+Your coco dataset root
+train2014
+val2014
+annotations
-instances_train2014.json
-instances_val2014.json
```
2) To use this script, you should download python coco tools from [coco website ](http://mscoco.org/dataset/#download) and make it.
After make, copy the pycocotools directory to the directory of this "create_coco_tf_record.py"
or add the pycocotools path to PYTHONPATH of ~/.bashrc file.
**For convientient , I add pycocotools build in my computer to the project directory, you can use it with python3 directly. But if you use python2, build the python coco tool from [!coco](http://mscoco.org/dataset/#download) **
```
git clone https://github.com/cocodataset/cocoapi
cd cocoapi/PythonAPI/
make
pip install Cython
make
ls pycocotools/
cp -rf pycocotools PATH/tensorflow_object_detection_create_coco_tfrecord/
```# Example usage:
```
python create_coco_tf_record.py --data_dir=/path/to/your/coco/root/directory \
--set=train \
--output_filepath=/where/you/want/to/save/pascal.record
--shuffle_imgs=True
```