Creating ground truth for YOLOv2 using prebuilt dataset (have object mask need box label datastore)
3 ビュー (過去 30 日間)
古いコメントを表示
I am attempting to use a prebuilt data set from a University of Minnesota linked here https://conservancy.umn.edu/handle/11299/206575. In their data set they have a set of apples and then object masks corresponding to the object of interest.
I am trying to preprocess this data and run it through algorithms like YOLOv2 to produce an object detection algorithm for detecting apples. However, YOLOv2 requires me to use a ground truth containing an image datastore and a box label datastore. I have the image datastore but not the box label datastore as the data was outlined with a mask instead of labeled like in the MATLAB Image Labeler App. As a long shot I tried directly plugging in the dataset making the mask a logical variable in place of a true box label datastore.
Example of the object mask:
I have found how to impose the mask on to the img but I dont know how this helps derive a box lable datastore
As far as I am aware I need a box label datastore to use YOLOv2 and am now wondering if there was a way to directly convert the given object mask into a box label datastore. I have considered using the Image Labeler App and creating an algorithm to label the entire dataset however this defeats the purpose of using a prebuilt library. If you know of anyway of converting a mask to a box label it would be greatly appreciated.
0 件のコメント
回答 (1 件)
Aditya Srikar
2023 年 5 月 26 日
To convert the given object mask into a box label datastore for use with YOLOv2, you can use MATLAB's Regionprops function to compute the bounding box coordinates from the mask and save the results in a data table. Here's how to do it:
1. Load the object masks and corresponding image data into MATLAB.
2. Use the Regionprops function to compute the bounding box coordinates for each object mask. This function calculates the region properties of the connected components in the mask image, including the bounding box coordinates.
3. For each mask image, create a table that contains the image filename, bounding box coordinates, and class label (e.g. "apple").
4. Combine the tables for all the mask images into a single box label datastore that can be used with YOLOv2.
This should allow you to create a box label datastore from the object masks and use it with YOLOv2 for object detection.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!