Skip to content

OpenLabeler is an open source desktop application for annotating objects for AI appplications

License

Notifications You must be signed in to change notification settings

kinhong/OpenLabeler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenLabeler

GitHub license Downloads

Introduction

OpenLabeler is an open-source application for annotating objects. It can generate the PASCAL VOC format XML annotation file for artificial intelligence and deep learning training. This application's unique aspect is its ability to use inference (with TensorFlow) to improve accuracy and speed up the annotation process.

OpenLabeler is written in OpenJDK/OpenJFX (version 21.x).

Application

A few highlights:

  • Fast labeling (no need for Open/Save File actions) General Preferences
  • Multi-level undo/redo
  • Annotation "hints" (using TensorFlow inference)
  • Pre-built installation packages for macOS (tested on macOS Sonoma), Linux (tested on Ubuntu 20.04 LTS), and Windows (tested on Windows 10 Pro)

Inference

OpenLabeler can help improve the speed and accuracy of annotation by offering labeling "hints" from a saved model using TensorFlow (currently, only x86/x86_64 machines are supported).

For example, you have thousands of images to annotate. After labeling the first 300 or so images, you could train a model using these 300 samples, then configure OpenLabeler to use this intermediary model to give you labeling suggestions for the remaining images, thereby speeding up the annotation task.

Inference Preferences

The Label Map File is the label map file in protobuf format (.pbtxt).

The Saved Model Location is the folder where the .pb file is located. If it is at /opt/model/saved_model/saved_model.pb, then the location should be specified as /opt/model/saved_model. Also, the .pb file must be named saved_model.pb.

OpenLabeler supports graphs with the image_tensor and encoded_image_string_tensor operations/input types.

The protobuf sources is located in https://github.com/tensorflow/models/tree/master/research/object_detection/protos

Training Support

Note: This is currently an experimental feature.

OpenLabeler can be used to start/stop a training process in TensorFlow running inside a Docker container. Containers with TensorFlow 2 and Object Detection API dependencies have been pre-built for your convenience. To use this feature:

  1. Install Docker on your host machine
  2. Choose a pre-built, kinhong/openlabeler:tf-2.3.1 or kinhong/openlabeler:tf-2.3.1-gpu, docker image from Docker Hub and pull it to your docker host
  3. Download a base model from the TensorFlow 2 Detection Model Zoo for transfer learning
  4. Configure the Training Preference settings (and add the label map entries) Train Preferences
  5. You can then start, stop, continue, restart training, or export the inference graph

Shortcut Keys

OpenLabeler supports the following shortcut keys:

Key Combination Action
Ctrl (or ⌘) + o Open media file
Ctrl (or ⌘) + d Open media directory
Ctrl (or ⌘) + s Save changes
Ctrl (or ⌘) + x Cut
Ctrl (or ⌘) + c Copy
Ctrl (or ⌘) + v Paste
⌫ (Backspace or Delete) Delete selected box
Ctrl (or ⌘) + p Go to previous media file
Ctrl (or ⌘) + n Go to next media file
Ctrl (or ⌘) + g Go to next unlabeled media file
Ctrl (or ⌘) + h Show inference hints
Ctrl (or ⌘) + Shift + h Hide inference hits
Ctrl (or ⌘) + z Undo
Ctrl (or ⌘) + Shift + z Redo
Ctrl (or ⌘) + ↑→↓← (Arrow Keys) Move selected bounding box
Any character(s) Match/change label by prefix (on recent labels) of the selected box

Installation

If you have previously installed OpenLabeler, uninstall it first.

Download and execute the .pkg, .deb or .msi installation packages for macOS, Linux, and Windows respectively on the releases page.

Recommended Directory Structure

+project
  +images
  +annotations
  +data
    -label_map file
    -train TFRecord file
    -eval TFRecord file
  +models
    +model
      +checkpoint
      +saved_model
      -pipeline config file
      -model.config (created by OpenLabeler)
      +temp (created by OpenLabeler)
        -ckpt-xyz...
        ...
      +fine_tuned_model (created by OpenLabeler)

Build

This application can be built using Apache Maven with CLI. First make sure the environment variable JAVA_HOME has been set accordingly

macOS

  1. Download and install OpenJDK 21
  2. Download and install Maven
cd <openlabeler>
mvn clean package -Drevision=x.y.z

The macOS .pkg installer can be found under the app/target/package directory.

Linux

sudo add-apt-repository ppa:openjdk-r/ppa \
sudo apt update -q \
sudo apt install -y openjdk-21-jdk

sudo apt install maven
sudo apt install binutils
sudo apt install fakeroot

cd <openlabeler>
mvn clean package -Drevision=x.y.z

The Linux .deb bundle can be found under the app/target/package directory.

Windows

  1. Download OpenJDK 21 for Windows and unzip to a directory with no spaces (e.g., C:\java\jdk-21)
  2. Download Maven and unzip to a directory with no spaces (e.g., C:\java\apache-maven)
  3. Download Wix Toolset and unzip to a directory with no spaces (e.g., c:\wix)
  4. Make sure java, mvn and wix executables are in your Windows PATH (e.g., set PATH=%PATH%;C:\java\jdk-21\bin;C:\java\apache-maven\bin;c:\wix)
cd <openlabeler>
mvn clean package -Drevision=x.y.z

The Windows .msi file can be found under the app\target\package directory.

License

Apache License 2.0