We had learned from the non-ML-based ball detection algorithm that a color-and-contour-based algorithm cannot always detect the ball with enough accuracy. As a result, I have been developing an ML-based platform for training a model with multiple images of the ball and identifying a bounding box around the ball in untrained (and trained) images.
At first, I tried using the Tensorflow Object Detection API. However, the API has a number of issues on the Windows 10 platform as well as on Google Colab and, despite multiple trials for a week and a half, the code showed little progress. As a result, I replaced the API with the detecto module which is a simple-to-use PyTorch-based module. This has turned out well as observed in these images that contain a single ball:
01 02
and these that contain multiple balls:
03 04

I have used 63 images for training and 20 for testing, with each set containing both single-ball and multiple-ball images.
There were no false negatives. However, the following image showed a false positive by detecting the 3D printer material roll. I believe this can be solved by training with more data.
05

Next Post Previous Post