Image annotator

Tool for annotating images in Python, using Flask and SimpleCV

Download as .zip Download as .tar.gz View on GitHub

Image Annotator

This is a tool for annotating images in Python, using Flask and SimpleCV and, optionally, scikit-learn in the backend, and jQuery and imgAreaSelect on the frontend.

Flask is used to serve up images in the browser. There the bounding box of the regions of interest can be selected and given a label and sent back to the server to save.

If you have an heuristic that can give you approximate locations of regions of interest, they can be served up from the database to speed up the annotation process. Also, if you already have a (partially) working scikit-learn model to classify images, it can be used to suggest labels for the selection.

Usage

After you've downloaded the tarball/zip from GitHub, you need to set up the config file. There are five settings to configure:

The images you want annotated should be named sequentially, 0.jpg, 1.jpg, and so on and they should be put in the static/img folder.

The sqlite3 database files needs to be created and the tables from schema.sql need to be created using the following command:

sqlite3 schema.sql > path/to/db

If you have an heuristic to generate blobs, you should insert them into the blobs table, with the following details: image_name, x, y, width and height.

Last step is to run flask_annotator.py and then point your browser to 127.0.0.1:5000. You should see your first image, ready to be annotated.

After you have annotated several images, you can go to 127.0.0.1:5000/admin to see a list of your annotations and you can correct them or delete them.