Skip to content

What is the return of compute_MMR() function in BFJDet/lib/evaluate/compute_MMR.py? #6

@hnuzhy

Description

@hnuzhy

This is the function compute_MMR() called by tools/test.py. It has no return of the final mMR result.

def compute_MMR(json_result_file, anno_file):
    mr_res_dict = OrderedDict()
    iou_type="bbox"
    id_c = 0
    mr_mode = "crowdhuman"
    for id_setup in range(3,4):
        coco_mod_gt = COCO_MD(anno_file)
        coco_mod_dt = coco_mod_gt.loadRes(str(json_result_file))

        imgIds = sorted(coco_mod_gt.getImgIds())
        # imgIds = sorted(iduse)
        coco_mr_eval = COCOMReval(coco_mod_gt, coco_mod_dt, iou_type)
        coco_mr_eval.params.imgIds = imgIds
        coco_mr_eval.evaluate(id_setup)
        coco_mr_eval.accumulate()      
        mean_s = coco_mr_eval.summarize(id_setup) 
        if mr_mode == "crowdhuman":
            if id_c == 0:
                mr_res_dict["Reasonable"] = mean_s
            elif id_c == 1:
                mr_res_dict["Small"] = mean_s
            elif id_c == 2:
                mr_res_dict["Heavy"] = mean_s
            elif id_c == 3:
                mr_res_dict["All"] = mean_s
        elif mr_mode == "citypersons":
            if id_c == 0:
                mr_res_dict["Reasonable"] = mean_s
            elif id_c == 1:
                mr_res_dict["Bare"] = mean_s
            elif id_c == 2:
                mr_res_dict["Partial"] = mean_s
            elif id_c == 3:
                mr_res_dict["Heavy"] = mean_s
        id_c += 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions