Skip to content

MOSAIC_Chip_Sorter.py is a labeling annotation tool that allows one to identify & fix mislabeled annotation data (chips) in their dataset through the use of MOSAICs and UMAP quickly.

License

stevensmiley1989/MOSAIC_Chip_Sorter

Repository files navigation

MOSAIC_Chip_Sorter

Repository by Steven Smiley 3/20/2022

MOSAIC_Chip_Sorter.py MOSAIC_Chip_Sorter.py is a labeling annotation tool that allows one to identify & fix mislabeled annotation data (chips) in their dataset through the use of MOSAICs and UMAP quickly.

MOSAIC_Chip_Sorter.py creates mosaics based on the PascalVOC XML annotation files (.xml) generated with labelImg or whatever method made with respect to a corresponding JPEG (.jpg) image.

Uniform Manifold Approximation and Projection (UMAP, https://umap-learn.readthedocs.io/en/latest/) is a dimension reduction technique that can be used for visualization of the data into clusters.

MOSAIC_Chip_Sorter.py allows easy interfacing with annotation tool, labelImg.py (git clone https://github.com/tzutalin/labelImg.git).

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

As chips are selected, their corresponding Annotation/JPEG files are put in new directories with "...to_fix". These are used later with LabelImg.py or whatever label tool to update.

Prerequisites

.. code:: shell
    cd ~/
    git clone https://github.com/stevensmiley1989/labelImg.git
    cd labelImg
    git switch smiley
    pip3 install -r requirements/requirements-linux-python3.txt #you might need to adjust things manually  
   

Installation

Linux


Python 3 + Tkinter

.. code:: shell
    cd ~/
    python3 -m venv venv_MOSAIC_Chip_Sorter
    source venv_MOSAIC_Chip_Sorter/bin/activate
    
    cd ~/labelImg
    sudo apt-get install pyqt5-dev-tools
    pip3 install -r requirements/requirements-linux-python3.txt
    make qt5py3
    
    cd ~/MOSAIC_Chip_Sorter
    pip3 install -r requirements.txt
    python3 MOSAIC_Chip_Sorter.py

Mac


Python 3 + Tkinter

.. code:: shell
    cd ~/
    python3 -m venv venv_MOSAIC_Chip_Sorter
    source venv_MOSAIC_Chip_Sorter/bin/activate
    
    cd ~/labelImg
    pip3 install pyqt5 lxml # Install qt and lxml by pip
    make qt5py3
    
    cd ~/MOSAIC_Chip_Sorter
    pip3 install -r requirements_Mac.txt
    python3 MOSAIC_Chip_Sorter.py

Windows


Python 3 + Tkinter

.. code:: shell
    cd ~/
    python3 -m venv venv_MOSAIC_Chip_Sorter
    ./venv_MOSAIC_Chip_Sorter/Scripts/activate
    
    cd ~/labelImg
    sudo apt-get install pyqt5-dev-tools
    pip3 install -r requirements/requirements-linux-python3.txt
    make qt5py3
    
    cd ~/MOSAIC_Chip_Sorter
    pip3 install -r requirements.txt
    python3 MOSAIC_Chip_Sorter.py

Hotkeys

MOSAIC Hotkeys

+--------------------+--------------------------------------------+
| KEY                | DESCRIPTION                                |
+--------------------+--------------------------------------------+
| n                  | Next Batch of Images in Mosaics            |
+--------------------+--------------------------------------------+
| q                  | Close the Mosaic Images                    |
+--------------------+--------------------------------------------+
| y                  | Select all objects in Mosaic               |
+--------------------+--------------------------------------------+
| u                  | Unselect all objects in Mosaic             |
+--------------------+--------------------------------------------+
| t                  | Drop Down Menu for changing name of object |
+--------------------+--------------------------------------------+

UMAP Hotkeys

+--------------------+--------------------------------------------+
| KEY                | DESCRIPTION                                |
+--------------------+--------------------------------------------+
| n                  | Closes inspected image if open.            |
+--------------------+--------------------------------------------+
| f                  | Adds inspected image to the fix list.      |
+--------------------+--------------------------------------------+
| q                  | Closes the window.                         |
+--------------------+--------------------------------------------+
| Esc                | Closes the window.                         |
+--------------------+--------------------------------------------+
| d                  | Deletes the object from annotation file.   |
+--------------------+--------------------------------------------+
| 1,2,3,etc          | Changes label to key index displayed.      |
+--------------------+--------------------------------------------+
| m                  | Creates MOSAIC to fix labels of selected.  |
+--------------------+--------------------------------------------+
| c                  | Creates new label for key index to change. |
+--------------------+--------------------------------------------+ 
| z                  | Deletes an entire selection picked.         |
+--------------------+--------------------------------------------+ 

Contact-Info

Feel free to contact me to discuss any issues, questions, or comments.

License

MIT License

Copyright (c) 2022 Steven Smiley

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*I am providing code and resources in this repository to you under an open source license. Because this is my personal repository, the license you receive to my code and resources is from me and not my employer.

User can quickly find mislabeled objects and alter them on the fly.

STEPS
1.
2.
3.
4a.
4b.
4c.
4d.
4e.
4f.
4g.
5a.
5b.
5c.
5d.
5e.
6a.
6b.
6c.
6d.
7a.
7b.
8a.
8b.
9a.
9b.
9c.
10a.
10b.
11a.
11b.

About

MOSAIC_Chip_Sorter.py is a labeling annotation tool that allows one to identify & fix mislabeled annotation data (chips) in their dataset through the use of MOSAICs and UMAP quickly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages