Internal Changes

PiperOrigin-RevId: 517219631
This commit is contained in:
MediaPipe Team 2023-03-16 13:55:55 -07:00 committed by Copybara-Service
parent a9e956baa1
commit 560945ad39

View File

@ -15,6 +15,7 @@
import io import io
import os import os
import tempfile import tempfile
import unittest
from unittest import mock as unittest_mock from unittest import mock as unittest_mock
import zipfile import zipfile
@ -31,6 +32,7 @@ _TEST_DATA_DIR = 'mediapipe/model_maker/python/vision/gesture_recognizer/testdat
tf.keras.backend.experimental.enable_tf_random_generator() tf.keras.backend.experimental.enable_tf_random_generator()
@unittest.skip('b/273818271')
class GestureRecognizerTest(tf.test.TestCase): class GestureRecognizerTest(tf.test.TestCase):
def _load_data(self): def _load_data(self):
@ -72,8 +74,10 @@ class GestureRecognizerTest(tf.test.TestCase):
self._test_accuracy(model) self._test_accuracy(model)
@unittest.skip('b/273818271')
@unittest_mock.patch.object( @unittest_mock.patch.object(
tf.keras.layers, 'Dense', wraps=tf.keras.layers.Dense) tf.keras.layers, 'Dense', wraps=tf.keras.layers.Dense
)
def test_gesture_recognizer_model_layer_widths(self, mock_dense): def test_gesture_recognizer_model_layer_widths(self, mock_dense):
layer_widths = [64, 32] layer_widths = [64, 32]
mo = gesture_recognizer.ModelOptions(layer_widths=layer_widths) mo = gesture_recognizer.ModelOptions(layer_widths=layer_widths)
@ -143,12 +147,14 @@ class GestureRecognizerTest(tf.test.TestCase):
hyperparameters, hyperparameters,
'HParams', 'HParams',
autospec=True, autospec=True,
return_value=gesture_recognizer.HParams(epochs=1)) return_value=gesture_recognizer.HParams(epochs=1),
)
@unittest_mock.patch.object( @unittest_mock.patch.object(
model_options, model_options,
'GestureRecognizerModelOptions', 'GestureRecognizerModelOptions',
autospec=True, autospec=True,
return_value=gesture_recognizer.ModelOptions()) return_value=gesture_recognizer.ModelOptions(),
)
def test_create_hparams_and_model_options_if_none_in_gesture_recognizer_options( def test_create_hparams_and_model_options_if_none_in_gesture_recognizer_options(
self, mock_hparams, mock_model_options): self, mock_hparams, mock_model_options):
options = gesture_recognizer.GestureRecognizerOptions() options = gesture_recognizer.GestureRecognizerOptions()