Skip to content

Commit

Permalink
Create export_face_landmark.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyByansi authored Aug 3, 2024
1 parent 34f03db commit d35d29d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions official/vision/serving/export_face_landmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import tensorflow as tf

def convert_tflite_to_pb(tflite_model_path, pb_model_path):
# Load the TFLite model
with open(tflite_model_path, 'rb') as f:
tflite_model = f.read()

# Convert the TFLite model to a TensorFlow model
converter = tf.lite.TFLiteConverter.from_saved_model(tflite_model)
tf_model = converter.convert()

# Save the TensorFlow model as a .pb file
tf.saved_model.save(tf_model, pb_model_path)

if __name__ == "__main__":
tflite_model_path = "face_landmark.tflite"
pb_model_path = "face_landmark.pb"
convert_tflite_to_pb(tflite_model_path, pb_model_path)

0 comments on commit d35d29d

Please sign in to comment.