python - TF 对象检测 API - 删除标签和百分比;仅边界框

标签 python tensorflow object-detection-api

我已经训练了自己的模型,它可以检测自定义对象。但我需要一些调整。

如何删除标签和百分比? 示例图像如下所示。我只想显示边界框。

enter image description here

最佳答案

第 190 行:在 /util/visualization.py 内:

for display_str in display_str_list[::-1]:
    text_width, text_height = font.getsize(display_str)
    margin = np.ceil(0.05 * text_height)
    print("\n"+display_str+"\n")
    #draw.rectangle(
        #[(left, text_bottom - text_height - 2 * margin), (left + text_width,
                                                     # text_bottom)],
        #fill=color)
    #draw.text(
    # (left + margin, text_bottom - text_height - margin),
    # display_str,
    # fill='black',
    # font=font)
    text_bottom -= text_height - 2 * margin

您可以注释绘制文本及其周围矩形的线条。

关于python - TF 对象检测 API - 删除标签和百分比;仅边界框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49767131/

相关文章:

Python 模型回调

python - 如何卡住 Resnet50 中的具体层或阶段?

tensorflow - 重新调整 Tensorboard 总结图

python - tensorflow 中的成本函数输出 'nan'

python - 如何在 RelStorage 包中删除 blob?

tensorflow - Keras 中的半监督训练

python - 有什么方法可以仅使用 tensorflow.estimator.train_and_evaluate() 保存最佳模型吗?

python - 如何减少 Tensorflow 的 Object Detection API 中的训练步骤?

python - <Tensorflow 对象检测>TypeError : resize_images() got an unexpected keyword argument 'preserve_aspect_ratio'

python - 迭代两个列表进行过滤