Slide 11
Slide 11 text
推論を試すコードの例
def preprocess(image):
:
def predict(image):
:
if __name__ == '__main__':
image = Image.open('img.png')
input = preprocess(image)
result = predict(input)
print(result)
$ python predict.py
{0: 7.521442603319883e-05,
1: 3.361938283319432e-08,
2: 0.0035780637990683317,
3: 0.015945233404636383,
4: 0.000655908661428839,
5: 0.9408522248268127,
6: 0.004209722392261028,
7: 8.856286513037048e-06,
8: 0.024534041061997414,
9: 0.010140744037926197}
predict.py 実行
このように、python コマンドで推論を試すコードは、
書いたことがある人も少なくないと思います