All Projects → yeephycho → Tensorflow_input_image_by_tfrecord

yeephycho / Tensorflow_input_image_by_tfrecord

Licence: apache-2.0
Feed your own image data to a pre-trained network by tensorflow

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tensorflow input image by tfrecord

Dezoomify Rs
Zoomable image downloader for Google Arts & Culture, Zoomify, IIIF, and others
Stars: ✭ 150 (-9.64%)
Mutual labels:  image
Jqueryrotate
jQueryRotate - plugin to rotate images by any angle cross-browse with animation support
Stars: ✭ 157 (-5.42%)
Mutual labels:  image
Awesomeimagepicker
Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.
Stars: ✭ 160 (-3.61%)
Mutual labels:  image
Gpuimage X
A Cross-platform (for both Android & iOS) Framework for GPU-based Filters, Video and Image Processing.
Stars: ✭ 154 (-7.23%)
Mutual labels:  image
Imageserver
Image server toolkit in Go
Stars: ✭ 1,944 (+1071.08%)
Mutual labels:  image
Flutter luban
An image compress package like Luban for Dart
Stars: ✭ 154 (-7.23%)
Mutual labels:  image
Github link creator
GitHub Link Card Creator lets you generate GitHub images has links to repositories.
Stars: ✭ 149 (-10.24%)
Mutual labels:  image
Filterous 2
Instagram-like photo manipulation library for Node.js and Javascript on browser
Stars: ✭ 163 (-1.81%)
Mutual labels:  image
Isobmff
C++ Library for ISO/IEC 14496-12 - ISO Base Media File Format (QuickTime, MPEG-4, HEIF, etc)
Stars: ✭ 157 (-5.42%)
Mutual labels:  image
Rxlowpoly
A RxJava based library using native code to convert images to Lowpoly for Android
Stars: ✭ 160 (-3.61%)
Mutual labels:  image
Gocaptcha
A captcha library written in golang
Stars: ✭ 154 (-7.23%)
Mutual labels:  image
Laravel Proximage
🌐 Laravel Proximage is a handy package for proxying images.
Stars: ✭ 156 (-6.02%)
Mutual labels:  image
Image Optimizer
Easily optimize images using PHP
Stars: ✭ 2,127 (+1181.33%)
Mutual labels:  image
Hltool
Go 开发常用工具库, Google2步验证客户端,AES加密解密,RSA加密解密,钉钉机器人,邮件发送,JWT生成解析,Log,BoltDB操作,图片操作,json操作,struct序列化
Stars: ✭ 151 (-9.04%)
Mutual labels:  image
Xlimageviewer
iOS 仿照今日头条的图片浏览工具。
Stars: ✭ 161 (-3.01%)
Mutual labels:  image
Isketchnfill
Software that can autocomplete sketches as the user starts drawing.
Stars: ✭ 151 (-9.04%)
Mutual labels:  image
Image
PHP Image Manipulation
Stars: ✭ 12,298 (+7308.43%)
Mutual labels:  image
Opalimagepicker
A multiple image picker for iOS, written in Swift
Stars: ✭ 165 (-0.6%)
Mutual labels:  image
Wardroom
A tool for creating Kubernetes-ready base operating system images.
Stars: ✭ 163 (-1.81%)
Mutual labels:  image
Draggableimageviewer
大图浏览 & 图片查看&拖拽退出。类似于微信、B站的图片 & 视频浏览器。
Stars: ✭ 153 (-7.83%)
Mutual labels:  image

Tensorflow tfrecord image input demo

This project demonstrates:

  • How to turn your own image/label to tfrecord format.
  • How to read images/labels from the generated tfrecord file.
  • How to feed the images/labels to your own neural network.

Key word: tensorflow, input image, input label, input tfrecord

More details can be found here.

This repo. contains three demo program:

  • First one is a tutorial by using three python scripts to help you to manipulate on your own image dataset.
  • The second one is a pretrained mnist model for digit recognition, you can feed your own image to the network to see the prediction result.
  • The thrid demo is a deep neural network with the tfrecord input script, training and evaluation functions are all added within the script, if you want to feed your own data to train a cnn I believe it's a very good example, the script is under the src folder named flower_train_cnn.py, I trained this network from scratch, I built a very typical network by myself, the input comes from tensorflow imagenet finetuning project, there are five kinds of flower. I use 290 images as test set and the rest of the images are training set, final training accuracy is above 97 percent and the evaluation accuracy is above 83 percent. I will document the project when I have time. If you cannot understand my source code, it may not be a very good time for you to start with tensorflow here, the official tutorial mnist and cifar10 source code are all execllent tutorials.

The scrips take the official documents and tutorials as examples. The difference is that the interface is more friendly. Official tutorial only teach you how to import mnist, cifar10 or imagenet dataset, this project can help you feed your own dataset to your network.

Dependencies

Prefered tensorflow version is 1.0, older version may have some problems.

Dataset

The test image for image input is a subset of food101 dataset.

The CNN dataset is MNIST dataset.

Usage

The procedure of using tensorflow I/O script is as follows: The script serves as a tutorial to automatically turn your own image data set to tfrecord, then read the tfrecord to do the image preprocessing, you can easily modify this program to fit your own project to train your own CNN.

cd ../tensorflow_input_image_by_tfrecord/src
python build_image_data.py
# This operation will search the folders named after the labels in label.txt file, then turn all the files in the labeled folders to .tfrecord file. Check the label.txt file to learn more.
python read_tfrecord_data.py --image_number=300 --class_number=3 --image_height=299 --image_width=299
# The above arguments are default.
# This operation will read the generated .tfrecord file into tensors/images, and write the image to the resized_image folder, the default image size is 299x299. You also can pass arguments: image_number, class_number, image_height, image_width.

To run the MNIST prediction: Modify conv_mnist_inference.py file to change the image path and pre-trained model path according to your own environment.

python conv_mnist_inference.py --image_path $PATH_TO_YOUR_DIGIT_IMAGE 
# e.g. python conv_mnist_inference.py --image_path=../num2.jpg

To train with flower dataset: First you need to download the flower dataset from the script here. After unpack the dataset, split the dataset as training set and test set and generate tfrecords according to my previous description. I believe you need to modify the I/O path and checkpoint settings in the script. Read the source code, it will lead to how to train and evaluate the network. I used the batch size of 5 images and each image in the training set was trained more than 200 times.

Advanced

For those people who tried this example tutorial, I believe that you are all equiped with certain kinds of intuition of deep convolution neural networks.

If you wants to move on, you can refer to my other repositories, I'm quite proud of my other work such as my implementation of densenet and a customized nasnet.

If you want to move to object detection problem which is the most promising area of computer vision and deep learning, you can refer to my repo. widerface-to-tfrecord and a mobilenet based face detector.

I do hope that my effort can be helpful and some day you can also contribute to this open source community, and for those who use my code, a star or a fork will be highly appreciated, thanks in advance!!!!!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].