Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Create a Dataset for Object Detection
Computer Vision

Create a Dataset for Object Detection

Last Updated on June 2, 2020 by Editorial Team

Author(s): Pushkar Pushp

Computer Vision

Source: Unsplash

Introduction

The first step for most computer vision tasks such as classification, segmentation, or detection is to have custom data for your problem set. There are multiple ways of creating labeled data; one such method is annotations.

The annotation technique manually creates regions in an image and assign aΒ label.

Now to keep things simple, we will be using two tools Pixel Annotation tool and Microsoft VoTT. You can read more about this tool, Pixel and Microsoft VoTT.

Pixel Annotation Tools

Installation forΒ macOS.

git clone https://github.com/abreheret/PixelAnnotationTool

Then update brew using brewΒ update.

Next, you need to install a cross-platform application development framework such asΒ qt.

brew install qt

Pixel Annotation tool uses a watershed algorithm to do image segmentation.

Readers can use this link to read more about the watershed algorithm inΒ detail.

brew install opencv

In Mac curl is already installed, you can check it by using typing curl -V in the terminal.

Something like this will appear, else install curl usingΒ brew.

brew install curl

Pixel Annotation tool does not come up with aΒ .dmg file or a Graphic interface, so you need to transform source code to a stand-alone form viaΒ build.

cd PixelAnnotationTool

Inside this directory create theΒ build

mkdir build
cd build

Next, inside build use the following command:

cmake .. -DCMAKE_BUILD_TYPE=$CONFIG -DDISABLE_MAINTAINER_CFLAGS=off -DCMAKE_PREFIX_PATH=$(brew --prefix qt) -DQMAKE_PATH=$(brew --prefix qt)/bin

Finally,

cmake --build .

We are all set to run and use the Pixel Annotation tool.

Go to the spotlight and search for the Pixel Annotation tool.

Pixel Annotation Tool

Creating aΒ Dataset.

Go to the File option at the top left and select Open a directory.

On the top right, see all fileΒ names.

Select one image, say β€˜Sachin.jpg.’

Go to the color panel on the left side and select any color, let me set theΒ sky.

Move your cursor around the person (Sachin).

Then select another color say β€˜out of roi’ and move the cursor around the entire region except for aΒ person.

Then click on the watershed option at the bottom left and press Command + S to save theΒ image.

Finally, you will get thisΒ mask.

Result

Input

Output

This mask serves as input for any object detection model.

Microsoft Visual Object Tagging ToolΒ (VoTT)

Installation forΒ macOS.

Unlike Pixel Annotation Tools, VoTT comes with Disk Image(dmg) file.

Tool Appears likeΒ this.
  • Click on NewΒ Project
  • Fill Display Name, say Cricketers in myΒ case.
  • Add Source Connection, click on that a screen will pop upΒ like
  • In Provider, select Local File System if your file to annotate is on theΒ Laptop.
  • Select the folder where the images are and click on β€œSave Connection.”
  • Once saved, something like below will appear, from source connection drop-down select β€˜Cricketers,’ which we haveΒ created.
  • Next, go to the target connection and add a connection.

Same as source, for target select Cricketers_annotations.

  • At the bottom, there will beΒ Tags.

Enter the label you want, cricketers in ourΒ case.

  • Save Project

A screen similar to this willΒ appear.

  • In the left panel, you will see an arrow mark (fourth row ), click on that below screen willΒ appear.

From the Provider drop-down menu, select Pascal VOC and enter β€œSave Export Settings.”

Create a box around the player and select tag from right, then save it from the save option at theΒ top.

  • Repeat this process for all images in the folder. Once done, we need to export theΒ output.
  • At the top of the image, there is an Export projectΒ option.

Once exported, go to thatΒ folder.

In this blog, we learned how to create a dataset for object detection and segmentation. Next, I will walk through the conversion of this mask into polygon co-ordinates, annotations.

A directory Cricketers-PascalVOC-export creates at the target location providedΒ earlier.

Enjoy!


Create a Dataset for Object Detection was originally published in Towards AIβ€Šβ€”β€ŠMultidisciplinary Science Journal on Medium, where people are continuing the conversation by highlighting and responding to this story.

Published via Towards AI

Feedback ↓