Team Ai
Apppublic

ImageProcessing/backend

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
index.py17 linesDownload Raw Back to imageEmbedding
1import pickle
2from torchvision import transforms
3from PIL import Image
4import torch
5import io
6from ImageAndTextEmbedding.index import getImageEmbedding
7
8def get_image_embedding(image_bytes):
9    print("comming 1")
10    return getImageEmbedding(image_bytes)
11
12# Example: Load image data from file and get its embedding
13# image_data = open("pictures/users/2.jpg", "rb").read()
14# embedding = get_image_embedding(image_data)
15# print(embedding)
16
17print("Image embedding model loaded successfully!")