提交 f3f1c989 编写于 作者: D dongshuilong

fix yaml bugs

上级 fa2b698a
...@@ -148,9 +148,9 @@ Infer: ...@@ -148,9 +148,9 @@ Infer:
Metric: Metric:
Train: Train:
- Topk: - TopkAcc:
k: [1, 5] topk: [1, 5]
Eval: Eval:
- Topk: - TopkAcc:
k: [1, 5] topk: [1, 5]
...@@ -147,7 +147,7 @@ Metric: ...@@ -147,7 +147,7 @@ Metric:
Eval: Eval:
- Recallk: - Recallk:
topk: [1, 5] topk: [1, 5]
- mAP: - mAP: {}
Infer: Infer:
infer_imgs: "docs/images/whl/demo.jpg" infer_imgs: "docs/images/whl/demo.jpg"
......
...@@ -39,9 +39,8 @@ class TopkAcc(nn.Layer): ...@@ -39,9 +39,8 @@ class TopkAcc(nn.Layer):
class mAP(nn.Layer): class mAP(nn.Layer):
def __init__(self, name="mAP"): def __init__(self):
super().__init__() super().__init__()
self.name = name
def forward(self, similarities_matrix, query_img_id, gallery_img_id): def forward(self, similarities_matrix, query_img_id, gallery_img_id):
metric_dict = dict() metric_dict = dict()
...@@ -49,14 +48,13 @@ class mAP(nn.Layer): ...@@ -49,14 +48,13 @@ class mAP(nn.Layer):
gallery_img_id) gallery_img_id)
mAP = np.mean(all_AP) mAP = np.mean(all_AP)
metric_dict[self.name] = mAP metric_dict["mAP"] = mAP
return metric_dict return metric_dict
class mINP(nn.Layer): class mINP(nn.Layer):
def __init__(self, name="mINP"): def __init__(self):
super().__init__() super().__init__()
self.name = name
def forward(self, similarities_matrix, query_img_id, gallery_img_id): def forward(self, similarities_matrix, query_img_id, gallery_img_id):
metric_dict = dict() metric_dict = dict()
...@@ -64,7 +62,7 @@ class mINP(nn.Layer): ...@@ -64,7 +62,7 @@ class mINP(nn.Layer):
gallery_img_id) gallery_img_id)
mINP = np.mean(all_INP) mINP = np.mean(all_INP)
metric_dict[self.name] = mINP metric_dict["mINP"] = mINP
return metric_dict return metric_dict
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册