Here you will find the source code to install the LabelMe annotation tool on your server. LabelMe is an annotation tool writen in Javascript for online image labeling. The advantage with respect to traditional image annotation tools is that you can access the tool from anywhere and people can help you to annotate your images without having to install or copy a large dataset onto their computers.
B. C. Russell, A. Torralba, K. P. Murphy, W. T. Freeman. LabelMe: a Database and Web-based Tool for Image Annotation. International Journal of Computer Vision, 77(1-3):157-173, 2008. Project page
You can download a zip file of the source code directly.
Alternatively, you can clone it from GitHub as follows:
$ git clone https://github.com/CSAILVision/LabelMeAnnotationTool.git
Put LabelMe annotation tool code on web server (see web server configuration requirements below).
On the command line run:
$ make
This will set a global variable that the perl scripts need. Note If you move the location of the code, then you need to re-run "make" to refresh the global variable.
Create a subfolder inside the "Images" folder and place your images there. For example: "Images/example_folder/img1.jpg". Make sure all of your images have a ".jpg" extension and the folders/filenames have alphanumeric characters (i.e. no spaces or funny characters).
Point your web browser to the following URL:
Label your image. Press "show me another image" to go to the next image in the folder.
Voila! Your annotations will appear inside of the "Annotations" folder.
You will need the following to set up the LabelMe tool on your web server:
Run an Apache server (see special configuration instructions for Ubuntu or Windows).
Enable authconfig in Apache so that server side includes (SSI) will work. This will allow SVG drawing capabilities. This is the most common source of errors, so make sure this step is working.
Allow perl/CGI scripts to run. This is the second most common source of errors.
Make sure the php5 and libapache2-mod-php5 libraries are installed. You can install them on Linux by running the following:
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-xml php5.6-zip libapache2-mod-php5.6
(Optional) See special configuration instructions if you are installing on Ubuntu or Windows.
If you are not able to draw polygons, check to see if the page is loaded as an "application/xhtml+xml" page (you can see this in Firefox by navigating to Tools->Page Info). If it is not, be sure that SSI are enabled (see above for enabling authconfig in Apache).
Make sure that your images have read permissions on your web server and folders in the "Annotations" folder have write permissions. Also, "annotationCache/TmpAnnotations" needs to have write permissions.
The following are URL variables you can pass to the annotation tool:
The following are for Mechanical Turk mode:
You can create a collection of images to label by running the following on the command line:
$ cd ./annotationTools/sh/
$ ./populate_dirlist.sh
This will create a list of all images inside the "./Images" folder, and will appear inside the file "./annotationCache/DirLists/labelme.txt".
You can then label images inside the collection using the following URL:
http://www.yourserver.edu/path/to/LabelMe/tool.html?collection=labelme&mode=i
You can create a collection consisting of a particular folder by running the following from the command line:
$ cd ./annotationTools/sh/
$ ./populate_dirlist.sh my_collection.txt example_folder
The list will appear inside "./annotationCache/DirLists/my_collection.txt". You can then label images inside the collection using the following URL:
http://www.yourserver.edu/path/to/LabelMe/tool.html?collection=my_collection&mode=i
You can change the layout of the annotation files for your collection by modifying the XML file template inside of "./annotationCache/XMLTemplates/your_collection.xml". The default template is "./annotationCache/XMLTemplates/labelme.xml".
A log file of the annotation tool actions are recorded in "./annotationCache/Logs/logfile.txt". Make sure that this file has write permissions.
The following is a brief overview of the source code. Please see the Javascript code API for more details.
tool.html - This is the entry point for the annotation tool. The main functionality is to insert all of the javascript code and lay down the drawing canvases.
annotationTools/js/ - This folder contains all of the javascript code for the annotation tool functionalities. We provide the code API for the Javascript source code, which has been automatically extracted from the source code comments.
annotationTools/perl/ - This folder contains all of the Perl scripts used for communication with the server back-end.
annotationTools/css/ - This folder contains all of the CSS style definitions.
annotationTools/html/ - This folder contains auxillary HTML files (e.g. for Mechanical Turk instructions, etc.).
(c) 2015, MIT Computer Science and Artificial Intelligence Laboratory