Machine Learning Player v1.1 is out!
Hello! Today we are pleased to announce the second release of our Machine Learning Player. As you may already know, ML Player can be used for visualizing the output of machine learning models.
Here are the features that we have added:
- ML Player can now be run on Windows, macOS, and Ubuntu (previously, ML Player was exclusive to Ubuntu).
- ML Player now supports Object Detection models that return bounding boxes.
- You can specify the processing rate: for example, if the processing rate is 1, then every frame is sent to a model. If the processing rate equals 100, then only every 100th frame is sent to a model. If you run ML Player on CPU, it can be useful for increasing FPS.
We have also fixed a couple of bugs, one of them occurred when a user was in the Camera mode.
The slider was fixed as well: navigation was made more precise.
Let’s look closer at bounding boxes. A bounding box is a rectangle that indicates an object in a frame. Bounding boxes are often used for object detection in Machine Learning.
There are ML Player demos for all the technologies that we develop. You can download and try them yourself! Here’s the link.
If you read our previous article, you should know about plugins. To create a plugin for a model that returns bounding boxes, you need to add a couple of structures to the header file.
struct FrameImage
{
uint8_t *data;
uint64_t frameNumber;
int width;
int height;
int bytesPerLine;
int format;
};
/// required only for plugins that have "return_type": "bounding_boxes"
struct BoundingBox
{
char *className;
float score;
int x1; /// top-left x
int y1; /// top-left y
int x2; /// bottom-right x
int y2; /// bottom-right y
};
/// required only for plugins that have "return_type": "bounding_boxes"
struct BoundingBoxArray
{
int size; /// the size of the array
BoundingBox *boxes;
};
extern "C"
{
PLUGIN_EXPORT void *processFrame(FrameImage *frame); /// frame processing
PLUGIN_EXPORT void release(); /// deallocate resources here
}
Then, just implement the processFrame function that returns a pointer to BoundingBoxArray containing all the bounding boxes for the current frame. You can find more information and examples in the documentation on ML Player.
We hope you found this article interesting! You can download ML Player here. Contact us if you have any questions. See you soon!