Generate TFRecord file with TensorFlow.
This is a collection of handy Python scripts related with TensorFlow TFRecord file generation.
split_data.ipynb
: A notebook shows how to split the full dataset into train, validation and test subsets.generate_tfrecord.py
: Generate a TFRecord file.view_record.py
: View the contents of a TFRecord file.TensorFlow
pip3 install tensorflow
view_record.py
to preview images).Git clone this repo then you are good to go.
git clone https://github.com/yinguobing/tfrecord_utility.git
Assuming you have IBUG data organized in the following manner:
/data/landmark/image
Extracted face images./data/landmark/mark
Extracted facial landmarks in JSON files.and you have list all the samples' name in a csv file:
/data/landmark/ibug.csv
and you want to put the generated TFRecord file here:
/data/landmark/ibug.record
Finally run the script like this:
python3 generate_tfrecord.py \
--csv /data/landmark/ibug.csv \
--image_dir /data/landmark/image/ \
--mark_dir /data/landmark/mark/ \
--output_file /data/landmark/ibug.record
The generated file ibug.record
should be found.
This project is licensed under the MIT License - see the LICENSE.md file for details