Spaces:
Sleeping
Sleeping
import requests | |
import tensorflow as tf | |
# URL of the model file | |
url = "https://storage.googleapis.com/mediapipe-models/interactive_segmenter/magic_touch/float32/1/magic_touch.tflite" | |
# Send a HTTP request to the URL of the file, get is a method that sends a HTTP request to the server and fetches the response | |
response = requests.get(url) | |
# Write the response content to a file | |
with open('model.tflite', 'wb') as f: | |
f.write(response.content) | |
# Load the TFLite model | |
interpreter = tf.lite.Interpreter(model_path="model.tflite") | |
interpreter.allocate_tensors() |