YOLOv2 Object Detection from ONNX Model in MATLAB

How I imported Tiny YOLOv2 ONNX model in MATLAB and re-trained the network to detect objects on custom data set

Feb 25 ·5min read

Image courtesy Embry-Riddle’s RoboSub Team

Data set

RoboSub is a competition run by RoboNation where students build an autonomous underwater vehicle to perform simulated search & rescue tasks. The basic task is to identify and avoid the Autonomous Underwater Vehicle (AUV) through the objects under water.

The image data used for this story is provided by Robotics Association at Embry-Riddle’s RoboSub Team . The images are captured during their practice runs with a live camera mounted on their AUV. The complete dataset can be downloaded from this google drive .

Data Preparation

All the images are resized to (416 x 416 x 3) and divided into three folders of train, test and validation. Images are then labelled using the custom automation algorithms in the Ground Truth Labeler app in MATLAB. To learn more about the complete labeling process please refer to this YouTube video .

Data from the Ground Truth Labeler app is exported into MATLAB in the form of groundTruth data object. It is then further converted into tables using the function objectDetectorTrainingData . The detailed code file is located here .

Note: Download the data and run this script of dataPreProcessing before proceeding to next steps .