Skip to content

Commit e8fc7b3

Browse files
committed
save results to a json file
1 parent bd3c7f1 commit e8fc7b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

demo.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# import the necessary packages
2+
import json
23
import os
34
import random
45

@@ -39,4 +40,8 @@
3940
results.append({'label': class_names[class_id][0][0], 'prob': '{:.4}'.format(prob)})
4041
cv.imwrite('images/{}_out.png'.format(i), bgr_img)
4142

43+
print(results)
44+
with open('results.json', 'w') as file:
45+
json.dump(results, file)
46+
4247
K.clear_session()

0 commit comments

Comments
 (0)