Spaces:
Sleeping
Sleeping
Omar Alam commited on
Commit ·
4e29c7a
1
Parent(s): e04e07d
Fix embedding funtion
Browse files
app.py
CHANGED
|
@@ -33,11 +33,10 @@ transform = transforms.Compose([
|
|
| 33 |
])
|
| 34 |
|
| 35 |
# Function to extract embedding
|
| 36 |
-
def get_embedding(
|
| 37 |
-
image =
|
| 38 |
-
image = transform(image).unsqueeze(0) # Add batch dimension
|
| 39 |
with torch.no_grad():
|
| 40 |
-
embedding = model(image).squeeze()
|
| 41 |
return embedding.numpy()
|
| 42 |
|
| 43 |
# Prediction function
|
|
|
|
| 33 |
])
|
| 34 |
|
| 35 |
# Function to extract embedding
|
| 36 |
+
def get_embedding(image):
|
| 37 |
+
image = transform(image).unsqueeze(0)
|
|
|
|
| 38 |
with torch.no_grad():
|
| 39 |
+
embedding = model(image).squeeze()
|
| 40 |
return embedding.numpy()
|
| 41 |
|
| 42 |
# Prediction function
|