model(**inputs) instead model(img.unsqueeze...)
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ def query_image(img):
|
|
17 |
"""Función para generar predicciones a la escala origina"""
|
18 |
inputs = preprocessor(images=img, return_tensors="pt")
|
19 |
with torch.no_grad():
|
20 |
-
preds = model(inputs.unsqueeze(0).to(device))["logits"]
|
21 |
-
|
22 |
preds_upscale = upscale_logits_modified(preds, image.shape[2])
|
23 |
predict_label = torch.argmax(preds_upscale, dim=1).to(device)
|
24 |
return predict_label[0,:,:].detach().cpu().numpy()
|
|
|
17 |
"""Función para generar predicciones a la escala origina"""
|
18 |
inputs = preprocessor(images=img, return_tensors="pt")
|
19 |
with torch.no_grad():
|
20 |
+
#preds = model(inputs.unsqueeze(0).to(device))["logits"]
|
21 |
+
preds = model(**inputs)["logits"]
|
22 |
preds_upscale = upscale_logits_modified(preds, image.shape[2])
|
23 |
predict_label = torch.argmax(preds_upscale, dim=1).to(device)
|
24 |
return predict_label[0,:,:].detach().cpu().numpy()
|