This commit is contained in:
Christopher 2020-11-08 10:23:26 +05:30 committed by GitHub
commit f9a58b2c61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class LandmarkProjectionCalculator : public CalculatorBase {
CollectionItemId input_id = cc->Inputs().BeginId(kLandmarksTag);
CollectionItemId output_id = cc->Outputs().BeginId(kLandmarksTag);
// Number of inputs and outpus is the same according to the contract.
// Number of inputs and outputs is the same according to the contract.
for (; input_id != cc->Inputs().EndId(kLandmarksTag);
++input_id, ++output_id) {
const auto& input_packet = cc->Inputs().Get(input_id);

View File

@ -199,6 +199,9 @@ class NonMaxSuppressionCalculator : public CalculatorBase {
if (options_.return_empty_detections()) {
cc->Outputs().Index(0).Add(new Detections(), cc->InputTimestamp());
}
if (options_.error_on_empty_detections()) {
return ::mediapipe::InternalError("NonMaxSuppression received empty detections, but detections are required for this pipeline.");
}
return ::mediapipe::OkStatus();
}

View File

@ -58,6 +58,9 @@ message NonMaxSuppressionCalculatorOptions {
// Whether to put empty detection vector in output stream.
optional bool return_empty_detections = 5;
// Whether to throw an error on an empty input detection vector
optional bool error_on_empty_detections = 8;
// Algorithms that can be used to apply non-maximum suppression.
enum NmsAlgorithm {
DEFAULT = 0;

View File

@ -123,6 +123,7 @@ node {
min_suppression_threshold: 0.3
overlap_type: INTERSECTION_OVER_UNION
algorithm: WEIGHTED
error_on_empty_detections: true
}
}
}