LabelMe annotation tool source code

Overview

LabelMe annotation tool source code

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.

CITATION:

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

DOWNLOAD:

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

CONTENTS:

  • Images - This is where your images go.
  • Annotations - This is where the annotations are collected.
  • Masks - This is where the segmentation masks are collected (scribble mode).
  • Scribbles - This is where the scribbles are collected (scribble mode).
  • tool.html - Main web page for LabelMe annotation tool.
  • annotationTools - Directory with source code.
  • annotationCache - Location of temporary files.
  • Icons - Icons used on web page.
  • DockerFiles - Directory with Docker files for installation via Docker.

QUICK START INSTRUCTIONS:

  1. Put LabelMe annotation tool code on web server (see web server configuration requirements below).

  2. 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.

  3. 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).

  4. Point your web browser to the following URL:

    http://www.yourserver.edu/path/to/LabelMe/tool.html?collection=LabelMe&mode=f&folder=example_folder&image=img1.jpg

  5. Label your image. Press "show me another image" to go to the next image in the folder.

  6. Voila! Your annotations will appear inside of the "Annotations" folder.

WEB SERVER REQUIREMENTS:

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 apt-get install php5 libapache2-mod-php5
  • (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.

FEATURES OF THE ANNOTATION TOOL:

  • The following are URL variables you can pass to the annotation tool:

    • mode=im - Only show the image and drawing canvas (do not show anything outside of the image.
    • mode=mt - Mechanical Turk mode.
    • mode=f - Pressing "next image" button goes to next image in the folder.
    • mode=i - Pressing "next image" button goes to random image in the default LabelMe collection.
    • mode=c - Go to next image in the collection (set via the dirlist).
    • username=johndoe - Sets username for labeling session.
    • collection=LabelMe - Uses the default LabelMe collection list. See below for setting up a new collection list.
    • folder=MyLabelMeFolder - LabelMe folder where the image lives.
    • image=image.jpg - LabelMe image to annotate.
    • objects=car,person,building - When popup bubble appears asking the user for the object name, the user selects one of these objects appearing as a drop-down list.
    • scribble=false - Turns off scribble mode.
    • objlist=visible - This controls whether the object list on the right side is visible or not. Use "objlist=hidden" to make it hidden.
    • actions=n - Control what actions the user is allowed to do. To set the desired actions, use any combination of the letters below. For example, to allow renaming, modify control points, and delete actions, then set "actions=rmd". By default, "actions=n". The following are possible actions:
      • n - create and edit new polygons
      • r - rename existing objects
      • m - modify control points on existing objects
      • d - delete existing objects
      • a - allow all actions
      • v - view polygons only (do not allow any editing)
    • viewobj=e - Control which objects the user sees. Use one of the following possible options below. By default, "viewobj=e". Note that for deleted objects, these will be shown in gray and the object name in the object list will be italicized.
      • e - view new and previously labeled objects
      • n - view new objects only
      • d - view new and deleted objects
      • a - view all objects (new, existing, deleted)

    The following are for Mechanical Turk mode:

    • mt_sandbox=true - Use Mechanical Turk sandbox mode. This mode is used for debugging on Mechanical Turk. You may want to start with this variable set to make sure everything works.
    • N=5 - The worker is required to label at least 5 polygons. Use N=inf to allow the worker to label as many as they want.
    • mt_intro=http://yourpage.com - You may customize the instructions that the worker sees. By default, the following instructions are given to the workers.
    • mt_instructions=Place your instructions here - You may customize the one-line instructions that the worker sees at the top of the labeling task. By default, the instructions are: Please label as many objects as you want in this image.
  • 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.

CODE API

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

Owner
MIT CSAIL Computer Vision
MIT CSAIL Computer Vision
Generative Art Synthesizer - a python program that generates python programs that generates generative art

GAS - Generative Art Synthesizer Generative Art Synthesizer - a python program that generates python programs that generates generative art. Examples

Alexey Borsky 43 Dec 03, 2022
Multiparametric Image Analysis

Documentation The documentation is available on populse_mia's website here Installation From PyPI, for users By cloning the package, for developers Fr

Populse 9 Dec 14, 2022
New program to export a Blender model to the LBA2 model format.

LBA2 Blender to Model 2 This is a new program to export a Blender model to the LBA2 model format. This is also the first publicly released version of

2 Nov 30, 2022
Create a QR-code Generator app using only Python.

QR-code_Generator Create a QR-code Generator app using only Python. This apps generated a QR code for a single link. Libraryes used in this app -- py

Soham P Phasalkar 1 Oct 17, 2021
A minimal python script for generating bip39 seed phrases, and corresponding Seed Signer Seed seed phrase qr code ready for offline printing.

A minimal python script for generating bip39 seed phrases, and corresponding Seed Signer Seed seed phrase qr code ready for offline printing.

CypherToad 8 Sep 12, 2022
A Python Script to convert Normal PNG Image to Apple iDOT PNG Image.

idot-png-encoder A Python Script to convert Normal PNG Image to Apple iDOT PNG Image (Multi-threaded Decoding PNG). Usage idotpngencoder.py -i inputf

Lrdcq 2 Feb 17, 2022
Py3D - A 3d rendering engine written entirely in python

Py3D is a 3d rendering engine written entirely in python. It is a simple and eas

1up Community 2 Nov 14, 2022
This piece of code is a User Welcomer with Image Manipulation using Python and Pillow (PIL).

This piece of code is a User Welcomer with Image Manipulation using Python and Pillow (PIL).

Bero 4 Jan 11, 2022
Python script to generate vector graphics of an oriented lattice unit cell

unitcell Python script to generate vector graphics of an oriented lattice unit cell Examples unitcell --type hexagonal --eulers 12 23 34 --axes --crys

Philip Eisenlohr 2 Dec 10, 2021
MyPaint is a simple drawing and painting program that works well with Wacom-style graphics tablets.

MyPaint A fast and dead-simple painting app for artists Features Infinite canvas Extremely configurable brushes Distraction-free fullscreen mode Exten

MyPaint 2.3k Jan 01, 2023
Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

1 Jan 16, 2022
将位图转为彩色矢量 svg 图片

一个将位图描摹为彩色矢量 svg 图片的程序,是一个命令行工具,使用 Python 脚本实现,运行环境 Python3.8+。 ✨ 效果 以一个字帖图片为例,这是 png 格式的位图(370KB): 这是颜

Haujet Zhao 104 Dec 30, 2022
Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images

napari-3d-ortho-viewer Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images This napari plugin was generated with Cookiecutter using @nap

niklas netter 5 Nov 28, 2022
missing-pixel-filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled.

Missing Pixel Filler This is the official code repository for the Missing Pixel Filler by SpaceML. missing-pixel-filler is a python package that, give

SpaceML 11 Jul 19, 2022
粉專/IG圖文加工器

粉專/IG圖文加工器 介紹 給PS智障(ex:我)使用,用於產生圖文 腳本省去每次重複步驟 可載入圖片(方形,請先處理過,歡迎PR) 圖片簡易套用濾鏡 可將圖片切片 要求 Python 版本 3.9 安裝 安裝最新 python pip3 install -r requirement.txt 效果

Louis Tang 7 Aug 10, 2022
Convert photos to paintings with python

Convert-photos-to-paintings Before the changes After the changes Before the changes After the changes This code is written in the Python programming l

Amir Hussein Sharifnezhad 3 May 31, 2022
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
Fixed Version Of Blender Low Poly Rock Generator For Blender 3.0.0

Blender (3.0.0) - Low Poly Rock Generator This is an addon for Blender 3.0.0 to generate low poly rocks. It was based on an addon that unfortunately h

3 Mar 24, 2022
A python script for extracting/removing exif data from images by @AbirHasan2005

Image-Exif A Python script for extracting exif metadata from images. How to use? Using this script you can extract exif data from image and save in .c

Abir Hasan 13 Dec 16, 2022
Python library that finds the size / type of an image given its URI by fetching as little as needed

FastImage This is an implementation of the excellent Ruby library FastImage - but for Python. FastImage finds the size or type of an image given its u

Brian Muller 28 Mar 01, 2022