Add comment.

This commit is contained in:
dom607 2020-07-02 15:12:43 +09:00
parent 1641986a7b
commit 74a81c581c
4 changed files with 22 additions and 11 deletions

View File

@ -20,19 +20,28 @@
namespace mediapipe { namespace mediapipe {
// A calculator that count input landmarksList size. // A calculator that counts the size of the input vector. It was created to
// aid in polling packets in the output stream synchronously. If there is
// a clock stream, it will output a value of 0 even if the input vector stream
// is empty. If not, it will output some value only if there is an input vector.
// The clock stream has the same time stamp as the input time stamp, and
// it must be a stream where packets must be transmitted during graph operation.
// (e.g. Any input stream of graph)
// //
// Count input landmark(std::vector<NormalizedLandmarkList>) and return this // It is designed to be used like:
// value to ouput_stream. Input IMAGE has no effect on calculation, but is used to
// ensure that the calculator works even when the landmark is empty. And if the
// input landmark is empty, the number of faces found is zero.
// //
// Example config: // Example config:
// node { // node {
// calculator: "CountingVectorSizeCalculator" // calculator: "CountingWithVectorSizeCalculator"
// input_stream: "IMAGE:input_image" // input_stream: "CLOCK:triger_signal"
// input_stream: "LANDMARKS:multi_face_landmarks" // input_stream: "VECTOR:input_vector"
// output_stream: "COUNT:face_count" // output_stream: "COUNT:vector_count"
// }
//
// node {
// calculator: "CountingWithVectorSizeCalculator"
// input_stream: "VECTOR:input_vector"
// output_stream: "COUNT:vector_count"
// } // }
template <typename VectorT> template <typename VectorT>

View File

@ -27,7 +27,6 @@
#include "mediapipe/framework/port/parse_text_proto.h" #include "mediapipe/framework/port/parse_text_proto.h"
#include "mediapipe/framework/port/status.h" #include "mediapipe/framework/port/status.h"
constexpr char kInputStream[] = "input_video"; constexpr char kInputStream[] = "input_video";
constexpr char kOutputImageStream[] = "output_video"; constexpr char kOutputImageStream[] = "output_video";
constexpr char kOutputFaceCountStream[] = "face_count"; constexpr char kOutputFaceCountStream[] = "face_count";

View File

@ -191,6 +191,8 @@ node {
output_stream: "ITERABLE:multi_face_landmarks" output_stream: "ITERABLE:multi_face_landmarks"
} }
# Counting a multi_faceLandmarks vector size. The image stream is only used to
# make the calculator work even when there is no input vector.
node { node {
calculator: "CountingNormalizedLandmarkListVectorSizeCalculator" calculator: "CountingNormalizedLandmarkListVectorSizeCalculator"
input_stream: "CLOCK:image" input_stream: "CLOCK:image"
@ -198,7 +200,6 @@ node {
output_stream: "COUNT:face_count" output_stream: "COUNT:face_count"
} }
# Collects a NormalizedRect for each face into a vector. Upon receiving the # Collects a NormalizedRect for each face into a vector. Upon receiving the
# BATCH_END timestamp, outputs the vector of NormalizedRect at the BATCH_END # BATCH_END timestamp, outputs the vector of NormalizedRect at the BATCH_END
# timestamp. # timestamp.

View File

@ -191,6 +191,8 @@ node {
output_stream: "ITERABLE:multi_face_landmarks" output_stream: "ITERABLE:multi_face_landmarks"
} }
# Counting a multi_faceLandmarks vector size. The image stream is only used to
# make the calculator work even when there is no input vector.
node { node {
calculator: "CountingNormalizedLandmarkListVectorSizeCalculator" calculator: "CountingNormalizedLandmarkListVectorSizeCalculator"
input_stream: "CLOCK:image" input_stream: "CLOCK:image"