Skip to content

Commit

Permalink
`Update Readme.md to match code changes in test data loading and mode…
Browse files Browse the repository at this point in the history
…l evaluation`
  • Loading branch information
ctkqiang committed Feb 3, 2025
1 parent 2a6c66e commit 2fe9492
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ from sklearn.metrics import classification_report
# 加载测试数据

test_generator = val_datagen.flow_from_directory(
"images/test",
target_size=img_size,
batch_size=batch_size,
class_mode="categorical",
shuffle=False
"images/test",
target_size=img_size,
batch_size=batch_size,
class_mode="categorical",
shuffle=False
)

# 评估模型
Expand All @@ -248,6 +248,7 @@ img_array = tf.keras.preprocessing.image.img_to_array(img)
img_array = tf.expand_dims(img_array, 0) # 添加批次维度

predictions = model.predict(img_array)

print(f"预测结果: {predictions}")
```

Expand Down

0 comments on commit 2fe9492

Please sign in to comment.