Add a test to test saving and loading the gesture recognizer model.

Also update the loss function init method to resolve a bug when loading model.

PiperOrigin-RevId: 482702020
This commit is contained in:
MediaPipe Team 2022-10-20 23:43:28 -07:00 committed by Copybara-Service
parent 086fc442fd
commit 348c4e6652

View File

@ -56,7 +56,7 @@ class FocalLoss(tf.keras.losses.Loss):
class_weight: A weight to apply to the loss, one for each class. The
weight is applied for each input where the ground truth label matches.
"""
super(tf.keras.losses.Loss, self).__init__()
super().__init__()
# Used for clipping min/max values of probability values in y_pred to avoid
# NaNs and Infs in computation.
self._epsilon = 1e-7