tensorflow模型.predict()返回类结果。我想将它们缩放为sum %100,
预测功能:img = "./img/hat.jpg"
def predict(img):
img = preprocess_image(img)
pred = model.predict(img)
pred = np.squeeze(pred).astype(float)
print(pred)
return dict(zip(class_names, pred))
输出
{'dress': -1.1803117990493774, 'hat': -3.3129501342773438, 'longsleee': -4.05311393737793, 'outwear': -3.61092472076416, 'pants': -1.313247561454773, 'shirt': -4.622654438018799, 'shoes': 13.270466804504395, 'shorts': -1.8179067373275757, 'skirt': -5.134970188140869, 't-shirt': -2.795290231704712}
我想看看帽子:0.98,鞋子:0.003等等。
1条答案
按热度按时间epfja78i1#
解决了
函数返回的是百分比。