Update app.py
Browse files
app.py
CHANGED
|
@@ -13,12 +13,10 @@ def predict(image):
|
|
| 13 |
image_features = model.encode_image(image)
|
| 14 |
image_features /= image_features.norm(dim=-1, keepdim=True)
|
| 15 |
|
| 16 |
-
embedding = image_features[0]
|
| 17 |
-
print(embedding)
|
| 18 |
|
| 19 |
model = joblib.load('model.pkl')
|
| 20 |
result = model.predict([embedding])
|
| 21 |
-
print(result)
|
| 22 |
|
| 23 |
return "Map" if result == 1 else "No map"
|
| 24 |
|
|
|
|
| 13 |
image_features = model.encode_image(image)
|
| 14 |
image_features /= image_features.norm(dim=-1, keepdim=True)
|
| 15 |
|
| 16 |
+
embedding = image_features[0].cpu().float().numpy()
|
|
|
|
| 17 |
|
| 18 |
model = joblib.load('model.pkl')
|
| 19 |
result = model.predict([embedding])
|
|
|
|
| 20 |
|
| 21 |
return "Map" if result == 1 else "No map"
|
| 22 |
|