diff --git a/mediapipe/__pycache__/__init__.cpython-310.pyc b/mediapipe/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 000000000..01f431e0b Binary files /dev/null and b/mediapipe/__pycache__/__init__.cpython-310.pyc differ diff --git a/mediapipe/python/__pycache__/__init__.cpython-310.pyc b/mediapipe/python/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 000000000..2c913aa5f Binary files /dev/null and b/mediapipe/python/__pycache__/__init__.cpython-310.pyc differ diff --git a/mediapipe/python/solution_base.py b/mediapipe/python/solution_base.py index ad57ef07c..54424e280 100644 --- a/mediapipe/python/solution_base.py +++ b/mediapipe/python/solution_base.py @@ -373,17 +373,14 @@ class SolutionBase: # Create a NamedTuple object where the field names are mapping to the graph # output stream names. solution_outputs = collections.namedtuple( - 'SolutionOutputs', self._output_stream_type_info.keys()) + 'SolutionOutputs', self._output_stream_type_info.keys()) + results = solution_outputs(*([""] * len(solution_outputs._fields))) for stream_name in self._output_stream_type_info.keys(): - if stream_name in self._graph_outputs: - setattr( - solution_outputs, stream_name, - self._get_packet_content(self._output_stream_type_info[stream_name], - self._graph_outputs[stream_name])) - else: - setattr(solution_outputs, stream_name, None) - - return solution_outputs + if stream_name in self._graph_outputs: + results = results._replace(**{stream_name: self._get_packet_content( + self._output_stream_type_info[stream_name], self._graph_outputs[stream_name])}) + + return results def close(self) -> None: """Closes all the input sources and the graph."""