Spaces:
Runtime error
Runtime error
AnishKumbhar
commited on
Commit
•
673a00c
1
Parent(s):
302c39e
Update app.py
Browse files
app.py
CHANGED
@@ -28,6 +28,7 @@ def preprocess_input(input: fastapi.UploadFile):
|
|
28 |
image = Image.open(input.file)
|
29 |
image = image.resize((224, 224)).convert("RGB")
|
30 |
input = np.array(image)
|
|
|
31 |
input = torch.from_numpy(input).float()
|
32 |
input = input.unsqueeze(0)
|
33 |
return input
|
|
|
28 |
image = Image.open(input.file)
|
29 |
image = image.resize((224, 224)).convert("RGB")
|
30 |
input = np.array(image)
|
31 |
+
input = np.transpose(input, (2, 0, 1))
|
32 |
input = torch.from_numpy(input).float()
|
33 |
input = input.unsqueeze(0)
|
34 |
return input
|