Alp İpekçiler commited on
Commit
a323602
·
1 Parent(s): b172d89

Fix: Add padding=True to image_processor to handle variable image sizes

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -94,7 +94,7 @@ def predict_pet():
94
 
95
  # Make prediction
96
  import torch
97
- inputs = image_processor(pil_image, return_tensors="pt")
98
 
99
  device = next(model.parameters()).device
100
  inputs = {k: v.to(device) for k, v in inputs.items()}
 
94
 
95
  # Make prediction
96
  import torch
97
+ inputs = image_processor(pil_image, return_tensors="pt", padding=True)
98
 
99
  device = next(model.parameters()).device
100
  inputs = {k: v.to(device) for k, v in inputs.items()}