Giter Club home page Giter Club logo

labelimg-bkcn's Introduction

About This LabelImg

LabelImg is a graphical image annotation tool.

This LabelImg is a fork of the original one and modified to meet certain personal needs. And this README has been modified to reflect the changes.

This LabelImg is modified to support fcakyon/YOLOv5 training procedure by selecting the YAML file and weight PT file. The YAML file and PT file should be placed in the data folder. The YAML file will be automatically created/modified as well according to the images and labeling results.

It is written in Python and uses PyQt for its UI.

Annotations are saved as XML files in PASCAL VOC format, the format used by ImageNet. Besides, it also supports YOLO and CreateML formats.

Demo Image

Demo Image

Watch a demo video

Installation

Get from PyPI but only python3.0 or above

This is the simplest (one-command) install method on modern Linux distributions such as Ubuntu and Fedora.

pip3 install labelImg
labelImg
labelImg [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

Build from source

Linux/Ubuntu/Mac requires at least Python 2.6 and has been tested with PyQt 4.8. However, Python 3 or above and PyQt5 are strongly recommended.

macOS (M1 - where this fork is developed on)

Python 3 + Qt5

# Right click on the Terminal icon and select "Get Info"
# Toggle "Open using Rosetta"
# Restart Terminal
/usr/bin/python -m venv venv # Create a virtual environment
source env/bin/activate # Activate the virtual environment
pip install pyqt5 lxml # Install qt and lxml by pip
# Otherwise, M1 macs will try to use the arm64 version of python, which is not supported by pyqt5
# This is a temporary fix until pyqt5 is updated to support arm64

make qt5py3
python3 labelImg.py
python3 labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

macOS (Intel)

Python 3 + Qt5

pip3 install pyqt5 lxml # Install qt and lxml by pip

make qt5py3
python3 labelImg.py
python3 labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

Open cmd and go to the labelImg directory

pyrcc5 -o libs/resources.py resources.qrc

python labelImg.py
python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

If you want to package it into a separate EXE file

Install pyinstaller and execute:

pip install pyinstaller
pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg" -c labelImg.py -p ./libs -p ./

Usage

Steps (YOLO)

  1. In data/predefined_classes.txt define the list of classes that will be used for your training.
  2. Build and launch using the instructions above.
  3. Right below "Save" button in the toolbar, click "PascalVOC" button to switch to YOLO format.
  4. You may use Open/OpenDIR to process single or multiple images. When finished with a single image, click save.

A txt file of YOLO format will be saved in the same folder as your image with same name. A file named "classes.txt" is saved to that folder too. "classes.txt" defines the list of class names that your YOLO label refers to.

Note:

  • Your label list shall not change in the middle of processing a list of images. When you save an image, classes.txt will also get updated, while previous annotations will not be updated.
  • You shouldn't use "default class" function when saving to YOLO format, it will not be referred.
  • When saving as YOLO format, "difficult" flag is discarded.

Create pre-defined classes

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

Annotation visualization

  1. Copy the existing lables file to same folder with the images. The labels file name must be same with image file name.
  2. Click File and choose 'Open Dir' then Open the image folder.
  3. Select image in File List, it will appear the bounding box and label for all objects in that image.

(Choose Display Labels mode in View to show/hide lablels)

Hotkeys

Ctrl + u Load all of the images from a directory
Ctrl + r Change the default annotation target dir
Ctrl + s Save
Ctrl + d Copy the current label and rect box
Ctrl + Shift + d Delete the current image
Space Flag the current image as verified
w Create a rect box
d Next image
a Previous image
del Delete the selected rect box
Ctrl++ Zoom in
Ctrl-- Zoom out
↑→↓← Keyboard arrows to move selected rect box

Verify Image:

When pressing space, the user can flag the image as verified, a green background will appear. This is used when creating a dataset automatically, the user can then through all the pictures and flag them instead of annotate them.

Difficult:

The difficult field is set to 1 indicates that the object has been annotated as "difficult", for example, an object which is clearly visible but difficult to recognize without substantial use of context. According to your deep neural network implementation, you can include or exclude difficult objects during training.

How to reset the settings

In case there are issues with loading the classes, you can either:

  1. From the top menu of the labelimg click on Menu/File/Reset All
  2. Remove the .labelImgSettings.pkl from your home directory. In Linux and Mac you can do:
    rm ~/.labelImgSettings.pkl

How to contribute

Send a pull request

Original License

Free software: MIT license

Citation: Tzutalin. LabelImg. Git code (2015). https://github.com/tzutalin/labelImg

labelimg-bkcn's People

Contributors

tzutalin avatar rflynn avatar ez4bk avatar jorlogicus avatar chrisdal avatar madhavajay avatar breunigs avatar tmattio avatar isvoid avatar jaewchoi avatar vdalv avatar dependabot[bot] avatar lgov avatar yjmade avatar ledorub avatar chrisrapson avatar nhancv avatar sebasrivera96 avatar regiswang avatar xunchangqing avatar tomasra avatar thinh276 avatar sammiee5311 avatar rodolfoferro avatar pletnes avatar pta00 avatar lhk avatar keitotobi1 avatar alanyee avatar chieveit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.