rexlow / BBox-Label-Tool

A simple tool for labeling object bounding boxes in images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BBox-Label-Tool

A simple tool for labeling object bounding boxes in images, implemented with Python Tkinter.

Updates:

  • 2018.11.13 Added python3 compatibility by @rexlow
  • 2018.4.29 Added scrolling to enable working with high-res images by @toobaimt
  • 2017.5.21 Check out the multi-class branch for a multi-class version implemented by @jxgu1016

Screenshot: Label Tool

Data Organization

LabelTool
|
|--main.py # source code for the tool
|
|--Images/ # direcotry containing the images to be labeled
|
|--Labels/ # direcotry for the labeling results
|
|--Examples/ # direcotry for the example bboxes

Environment

  • python 3. 6
  • python PIL (Pillow)

Run

$ python3 main.py

Convert image format to jpeg

Install ImageMagick (only for macOS)

$ brew install imagemagick (if you are using macOS)

Convert old format to jpeg

$ for i in *.JPG ; do convert "$i" "${i%.*}.jpeg" ; done

Convert old format to jpeg and downscale image to 50% (Optional)

$ for i in *.JPG ; do convert "$i" -resize 50% "${i%.*}.jpeg" ; done

Usage

  1. The current tool requires that the images to be labeled reside in /Images/001, /Images/002, etc. You will need to modify the code if you want to label images elsewhere.
  2. Input a folder number (e.g, 1, 2, 5...), and click Load. The images in the folder, along with a few example results will be loaded.
  3. To create a new bounding box, left-click to select the first vertex. Moving the mouse to draw a rectangle, and left-click again to select the second vertex.
  • To cancel the bounding box while drawing, just press <Esc>.
  • To delete a existing bounding box, select it from the listbox, and click Delete.
  • To delete all existing bounding boxes in the image, simply click ClearAll.
  1. After finishing one image, click Next to advance. Likewise, click Prev to reverse. Or, input an image id and click Go to navigate to the speficied image.
  • Be sure to click Next after finishing a image, or the result won't be saved.

About

A simple tool for labeling object bounding boxes in images

License:MIT License


Languages

Language:Python 100.0%