Spaces:
Sleeping
Sleeping
File size: 496 Bytes
bbcc5b2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import pickle
from torchvision import transforms
from PIL import Image
import torch
import io
from utils.ImageAndTextEmbedding.index import getImageEmbedding
def get_image_embedding(image_bytes):
print("comming 1")
return getImageEmbedding(image_bytes)
# Example: Load image data from file and get its embedding
# image_data = open("pictures/users/2.jpg", "rb").read()
# embedding = get_image_embedding(image_data)
# print(embedding)
print("Image embedding model loaded successfully!") |