Merge pull request #4263 from kinaryml:face-stylizer-python-tests

PiperOrigin-RevId: 523152290
This commit is contained in:
Copybara-Service 2023-04-10 10:39:50 -07:00
commit b685f53c6b

View File

@ -183,7 +183,8 @@ class FaceStylizer(base_vision_task_api.BaseVisionTaskApi):
ValueError: If any of the input arguments is invalid. ValueError: If any of the input arguments is invalid.
RuntimeError: If face stylization failed to run. RuntimeError: If face stylization failed to run.
""" """
normalized_rect = self.convert_to_normalized_rect(image_processing_options) normalized_rect = self.convert_to_normalized_rect(
image_processing_options, image)
output_packets = self._process_image_data({ output_packets = self._process_image_data({
_IMAGE_IN_STREAM_NAME: packet_creator.create_image(image), _IMAGE_IN_STREAM_NAME: packet_creator.create_image(image),
_NORM_RECT_STREAM_NAME: packet_creator.create_proto( _NORM_RECT_STREAM_NAME: packet_creator.create_proto(
@ -221,7 +222,8 @@ class FaceStylizer(base_vision_task_api.BaseVisionTaskApi):
ValueError: If any of the input arguments is invalid. ValueError: If any of the input arguments is invalid.
RuntimeError: If face stylization failed to run. RuntimeError: If face stylization failed to run.
""" """
normalized_rect = self.convert_to_normalized_rect(image_processing_options) normalized_rect = self.convert_to_normalized_rect(
image_processing_options, image)
output_packets = self._process_video_data({ output_packets = self._process_video_data({
_IMAGE_IN_STREAM_NAME: packet_creator.create_image(image).at( _IMAGE_IN_STREAM_NAME: packet_creator.create_image(image).at(
timestamp_ms * _MICRO_SECONDS_PER_MILLISECOND timestamp_ms * _MICRO_SECONDS_PER_MILLISECOND
@ -268,7 +270,8 @@ class FaceStylizer(base_vision_task_api.BaseVisionTaskApi):
ValueError: If the current input timestamp is smaller than what the face ValueError: If the current input timestamp is smaller than what the face
stylizer has already processed. stylizer has already processed.
""" """
normalized_rect = self.convert_to_normalized_rect(image_processing_options) normalized_rect = self.convert_to_normalized_rect(
image_processing_options, image)
self._send_live_stream_data({ self._send_live_stream_data({
_IMAGE_IN_STREAM_NAME: packet_creator.create_image(image).at( _IMAGE_IN_STREAM_NAME: packet_creator.create_image(image).at(
timestamp_ms * _MICRO_SECONDS_PER_MILLISECOND timestamp_ms * _MICRO_SECONDS_PER_MILLISECOND