【问题标题】:how do I limit my confidence level number to two decimal using python? [duplicate]如何使用 python 将我的置信度数限制为小数点后两位? [复制]
【发布时间】:2020-06-26 22:04:05
【问题描述】:

我正在使用以下代码将置信度写入我的图像

 text1="color is {}".format(f'Class #{i + 1}-{class_names[ind]}-Confidence: {100 * conf}%')

如何将我的置信度数限制为小数点后两位而不是它给出的 10 位左右?

【问题讨论】:

标签: python image image-processing deep-learning


【解决方案1】:

f'{100 * conf:.2f}' 必须工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    • 2023-01-08
    • 1970-01-01
    • 2017-04-01
    • 2021-04-23
    • 2018-03-04
    • 1970-01-01
    相关资源
    最近更新 更多