未验证 提交 32abf1a0 编写于 作者: G Guanghua Yu 提交者: GitHub

Remove redundant func in json_results (#3284)

上级 12ae16e4
...@@ -55,31 +55,7 @@ def get_det_poly_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0): ...@@ -55,31 +55,7 @@ def get_det_poly_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0):
num_id, score, x1, y1, x2, y2, x3, y3, x4, y4 = dt.tolist() num_id, score, x1, y1, x2, y2, x3, y3, x4, y4 = dt.tolist()
if int(num_id) < 0: if int(num_id) < 0:
continue continue
category_id = int(num_id) category_id = label_to_cat_id_map[int(num_id)]
rbox = [x1, y1, x2, y2, x3, y3, x4, y4]
dt_res = {
'image_id': cur_image_id,
'category_id': category_id,
'bbox': rbox,
'score': score
}
det_res.append(dt_res)
return det_res
def get_det_poly_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0):
det_res = []
k = 0
for i in range(len(bbox_nums)):
cur_image_id = int(image_id[i][0])
det_nums = bbox_nums[i]
for j in range(det_nums):
dt = bboxes[k]
k = k + 1
num_id, score, x1, y1, x2, y2, x3, y3, x4, y4 = dt.tolist()
if int(num_id) < 0:
continue
category_id = int(num_id)
rbox = [x1, y1, x2, y2, x3, y3, x4, y4] rbox = [x1, y1, x2, y2, x3, y3, x4, y4]
dt_res = { dt_res = {
'image_id': cur_image_id, 'image_id': cur_image_id,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册