The Keypoints
class works with Darknet's V3 API.
More...
#include "darknet_keypoints.hpp"
Public Member Functions | |
Keypoints ()=delete | |
Keypoints (const Darknet::NetworkPtr ptr) | |
Constructor needs a neural network pointer. | |
~Keypoints () | |
Destructor. | |
cv::Mat | annotate (const Predictions &predictions, const Skeletons &skeletons, cv::Mat mat) |
Draw the skeletons onto the given image. | |
cv::Mat | annotate (const Predictions &predictions, cv::Mat mat) |
Similar to the other annotate() method, but automatically calls create_skeletons(). | |
Skeletons | create_skeletons (const Predictions &predictions) |
Looks through the prediction results and attempts to organize each person into Skeleton. | |
VStr | names () |
Return the set of names for the classes in Keypoints . | |
Public Attributes | |
int | circle_size |
Size of circles used to draw keypoints. | |
bool | draw_keypoints |
Draw a circle above each detected keypoint. | |
bool | draw_labels |
Draw the labels beside each keypoint. | |
bool | draw_skeleton |
Draw the skeletons joining each keypoint. | |
int | line_size |
Size of lines used to draw skeletons. | |
Private Attributes | |
const Darknet::NetworkPtr | network_ptr |
The Keypoints
class works with Darknet's V3 API.
The only format currently supported is the MSCOCO-style keypoint classes with an extra "person" class appended for top-down grouping. The classes are defined as follows:
|
delete |
Darknet::Keypoints::Keypoints | ( | const Darknet::NetworkPtr | ptr | ) |
Darknet::Keypoints::~Keypoints | ( | ) |
Destructor.
cv::Mat Darknet::Keypoints::annotate | ( | const Predictions & | predictions, |
const Skeletons & | skeletons, | ||
cv::Mat | mat | ||
) |
Draw the skeletons onto the given image.
cv::Mat Darknet::Keypoints::annotate | ( | const Predictions & | predictions, |
cv::Mat | mat | ||
) |
Similar to the other annotate() method, but automatically calls create_skeletons().
Darknet::Skeletons Darknet::Keypoints::create_skeletons | ( | const Predictions & | predictions | ) |
Looks through the prediction results and attempts to organize each person into Skeleton.
A skeleton will always contain exactly 18 indexes. If a skeleton does not have an entry for a body part, then the index will be set to -1
. Otherwise, any other values is interpreted as an index into predictions
.
Darknet::VStr Darknet::Keypoints::names | ( | ) |
Return the set of names for the classes in Keypoints
.
int Darknet::Keypoints::circle_size |
Size of circles used to draw keypoints.
draw_keypoints
must also be set to true
. Default value is 6
.
bool Darknet::Keypoints::draw_keypoints |
Draw a circle above each detected keypoint.
Default value is true
.
bool Darknet::Keypoints::draw_labels |
Draw the labels beside each keypoint.
Default value is false
.
bool Darknet::Keypoints::draw_skeleton |
int Darknet::Keypoints::line_size |
Size of lines used to draw skeletons.
draw_skeleton
must also be set to true
. Default value is 3
.
|
private |