How to Annotate Images with Labelme for Your Own Datasets
Got a bunch of images you need to tag for your project? Labelme is your go-to tool. It’s free and pretty popular among folks who do this kind of thing. Here’s the lowdown on how to get started:
- Set Up Your Workspace: As the first step, create a virtual environment for your project. This keeps everything neat and organized.
2. Install Labelme: Next up, install Labelme using pip. It’s a breeze.
3. Launch the App: Once installed, just type “labelme” in your command line, and a window should pop up.
And you will see the pop up screen as follows:
4. Pick Your Images: Hit the ‘open dir’ button to select the folder with your images. For example, if you’re working on a ‘test’ folder, just click on it.
5. Choosing Images: You won’t see the images immediately in the pop-up, but they’re there. Click ‘Choose’ to view them as follows:
6. Start Annotating: Now for the fun part! Click on ‘Create Polygons’ to start drawing boundaries on your image. If you’re tagging an orange, for example, outline it and then label it. Sorry if my drawings aren’t perfect — because they are taken as screenshot from my YouTube video :)
7. Label List: Once you’ve annotated an object, its label shows up on the right side of the window.
8. Saving Your Work: When you rty to move to another image, the app asks if you want to save your annotations as a JSON file. Click save to save the annotation.
9. Finishing Up: After working through all your images, you’ll find a corresponding annotation file for each image in your folder.
And there you have it, a dataset annotated in Labelme format. Ready to train the Mask RCNN in Detectron2? You can also change the format of your dataset with some built-in scripts like labelme2coco.py and labelme2voc.py, found in the Labelme repo. I’ve got a YouTube video that walks you through it including the steps above, or you can dive straight into the scripts with the necessary arguments.
Get Hamza Görgülü’s stories in your inbox
Join Medium for free to get updates from this writer.
Hope this guide helps you navigate Labelme with ease. Happy annotating and good luck with your project!








