【发布时间】:2021-12-25 11:23:50
【问题描述】:
我正在从 this 出色的图像质量评估库运行深度学习推理:
./predict \
--docker-image nima-cpu \
--base-model-name MobileNet \
--weights-file $(pwd)/models/MobileNet/weights_mobilenet_technical_0.11.hdf5 \
--image-source $(pwd)/src/tests/test_images
运行 predict,它是一个 Unix 可执行文件,返回以下示例输出:
[
{
"image_id": "42039",
"mean_score_prediction": 5.154480201676051
},
{
"image_id": "42040",
"mean_score_prediction": 4.297615758532629
},
{
"image_id": "42041",
"mean_score_prediction": 5.450399260735139
},
{
"image_id": "42042",
"mean_score_prediction": 5.163813116261736
},
{
"image_id": "42044",
"mean_score_prediction": 5.728919437354534
}
]
我正在尝试保存这个输出,最好是 json,但不知道如何。附加 --output $(pwd)/src/out.json 或 output 的任何变体不会返回任何内容。
Unix exe 是否有用于导出数据的默认标志?或者有没有办法查看这个exe中的所有标志选项?
【问题讨论】:
标签: python json python-3.x unix save