Inverted condition check in MPPTaskInfo

This commit is contained in:
Prianka Liz Kariat 2022-12-22 12:16:33 +05:30
parent e47256ae55
commit 613ed58890

View File

@ -24,9 +24,9 @@
namespace { namespace {
using CalculatorGraphConfig = ::mediapipe::CalculatorGraphConfig; using CalculatorGraphConfig = ::mediapipe::CalculatorGraphConfig;
using Node = ::mediapipe::CalculatorGraphConfig::Node; using Node = ::mediapipe::CalculatorGraphConfig::Node;
using ::mediapipe::InputStreamInfo;
using ::mediapipe::CalculatorOptions; using ::mediapipe::CalculatorOptions;
using ::mediapipe::FlowLimiterCalculatorOptions; using ::mediapipe::FlowLimiterCalculatorOptions;
using ::mediapipe::InputStreamInfo;
} // namespace } // namespace
@implementation MPPTaskInfo @implementation MPPTaskInfo
@ -82,7 +82,15 @@ using ::mediapipe::FlowLimiterCalculatorOptions;
graph_config.add_output_stream(cpp_output_stream); graph_config.add_output_stream(cpp_output_stream);
} }
if (self.enableFlowLimiting) { if (!self.enableFlowLimiting) {
for (NSString *inputStream in self.inputStreams) {
auto cpp_input_stream = inputStream.cppString;
task_subgraph_node->add_input_stream(cpp_input_stream);
graph_config.add_input_stream(cpp_input_stream);
}
return graph_config;
}
Node *flow_limit_calculator_node = graph_config.add_node(); Node *flow_limit_calculator_node = graph_config.add_node();
flow_limit_calculator_node->set_calculator("FlowLimiterCalculator"); flow_limit_calculator_node->set_calculator("FlowLimiterCalculator");
@ -113,13 +121,6 @@ using ::mediapipe::FlowLimiterCalculatorOptions;
NSString *firstOutputStream = self.outputStreams[0]; NSString *firstOutputStream = self.outputStreams[0];
auto finished_output_stream = "FINISHED:" + firstOutputStream.cppString; auto finished_output_stream = "FINISHED:" + firstOutputStream.cppString;
flow_limit_calculator_node->add_input_stream(finished_output_stream); flow_limit_calculator_node->add_input_stream(finished_output_stream);
} else {
for (NSString *inputStream in self.inputStreams) {
auto cpp_input_stream = inputStream.cppString;
task_subgraph_node->add_input_stream(cpp_input_stream);
graph_config.add_input_stream(cpp_input_stream);
}
}
return graph_config; return graph_config;
} }