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.
.. 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
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
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. |
+--------------------+--------------------------------------------+
Feel free to contact me to discuss any issues, questions, or comments.
- Email: [email protected]
- GitHub: stevensmiley1989
- LinkedIn: stevensmiley1989
- Kaggle: stevensmiley
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 |
---|