alkzar90 commited on
Commit
11b107f
1 Parent(s): 93c96fe

model(**inputs) instead model(img.unsqueeze...)

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- #preds = model(image.unsqueeze(0).to(device))["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()
 
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()