Home

Awesome

Fast Image Data Annotation Tool (FIAT)

FIAT enables image data annotation, data augmentation, data extraction, and result visualisation/validation.

The philosophy of this tool is

Requires OPENCV 3 and Google Protobuf.

Build on Ubuntu 18.04

sudo apt-get install caffe-cpu caffe-doc caffe-tools-cpu libcaffe-cpu-dev libcaffe-cpu1 python3-caffe-cpu
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libprotobuf-dev libprotoc-dev protobuf-compiler
sudo apt-get install libprotobuf-dev libprotoc-dev protobuf-compiler
sudo apt-get install libopencv-contrib-dev libopencv-dev libopencv-photo-dev libopencv-shape-dev
sudo apt-get install libopencv-contrib-dev libopencv-dev libopencv-photo-dev libopencv-shape-dev
sudo apt-get install liblmdb-dev
make all

File format

Rectangle extraction tools create annotations CSV files in the RotatedRect file format. This blog post will give you the reasons motivating this choice.

Annotation tool

./bin/annotateRect [FLAGS] input_dir output_file.csv

A tool used to annotate rectangles or to show the results (rectangles with --init option).

data annotation

Meaning of the colors :

Add a rectangle or modify the rectangle with the following keys :

For platforms for which pressing FN with arrow key does not change key value, press Space bar to change into "Rotation/Scale" mode and use arrow keys.

Annotate the class with :

FLAGS :

NOTES :

EXAMPLE :

Annotate images in the current directory :

./bin/annotateRect . out.csv -ratio 1.35

A first image will appear :

To annotate fast, just select the diagonal, by clicking first the top left corner of the object, then the bottom right corner, as shown here with the red arrows :

Image is now selected and appear in blue:

Press the key corresponding to its class, for example 'a'. Now it appears in yellow.

Select the second book.

And press the key corresponding to its class, for example 'e'.

The output annotation file in CSV format out.csv will look like :

./pic.jpg,a,709,816,826,1116,-14.6958
./pic.jpg,e,1510,607,741,1001,6.32224

At any time, you can view how the annotations are, and potentially add new annotations with the same command :

./bin/annotateRect . out.csv -ratio 1.35

The --export option is also very useful : it allows to export the images with the rectangles, without having the burden of the annotation interface and to facilitate results sharing for instance.

Extraction tool

Use annotation information to extract a version of the images :

./bin/extractRect [FLAGS] annotations.csv output_dir

Moreove, the tool will create an output CSV file listing the new rectangle coordinates in the format path,label,center_x,center_y,width,height,rotation,noise_x,noise_y,noise_rotation,noise_scale.

Extraction extracts at best quality possible.

Image will be rotated so that annotation window will be parallel to the image borders.

For example in the previous example,

./bin/extractRect out.csv out

will create an output directory out with two subdirectories corresponding to each label, out/a and out/b and its corresponding extracted objects, and a CSV file out/results.csv with image path, labels and new rectangle coordinates after the extraction.

Extract with a noise in rotation with ./bin/extractRect out3.csv out8 --noise_rotation=30

Several options such as noise in translation, scale, or pepper/gaussian noise are available.

The --full_image option makes transformation available without extracting the rectangle.

See below for more options.

INPUT SELECTION FLAGS :

EDIT RECTANGLES

NOISE FLAGS

OUTPUT FLAGS

NEGATIVE GENERATION

License conditions

Copyright (c) 2016 Christopher5106

This tool has been developped for a work at Axa, and is a contribution to OpenSource by Axa.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.