Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def preprocess_image(image):
|
|
| 12 |
预处理输入图片
|
| 13 |
"""
|
| 14 |
# 将图片调整为模型所需的输入尺寸
|
| 15 |
-
image = image.resize((
|
| 16 |
# 转换为numpy数组并归一化
|
| 17 |
img_array = np.array(image)
|
| 18 |
img_array = img_array.astype(np.float32) / 255.0
|
|
|
|
| 12 |
预处理输入图片
|
| 13 |
"""
|
| 14 |
# 将图片调整为模型所需的输入尺寸
|
| 15 |
+
image = image.resize((640, 640)) # 根据实际模型需求调整尺寸
|
| 16 |
# 转换为numpy数组并归一化
|
| 17 |
img_array = np.array(image)
|
| 18 |
img_array = img_array.astype(np.float32) / 255.0
|