且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Tensorflow对象检测API中评估预训练模型

更新时间:2023-12-02 18:37:58

您可以通过运行eval.py脚本来评估经过预训练的模型。它将要求您指向一个配置文件(位于 samples / configs 目录中)和一个检查点,为此,您将提供格式为 ... / ... / model.ckpt (删除所有扩展名,例如 .meta .data-00000-of-00001 )。

You can evaluate the pretrained models by running the eval.py script. It will ask you to point to a config file (which will be in the samples/configs directory) and a checkpoint, and for this you will provide a path of the form .../.../model.ckpt (dropping any extensions, like .meta, or .data-00000-of-00001).

您还必须在包含以下内容的目录中创建一个名为 checkpoint的文件您要评估的检查点。然后在该文件中写入以下两行:

You also have to create a file named "checkpoint" inside the directory that contains that checkpoint that you'd like to evaluate. Then inside that file write the following two lines:


model_checkpoint_path: path / to / model.ckpt

all_model_checkpoint_paths: path / to / model.ckpt

model_checkpoint_path: "path/to/model.ckpt"
all_model_checkpoint_paths: "path/to/model.ckpt"

(在其中适当地修改path / to /)

(where you modify path/to/ appropriately)

最后得到的数字是平均精度,使用50%IOU作为真实阳性的截止阈值。这与模型动物园中报告的度量标准略有不同,该模型动物园使用COCO mAP度量标准并对多个IOU值进行平均。

The number that you get at the end is mean Average Precision using 50% IOU as the cutoff threshold for true positives. This is slightly different than the metric that is reported in the model zoo, which uses the COCO mAP metric and averages over multiple IOU values.