PyImageLabeling is a tool designed to help create image masks, i.e., labeled images for training machine learning models.
Project description
PyImageLabeling
- GitHub Repository: View codesource.
- PyPI: Install via pip.
PyImageLabeling is a powerful tool with a user-friendly interface based on PyQT6 for creating image masks. These labeled images are used in the creation of machine learning models dedicated to computer vision tasks.
Two types of labeling are available:
- Pixel-by-Pixel: allows to use the pixel-level precision (paintbrush, magic pen, contour filling).
- Geometric shapes: allows to use different geometric shapes (polygon, rectangle, ellipse) for labeling.
Installation and Run
Note that you need first Python 3 (version 3.12, or later) to be installed. You can do it, for example, from Python.org.
PyPi installation (Windows, Mac and Linux)
Check whether you have the last version of PyPi:
python3 -m pip install -U pip
Install PyImageLabeling:
python3 -m pip install -U PyImageLabeling
To launch PyImageLabeling:
python3 -m PyImageLabeling
Executable ".exe" (Windows)
You can download the Windows executable. Just double-click on the executable file to launch PyImageLabeling.
Github Installation (Windows, Mac and Linux)
Here is an illustration for Linux. We assume that Python 3 is installed, and consequently ‘pip3’ is also installed. In a console, type:
git clone https://github.com/crillab/PyImageLabeling.git
You may need to update the environment variable ‘PYTHONPATH’, by typing for example:
export PYTHONPATH="${PYTHONPATH}:${PWD}/.."
Get the last version of pip:
python3 -m pip install --upgrade pip
Executes the pyproject.toml inside the PyImageLabeling directory and installs dependencies ("numpy", "pyqt6", "opencv-python", "pillow", "matplotlib").
python3 -m pip install -e .
To launch PyImageLabeling:
python3 -m PyImageLabeling
Features
PyImageLabeling considers that you have two working directories (which may be the same):
- The working directory containing your images to be labeled.
- The saving directory containing your labeled images and a JSON file.
The saving directory consists of:
- The labeled PNG files: each label of each image is represented by a labeled PNG file.
- The JSON file contains several information about labels: identifier, name, color and type.
Load/Save and Image Management
| Tool | Functionality |
|---|---|
| Load | Load images and/or labeled images from a working or saving directory |
| Save | Save current labeled images in a saving directory |
| Export copy | Create a copy of the saving in another folder |
| Next | Select the next image |
| Previous | Select the previous image |
Navigation & Controls
| Movement | Function |
|---|---|
| Zoom in | Click to zoom in (up mouse wheel shorcut) |
| Zoom out | Click to zoom out (down mouse wheel shorcut) |
| Move | Click and drag to move the current (wheel mouse click shorcut) |
| Reset | Reset to default view (zoom and position) |
Label setting
| Tool | Functionality |
|---|---|
| Add Label | Add a new label (by chosing the name, the type and the color of the new label) |
| Label Opacity | Adjust the transparency of the labeled layers. |
Moreover, for each label, you can set some parameters:
| Tool | Functionality |
|---|---|
| Color | Set the color of the selected label |
| Visibility | Set the visibilty of the selected label |
| Setting | Set the parameters of the selected label |
| Remove | Remove the selected label (warning: delete all saving files containing this label) |
Labeling Tools
| Tool | Pixel-by-pixel |
|---|---|
| Contour Filling | Shape detection: click inside a detected shape to fill with the label (tolerance in parameter) |
| Paintbrush | Paint with the selected label (Paintbrush size in parameter) |
| Magic Pen | Intelligent fill tool based on color similarity (tolerance, pixel limit and method in paramter) |
| Tool | Geometric shapes |
|---|---|
| Ellipse | Precision ellipse selection for label assignment |
| Rectangle | Precision rectangular selection for label assignment |
| Polygon | Precision polygon selection for label assignment |
Editing Tools
Each editing tools is proper to each selected label.
| Tool | Functionality |
|---|---|
| change labeled area | Change the lebel of an area for another one with a click |
| Undo | Revert the last action with full history support |
| Eraser | Brush that erases the selected label (Eraser brush size and "all labels" mode in parameter) |
| Clear All | Clear all label areas. |
License
This project is licensed under the MIT License - see the LICENSE file for details.
Use Cases
- Computer Vision: Create training datasets for object detection and segmentation
- Medical Imaging: Annotate medical scans and diagnostic images
- Autonomous Vehicles: Label road scenes and traffic elements
- Agriculture: Mark crop areas and plant health indicators
- Quality Control: Identify defects and areas of interest in industrial applications
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyimagelabeling-1.0.8-py3-none-any.whl.
File metadata
- Download URL: pyimagelabeling-1.0.8-py3-none-any.whl
- Upload date:
- Size: 402.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2eab77826f4b3a79c4f8821cf3ede239b93269ee33c09e0d53d8024094324c79
|
|
| MD5 |
82e50877e78cca951d58f1e9045643a1
|
|
| BLAKE2b-256 |
c69ce5405da4e63550bfbc54955acf0ac70d5e1a02b0399c2e76efcf3120ede2
|