LabelImg is a graphical image annotation tool.

Overview

LabelImgPlus

LabelImg is a graphical image annotation tool. This project is not updated with new functions now. More functions are supported with LabelImgTool Project(https://github.com/lzx1413/LabelImgTool)

It is written in Python and uses Qt for its graphical interface.

The annotation file will be saved as an XML file. The annotation format is PASCAL VOC format, and the format is the same as ImageNet

task mode change

DET mode

SEG mode

CLS mode

Brush SEG mode(in development: brush branch)

Release software for windows

baiduyun

googledriver

Build source and use it

  • Ubuntu

sudo apt-get install pyqt4-dev-tools

  • Mac install pyqt5

sudo apt-get install python-opencv

pip install lxml

pip install qdarkstyle

./labelImg.py

  • Windows

$ python labelImg.py

Default file framework

|---Images

​ |---images_1

​ |---images_2

|---Annotation

​ |---images_1

​ |---images_2

the file containing annotations will be created by default.

Usage

After cloning the code, you should run $ make all to generate the resource file.

You can then start annotating by running $ ./labelImg.py. For usage instructions you can see Here

At the moment annotations are saved as an XML file. The format is PASCAL VOC format, and the format is the same as ImageNet

You can also see ImageNet Utils to download image, create a label text for machine learning, etc

Label and parsing

support rectangle label and parsing labels

Create pre-defined classes

You can edit the data/predefined_classes.txt to load pre-defined classes

You also can create labels with two levels in data/predefined_sub_classes.txt

And the labels will be ranked by the frequency you use it.

General steps from scratch

  • Build and launch: $ make all; python labelImg.py

  • Click 'Change default saved annotation folder' in Menu/File

  • Click 'Open Dir'

  • Click 'Create RectBox'

The annotation will be saved to the folder you specifiy

Hotkeys

  • Ctrl + r : Change the defult target dir which saving annotation files

  • Ctrl + n : Create a bounding box

  • Ctrl + s : Save

  • Right : Next image

  • Left : Previous image

Online image data mode

the server have to make the images in a folder that clint can get from http/https with get function

  • settings

open File -->RemoteDBSettings(ctrl+m) like that

the remote image list is a file contenting the name of the images (a line is a image) .

the image will be cached in a folder created in the software file named database/pics/XXXX and this will take a lot of memory if there are a lot of images,and this will be modified in the future.

open File -->ChangedDefaultSavedAnnotationDir(ctrl+r) to set the folder to save the results

  1. if your settings are right,you will find the Get Images button becomes enabled and click it ,then you can annotate the images as before

Change list

2019-07-03 support pyqt5 and python 3

17-08-14 add class label function

Todo list

  • add more functions while adding parsing labels
  • refine the setting functions

How to contribute

Send a pull request

License

License

Comments
  • Error: Create RectBox

    Error: Create RectBox

    Hello,

    When I create a RecBox, I get the error below. I can't therefore save the document and the box disappears after changing the image. " Traceback (most recent call last): File "labelImg.py", line 1124, in newShape self.actions.create.setEnabled(True) AttributeError: 'struct' object has no attribute 'create' "

    opened by pogilon 1
  • Can not save polygon

    Can not save polygon

    Hi, I have trouble with you app when trying to create a polygon in segmentation mode. This is the error

    Traceback (most recent call last):
      File "/home/manhattan/new_workplace/annotation/labelImgPlus/libs/canvas.py", line 200, in mousePressEvent
        self.line[0] = self.current[-1]
    TypeError: 'NoneType' object has no attribute '__getitem__'
    
    

    I found this may be a bug, and I fixed in file canvas.py in line 200 from

    if self.current.isClosed():
         self.finalise()
    self.line[0] = self.current[-1]
    

    This is bug because if you call self.finalise() the self.current become None. So I fixed to below and it seemed to work

    self.line[0] = self.current[-1]
    if self.current.isClosed():
         self.finalise()
    
    opened by se7oluti0n 1
  • AttributeError: 'QListWidget' object has no attribute 'setItemSelected'

    AttributeError: 'QListWidget' object has no attribute 'setItemSelected'

    Hi there.

    When i press click on an image in the list i got this message in console.

    I am running python 3.8 pyqt5 on ubuntu focal 20.04

    Traceback (most recent call last):
      File "labelImg.py", line 803, in fileitemDoubleClicked
        self.loadFile(filename)
      File "labelImg.py", line 1256, in loadFile
        self.fileListWidget.setItemSelected(fileWidgetItem, True)
    AttributeError: 'QListWidget' object has no attribute 'setItemSelected'
    Traceback (most recent call last):
      File "labelImg.py", line 803, in fileitemDoubleClicked
        self.loadFile(filename)
      File "labelImg.py", line 1256, in loadFile
        self.fileListWidget.setItemSelected(fileWidgetItem, True)
    AttributeError: 'QListWidget' object has no attribute 'setItemSelected'
    
    opened by danielTobon43 0
  • IOError: [Errno 2] No such file or directory:

    IOError: [Errno 2] No such file or directory:

    hello, I'm afraid that line 1035(https://github.com/lzx1413/labelImgPlus/blob/master/labelImg.py#L1035) and line 1047(https://github.com/lzx1413/labelImgPlus/blob/master/labelImg.py#L1047) cause the issue of IOError mentioned on the title.

    To solve them, line 1035 should be replaced by result_path = os.path.join(self.defaultSaveDir,os.path.splitext(imgFileName)[0]) result_path += '_mask.png' and line 1047 should be replaced by savefilename = os.path.join(self.defaultSaveDir,os.path.splitext(imgFileName)[0]) # the mask image will be save as file_mask.jpg etc. savefilename += '.xml'.

    opened by zhiweichen0012 1
  • XML fiels generated by DET mode is not supported by the YOLO

    XML fiels generated by DET mode is not supported by the YOLO

    Do we have a YOLO that supports DET mode?

    the XML files does not have (xmin,ymin,height,widrth)

    Traceback (most recent call last): File "gen_anchors.py", line 138, in main(args) File "gen_anchors.py", line 124, in main relative_w = (float(obj['xmax']) - float(obj['xmin']))/cell_w KeyError: 'xmax'

    opened by sharmarochan 0
  • Change code to select multipe boxes

    Change code to select multipe boxes

    Say i want to delete multiple boxes at once, without clicking each box and deleting separately. What changes would i make to the source code to either a) select multiple boxes with the mouse (overlapping them with a mouse box) or b) select multiple boxes by clicking each, and then pressing delete once.

    opened by JadBatmobile 1
  • Can't save markup data

    Can't save markup data

    I'm trying to run labelImgPlus under Windows using anaconda python 2.

    But seems it can't save polygon markup data:

    C:\Users\myuser\Anaconda2\python.exe labelImg.py
    
    color map [u'0,0,0\n', u'255,0,0,128\n', u'0,255,0,128\n', u'0,0,255,128\n', u'1
    39,0,139,128\n', u'0,139,139,128\n', u'137,104,205,128\n', u'104,34,139\n', u'22
    4,102,255\n', u'255,187,255\n', u'238,58,140\n', u'205,41,144\n', u'0,191,255\n'
    , u'139,125,123\n', u'240,255,240\n', u'205,179,139\n', u'34,139,34\n', u'127,25
    5,0\n', u'0,100,0\n', u'240,255,240\n', u'255,246,143\n']
    [<PyQt4.QtGui.QColor object at 0x000000000429BDD8>, <PyQt4.QtGui.QColor object a
    t 0x00000000044BD278>, <PyQt4.QtGui.QColor object at 0x00000000044BD128>, <PyQt4
    .QtGui.QColor object at 0x00000000044BD0B8>, <PyQt4.QtGui.QColor object at 0x000
    00000044BD2E8>, <PyQt4.QtGui.QColor object at 0x00000000044BD358>, <PyQt4.QtGui.
    QColor object at 0x00000000044BD3C8>, <PyQt4.QtGui.QColor object at 0x0000000004
    4BD438>, <PyQt4.QtGui.QColor object at 0x00000000044BD4A8>, <PyQt4.QtGui.QColor
    object at 0x00000000044BD518>, <PyQt4.QtGui.QColor object at 0x00000000044BD588>
    , <PyQt4.QtGui.QColor object at 0x00000000044BD5F8>, <PyQt4.QtGui.QColor object
    at 0x00000000044BD668>, <PyQt4.QtGui.QColor object at 0x00000000044BD6D8>, <PyQt
    4.QtGui.QColor object at 0x00000000044BD748>, <PyQt4.QtGui.QColor object at 0x00
    000000044BD7B8>, <PyQt4.QtGui.QColor object at 0x00000000044BD828>, <PyQt4.QtGui
    .QColor object at 0x00000000044BD898>, <PyQt4.QtGui.QColor object at 0x000000000
    44BD908>, <PyQt4.QtGui.QColor object at 0x00000000044BD978>, <PyQt4.QtGui.QColor
     object at 0x00000000044BD9E8>]
    change mode to {'enable_color_map': False, 'mode': 1}
    app mode 1
    4
    4
    {u'01-hair': 0, u'None': 0, u'02-skin': 0, u'03-body': 0}
    shapeSelectionChanged
    shapeSelectionChanged
    shapeSelectionChanged
    shapeSelectionChanged
    shape type POLYGON
    Traceback (most recent call last):
      File "labelImg.py", line 1555, in saveFileAs
        self._saveFile(self.saveFileDialog())
      File "labelImg.py", line 1573, in _saveFile
        if filename and self.saveLabels(filename):
      File "labelImg.py", line 1030, in saveLabels
        with open(self.defaultSaveDir + 'label_num_dic.json', 'w') as label_num_file
    :
    TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
    
    opened by mrgloom 1
Owner
lzx1413
learning
lzx1413
This project aim to create multi-label classification annotation tool to boost annotation speed and make it more easier.

This project aim to create multi-label classification annotation tool to boost annotation speed and make it more easier.

null 4 Aug 2, 2022
Weakly Supervised 3D Object Detection from Point Cloud with Only Image Level Annotation

SCCKTIM Weakly Supervised 3D Object Detection from Point Cloud with Only Image-Level Annotation Our code will be available soon. The class knowledge t

null 1 Nov 12, 2021
A embed able annotation tool for end to end cross document co-reference

CoRefi CoRefi is an emebedable web component and stand alone suite for exaughstive Within Document and Cross Document Coreference Anntoation. For a de

PythicCoder 39 Dec 12, 2022
A Data Annotation Tool for Semantic Segmentation, Object Detection and Lane Line Detection.(In Development Stage)

Data-Annotation-Tool How to Run this Tool? To run this software, follow the steps: git clone https://github.com/Autonomous-Car-Project/Data-Annotation

TiVRA AI 13 Aug 18, 2022
OpenCVのGrabCut()を利用したセマンティックセグメンテーション向けアノテーションツール(Annotation tool using GrabCut() of OpenCV. It can be used to create datasets for semantic segmentation.)

[Japanese/English] GrabCut-Annotation-Tool GrabCut-Annotation-Tool.mp4 OpenCVのGrabCut()を利用したアノテーションツールです。 セマンティックセグメンテーション向けのデータセット作成にご使用いただけます。 ※Grab

KazuhitoTakahashi 30 Nov 18, 2022
Open source annotation tool for machine learning practitioners.

doccano doccano is an open source text annotation tool for humans. It provides annotation features for text classification, sequence labeling and sequ

null 7.1k Jan 1, 2023
labelpix is a graphical image labeling interface for drawing bounding boxes

Welcome to labelpix ?? labelpix is a graphical image labeling interface for drawing bounding boxes. ?? Homepage Install pip install -r requirements.tx

schissmantics 26 May 24, 2022
PointCloud Annotation Tools, support to label object bound box, ground, lane and kerb

PointCloud Annotation Tools, support to label object bound box, ground, lane and kerb

halo 368 Dec 6, 2022
A data annotation pipeline to generate high-quality, large-scale speech datasets with machine pre-labeling and fully manual auditing.

About This repository provides data and code for the paper: Scalable Data Annotation Pipeline for High-Quality Large Speech Datasets Development (subm

Appen Repos 86 Dec 7, 2022
IJON is an annotation mechanism that analysts can use to guide fuzzers such as AFL.

IJON SPACE EXPLORER IJON is an annotation mechanism that analysts can use to guide fuzzers such as AFL. Using only a small (usually one line) annotati

Chair for Sys­tems Se­cu­ri­ty 146 Dec 16, 2022
O2O-Afford: Annotation-Free Large-Scale Object-Object Affordance Learning (CoRL 2021)

O2O-Afford: Annotation-Free Large-Scale Object-Object Affordance Learning Object-object Interaction Affordance Learning. For a given object-object int

Kaichun Mo 26 Nov 4, 2022
Multi-modal co-attention for drug-target interaction annotation and Its Application to SARS-CoV-2

CoaDTI Multi-modal co-attention for drug-target interaction annotation and Its Application to SARS-CoV-2 Abstract Environment The test was conducted i

Layne_Huang 7 Nov 14, 2022
Scikit-learn compatible estimation of general graphical models

skggm : Gaussian graphical models using the scikit-learn API In the last decade, learning networks that encode conditional independence relationships

null 213 Jan 2, 2023
Code, final versions, and information on the Sparkfun Graphical Datasheets

Graphical Datasheets Code, final versions, and information on the SparkFun Graphical Datasheets. Generated Cells After Running Script Example Complete

SparkFun Electronics 102 Jan 5, 2023
Monify: an Expense tracker Program implemented in a Graphical User Interface that allows users to keep track of their expenses

?? MONIFY (EXPENSE TRACKER PRO) ?? Description Monify is an Expense tracker Program implemented in a Graphical User Interface allows users to add inco

Moyosore Weke 1 Dec 14, 2021
Implementation of the final project of the course DDA6309 Probabilistic Graphical Model

Task-aware Joint CWS and POS (TCwsPos) This is the implementation of the final project of the course DDA6309 Probabilistic Graphical Models, The Chine

Peng 1 Dec 26, 2021
JudeasRx - graphical app for doing personalized causal medicine using the methods invented by Judea Pearl et al.

JudeasRX Instructions Read the references given in the Theory and Notation section below Fire up the Jupyter Notebook judeas-rx.ipynb The notebook dra

Robert R. Tucci 19 Nov 7, 2022
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022