def name_parser(name):
    """Parse image names that are in the following format:

        {RANK}_{IMAGE_IDX}_{BOX_PAIR_IDX}_{LABEL}_{SCORE}.png
    """
    seg = name.split("_")
    sample_type = "Positive" if int(seg[3]) else "Negative"

    return "Rank: {} ".format(seg[0]) + sample_type \
        + "<br>Image: {}, Pair: {}<br>".format(seg[1], seg[2]) \
        + "Score: {}".format(seg[4][:-4])