def METHOD_NAME(output, img, category_file, top_k=5):
    prob = output['prob']
    top_k_idx = np.argsort(-prob.flatten())[:top_k]
    print("top5", top_k_idx)
    print("top5data", prob[0][top_k_idx])
    txt_bk_color = (0, 0, 0)
    txt_color = (255, 255, 255)
    font = cv2.FONT_HERSHEY_DUPLEX
    line_txt = []
    line_txt.append('Top-{:d}'.format(top_k))
    txt_size = cv2.getTextSize(line_txt[0], font, 0.4, 1)[0]
    #text left_bottom
    txt_x0 = 1
    txt_y0 = txt_size[1]
    # rectangle left top
    rect_x0 = 0
    rect_y0 = 0
    # rectangle right bottom
    rect_x1 = txt_size[0] + 2
    rect_y1 = int(1.5 * txt_size[1])
    step = int(1.5 * txt_size[1])
    img = cv2.rectangle(img, (rect_x0, rect_y0), (rect_x1, rect_y1), txt_bk_color, thickness=-1)
    img = cv2.putText(img, line_txt[0], (txt_x0, txt_y0), font, 0.4, txt_color, thickness=1)
    for i in range(top_k):
        line_txt.append(linecache.getline(category_file, top_k_idx[i] + 1).strip('\n'))
        txt_size = cv2.getTextSize(line_txt[i + 1], font, 0.4, 1)[0]
        img = cv2.rectangle(img, (0, rect_y1 + i * step),
                            (txt_size[0] + 2, rect_y1 + (i + 1) * step),
                            txt_bk_color,
                            thickness=-1)
        img = cv2.putText(img,
                          line_txt[i + 1], (1, txt_y0 + (i + 1) * step),
                          font,
                          0.4,
                          txt_color,
                          thickness=1)
    return img