setsosie commited on
Commit
5a71792
·
verified ·
1 Parent(s): a40095e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,10 +20,10 @@ labels = r.text.split("\n")
20
 
21
  # Define prediction function
22
  def predict(img):
23
- # Transform image to pytorch tensor of shape [1, 224, 224, 3]
24
- img = T.ToTensor()(img).unsqueeze(0)
25
- img = T.Resize(size=(224, 224))
26
- print(img.shape)
27
 
28
  # Use model without gradients to reduce computation
29
  with torch.no_grad():
 
20
 
21
  # Define prediction function
22
  def predict(img):
23
+ # Transform image to pytorch tensor of shape [1, 3, 224, 224]
24
+ img = T.PILToTensor()(img).unsqueeze(0)
25
+ img = T.Resize(size=(224, 224))(img)
26
+
27
 
28
  # Use model without gradients to reduce computation
29
  with torch.no_grad():