Commit
•
ae5b375
1
Parent(s):
72ed04a
Bugfix (#1)
Browse files- Bugfix (53110df792b29c4eb9b49878c832bb60403fd9bd)
Co-authored-by: Smiling Wolf <[email protected]>
app.py
CHANGED
@@ -32,6 +32,10 @@ def prepare_image(image: Image.Image, target_size: int):
|
|
32 |
# Convert to numpy array
|
33 |
# Based on the ONNX graph, the model appears to expect inputs in the range of 0-255
|
34 |
image_array = np.asarray(padded_image, dtype=np.float32)
|
|
|
|
|
|
|
|
|
35 |
return np.expand_dims(image_array, axis=0)
|
36 |
|
37 |
|
|
|
32 |
# Convert to numpy array
|
33 |
# Based on the ONNX graph, the model appears to expect inputs in the range of 0-255
|
34 |
image_array = np.asarray(padded_image, dtype=np.float32)
|
35 |
+
|
36 |
+
# Convert PIL-native RGB to BGR
|
37 |
+
image_array = image_array[:, :, ::-1]
|
38 |
+
|
39 |
return np.expand_dims(image_array, axis=0)
|
40 |
|
41 |
|