This will fix multiple typos in the tasks internal files.

PiperOrigin-RevId: 565055843
This commit is contained in:
MediaPipe Team 2023-09-13 08:19:17 -07:00 committed by Copybara-Service
parent a5a3e9d36b
commit 38f421acf0
2 changed files with 14 additions and 14 deletions

View File

@ -113,8 +113,8 @@ class FaceAlignerTest(parameterized.TestCase):
aligner = _FaceAligner.create_from_options(options) aligner = _FaceAligner.create_from_options(options)
# Performs face alignment on the input. # Performs face alignment on the input.
alignd_image = aligner.align(self.test_image) aligned_image = aligner.align(self.test_image)
self.assertIsInstance(alignd_image, _Image) self.assertIsInstance(aligned_image, _Image)
# Closes the aligner explicitly when the aligner is not used in # Closes the aligner explicitly when the aligner is not used in
# a context. # a context.
aligner.close() aligner.close()
@ -144,10 +144,10 @@ class FaceAlignerTest(parameterized.TestCase):
options = _FaceAlignerOptions(base_options=base_options) options = _FaceAlignerOptions(base_options=base_options)
with _FaceAligner.create_from_options(options) as aligner: with _FaceAligner.create_from_options(options) as aligner:
# Performs face alignment on the input. # Performs face alignment on the input.
alignd_image = aligner.align(self.test_image) aligned_image = aligner.align(self.test_image)
self.assertIsInstance(alignd_image, _Image) self.assertIsInstance(aligned_image, _Image)
self.assertEqual(alignd_image.width, _MODEL_IMAGE_SIZE) self.assertEqual(aligned_image.width, _MODEL_IMAGE_SIZE)
self.assertEqual(alignd_image.height, _MODEL_IMAGE_SIZE) self.assertEqual(aligned_image.height, _MODEL_IMAGE_SIZE)
def test_align_succeeds_with_region_of_interest(self): def test_align_succeeds_with_region_of_interest(self):
base_options = _BaseOptions(model_asset_path=self.model_path) base_options = _BaseOptions(model_asset_path=self.model_path)
@ -163,10 +163,10 @@ class FaceAlignerTest(parameterized.TestCase):
roi = _Rect(left=0.32, top=0.02, right=0.67, bottom=0.32) roi = _Rect(left=0.32, top=0.02, right=0.67, bottom=0.32)
image_processing_options = _ImageProcessingOptions(roi) image_processing_options = _ImageProcessingOptions(roi)
# Performs face alignment on the input. # Performs face alignment on the input.
alignd_image = aligner.align(test_image, image_processing_options) aligned_image = aligner.align(test_image, image_processing_options)
self.assertIsInstance(alignd_image, _Image) self.assertIsInstance(aligned_image, _Image)
self.assertEqual(alignd_image.width, _MODEL_IMAGE_SIZE) self.assertEqual(aligned_image.width, _MODEL_IMAGE_SIZE)
self.assertEqual(alignd_image.height, _MODEL_IMAGE_SIZE) self.assertEqual(aligned_image.height, _MODEL_IMAGE_SIZE)
def test_align_succeeds_with_no_face_detected(self): def test_align_succeeds_with_no_face_detected(self):
base_options = _BaseOptions(model_asset_path=self.model_path) base_options = _BaseOptions(model_asset_path=self.model_path)
@ -182,8 +182,8 @@ class FaceAlignerTest(parameterized.TestCase):
roi = _Rect(left=0.1, top=0.1, right=0.2, bottom=0.2) roi = _Rect(left=0.1, top=0.1, right=0.2, bottom=0.2)
image_processing_options = _ImageProcessingOptions(roi) image_processing_options = _ImageProcessingOptions(roi)
# Performs face alignment on the input. # Performs face alignment on the input.
alignd_image = aligner.align(test_image, image_processing_options) aligned_image = aligner.align(test_image, image_processing_options)
self.assertIsNone(alignd_image) self.assertIsNone(aligned_image)
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -51,7 +51,7 @@ const POSE_LANDMARKER_GRAPH =
const DEFAULT_NUM_POSES = 1; const DEFAULT_NUM_POSES = 1;
const DEFAULT_SCORE_THRESHOLD = 0.5; const DEFAULT_SCORE_THRESHOLD = 0.5;
const DEFAULT_OUTPUT_SEGMANTATION_MASKS = false; const DEFAULT_OUTPUT_SEGMENTATION_MASKS = false;
/** /**
* A callback that receives the result from the pose detector. The returned * A callback that receives the result from the pose detector. The returned
@ -201,7 +201,7 @@ export class PoseLandmarker extends VisionTaskRunner {
if ('outputSegmentationMasks' in options) { if ('outputSegmentationMasks' in options) {
this.outputSegmentationMasks = this.outputSegmentationMasks =
options.outputSegmentationMasks ?? DEFAULT_OUTPUT_SEGMANTATION_MASKS; options.outputSegmentationMasks ?? DEFAULT_OUTPUT_SEGMENTATION_MASKS;
} }
return this.applyOptions(options); return this.applyOptions(options);