如何降低 tfhub 对象检测模型的阈值?

How to lower threshold for tfhub object detection model?

我正在使用来自 model zoo https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md faster_rcnn_inception_resnet_v2_atrous_oidv4

的模型 tensorflow 预训练模型

它工作正常,但我想降低模型的阈值以使其生成更多的 bbox 提案。我怎样才能做到这一点?重新创建图形?

您可以使用 export_inference_graphy.py script.

重新导出它

例如像这样(从 export_inference_graphy.py 脚本复制的示例)将分数阈值从 0.3 降低到 0.1。

python export_inference_graph \
--input_type image_tensor \
--pipeline_config_path path/to/model/pipeline.config \
--trained_checkpoint_prefix path/to/model/model.ckpt \
--output_directory path/to/exported_model_directory \
--config_override " \
        model{ \
          faster_rcnn { \
            second_stage_post_processing { \
              batch_non_max_suppression { \
                score_threshold: 0.1 \
              } \
            } \
          } \
        }"