Code Monkey home page Code Monkey logo

tfrecord_utility's Introduction

tfrecord_utility

Generate TFRecord file with TensorFlow.

Getting Started

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.

Prerequisites

TensorFlow

pip3 install tensorflow

Optional

  • numpy
  • pandas
  • OpenCV (only if you need to run view_record.py to preview images).

Installing

Git clone this repo then you are good to go.

git clone https://github.com/yinguobing/tfrecord_utility.git

Running

Generating IBUG TFRecord file.

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.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • The official TensorFlow data tutorial.

tfrecord_utility's People

Contributors

yinguobing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.