Closed xurc closed 1 year ago
Hi.
I read the documentation, but I still don’t understand, can I reproduce such logic using this library? Is there access to Embedder API here? Or some other way to calculate the difference between images.
from tflite_support.task import vision # Initialization. image_embedder = vision.ImageEmbedder.create_from_file('feature_vector_metadata_1.tflite') # Run inference on two images. image_1 = vision.TensorImage.create_from_file('same1.jpg') result_1 = image_embedder.embed(image_1) image_2 = vision.TensorImage.create_from_file('same2.jpg') result_2 = image_embedder.embed(image_2) # Compute cosine similarity. feature_vector_1 = result_1.embeddings[0].feature_vector feature_vector_2 = result_2.embeddings[0].feature_vector similarity = image_embedder.cosine_similarity(feature_vector_1, feature_vector_2) print(similarity)
https://github.com/tensorflow/flutter-tflite/issues/32
Hi.
I read the documentation, but I still don’t understand, can I reproduce such logic using this library? Is there access to Embedder API here? Or some other way to calculate the difference between images.