caffe

Prepare Data for Training

Prepare image dataset for image classification task

Caffe has a build-in input layer tailored for image classification tasks (i.e., single integer label per input image). This input "Data" layer is built upon an [tag:lmdb] or [tag:leveldb] data structure. In order to use "Data" layer one has to construct the data structure with all training data.

A quick guide to Caffe's `convert_imageset`

Build

First thing you must do is build caffe and caffe's tools (`convert_imageset` is one of these tools). After installing caffe and `make`ing it make sure you ran `make tools` as well. Verify that a binary file `convert_imageset` is created in `$CAFFE_ROOT/build/tools`.

Prepare your data

*Images:* put all images in a folder (I'll call it here `/path/to/jpegs/`). *Labels:* create a text file (e.g., `/path/to/labels/train.txt`) with a line per input image

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow