AutoAnnotator - MacOS Utility App
Automatic Image Annotator for Computer Vision
in Image Annotation Computer Vision Object Detection MacOS Swift
January 11, 2023
Introduction
Data Collection is a major step in every Machine Learning projects. The quality and quantity of data alone can greatly impact the results of the model. AutoAnnotator is an open-source automatic image annotator created using the Swift and Python. It’s an updated version of AutoLabelMe, the GUI I wrote using Tkinter library in Python for my Internship at Hubert Curien Laboratoire.
It matches the template provided by the user in an image and find same objects associating a bounding box and label for every object. AutoAnnotator uses Normalized Cross-Correlation to check whether two templates are similar. It is designed keeping in mind with the necessity of creating dataset for object detection purposes.
Installation
Currently only for Macos, AutoAnnotator is released.
Prerequisites
- MacOS
- Anaconda Distribution
- Python
Python Library Requirements
1. Numpy
user@Mac ~ % conda install numpy
or
user@Mac ~ % pip install numpy
2. Pandas
user@Mac ~ % conda install pandas
3. Opencv
user@Mac ~ % conda install -c conda-forge opencv
or
user@Mac ~ % pip install opencv-python
4. PIL
user@Mac ~ % pip install Pillow
Installtion of the python libraries is necessary for the app to run effectively. If you don’t have it installed or if the selected python environment in the app don’t have it installed, the app will install it automatically. This may delay results.
Tutorial
The first two steps are very important. These two steps are to be done only once.
Change Python Environment
AutoAnnotator is written in Swift and Python and it only requires that Python is installed in your machine. You don’t need to install Swift. The libraries mentioned here are necessary for automatic box generation purposes. When you will first open AutoAnnotator, it will choose the default Python Environment which mayn’t have those libraries installed.
Your system may have multiples python environments, this step will make sure you load the correct environment in the app.
Click on 'Settings'
When the popover appears check the python path. The path may be like this
/opt/homebrew/bin/python3
If you have installed the libraries in any anaconda enviroment then change the path to the anaconda python environment.
Click on 'Change Path'
The anaconda environment paths look like these.
~/anaconda/bin/python3
~/anaconda/envs/your-environment-name/bin/python3
~/anaconda/envs/your-environment-name/bin/python
*Once this step is complete, check the path and restart the app for the changes to take effect. This step is to be done only once when you first open the app.
Path for Python Scripts
Some Python Scripts are provided with the installation file. You need to load the scripts in Settings/Load Scripts
and choose the location where you have unzipped the downloaded file.
*No need to restart after this step. This step is to be done only once when you open the app for the first time.
Add New Images
To add one or multiple images, follow these steps
Click on the + button in the middle or 'New Image' button on the sidebar.
Add one or multiple images
Go to Next Image
Click on the 'next' and 'previous' button to navigate through images.
To move to your desired image,
click on the current image name tab and
a popover will appear where names of every open images are available.
Click on the image name you want to load.
Draw Rectangle
Click on 'Draw Rectangles' on the sidebar and start drawing on the image.
When drawing mode is enabled, you can’t move the image. To move the image, click on ‘Move image’.
Move Rectangle
Following video demonstrates how to change the box position.
Resize Rectangle
To resize an image click on the red circle of the box
and drag it to increase or decrease the size of the box.
Match Rectangles
Examples
- Posted on:
- January 11, 2023
- Length:
- 4 minute read, 707 words
- Categories:
- Image Annotation Computer Vision Object Detection MacOS Swift