# Wolfram Neural Net Repository

Immediate Computable Access to Neural Net Models

Detect and localize human joints in an image

YOLO (You Only Look Once) Version 8 by Ultralytics is the latest version of the YOLO models. Just like its predecessor, YOLO Version 5, YOLO Version 8 is an anchor-free model that was trained with mosaic augmentation. It features the use of new "C2f" blocks, which employ additional dense connections between bottleneck modules. Although YOLO models are historically object detection models, these models perform both object detection and human joint keypoint regression at the same time.

- Microsoft COCO, a dataset for image recognition, segmentation, captioning, object detection and keypoint estimation, consisting of more than three hundred thousand images.

Get the pre-trained net:

In[1]:= |

Out[2]= |

This model consists of a family of individual nets, each identified by a specific parameter combination. Inspect the available parameters:

In[3]:= |

Out[3]= |

Pick a non-default net by specifying the parameters:

In[4]:= |

Out[24]= |

Pick a non-default uninitialized net:

In[25]:= |

Out[26]= |

Write an evaluation function to scale the result to the input image size and suppress the least probable detections:

In[27]:= |

In[28]:= |

Obtain the detected bounding boxes with their corresponding classes and confidences as well as the locations of human joints for a given image:

In[29]:= |

In[30]:= |

Inspect the prediction keys:

In[31]:= |

Out[31]= |

The "ObjectDetection" key contains the coordinates of the detected objects as well as their confidences and classes:

In[32]:= |

Out[32]= |

The "KeypointEstimation" key contains the locations of the top predicted keypoints:

In[33]:= |

Out[33]= |

The "KeypointConfidence" key contains the confidences for each person’s keypoints:

In[34]:= |

Out[34]= |

Inspect the predicted keypoint locations:

In[35]:= |

Visualize the keypoints:

In[36]:= |

Out[36]= |

Visualize the keypoints grouped by person:

In[37]:= |

Out[37]= |

Visualize the keypoints grouped by a keypoint type:

In[38]:= |

Out[38]= |

Define a function to combine the keypoints into a skeleton shape:

In[39]:= |

Visualize the pose keypoints, object detections and human skeletons:

In[40]:= |

Out[40]= |

The network computes eight thousand four hundred bounding boxes, the position of the keypoints with their probabilities and the probability of an object inside the box:

In[41]:= |

In[42]:= |

Out[42]= |

Rescale the "KeyPoints" to the coordinates of the input image and visualize them scaled and colored by their probability measures:

In[43]:= |

In[44]:= |

Out[44]= |

Overlay the heat map on the image:

In[45]:= |

Out[45]= |

Rescale the bounding boxes to the coordinates of the input image and visualize them scaled by their "Objectness" measures:

In[46]:= |

In[47]:= |

Out[47]= |

Superimpose the predictions on top of the input received by the net:

In[48]:= |

Out[48]= |

Inspect the number of parameters of all arrays in the net:

In[49]:= |

Out[50]= |

Obtain the total number of parameters:

In[51]:= |

Out[52]= |

Obtain the layer type counts:

In[53]:= |

Out[54]= |

Display the summary graphic:

In[55]:= |

Out[56]= |

Export the net to the ONNX format:

In[57]:= |

Out[58]= |

Get the size of the ONNX file:

In[59]:= |

Out[59]= |

The size is similar to the byte count of the resource object:

In[60]:= |

Out[61]= |

Check some metadata of the ONNX model:

In[62]:= |

Out[62]= |

Import the model back into Wolfram Language. However, the NetEncoder and NetDecoder will be absent because they are not supported by ONNX:

In[63]:= |

Out[63]= |

- G. Jocher, A. Chaurasia, J. Qiu, "YOLO by Ultralytics."
- Available from: https://github.com/ultralytics/ultralytics
- Rights: GNU General Public License