Open FakerYFX opened 6 years ago
@mjq11302010044 if the CLASSES = ('chinese', 'japenese',"English","germany"),I want to get the different class's result, how can I modify the code below: //Visualize detections for each class CONF_THRESH = conf NMS_THRESH = 0.3 for cls_ind, cls in enumerate(CLASSES[1:]): cls_ind += 1 # because we skipped background cls_boxes = boxes[:, 5 cls_ind:5 (cls_ind + 1)] # D cls_scores = scores[:, cls_ind] dets = np.hstack((cls_boxes, cls_scores[:, np.newaxis])).astype(np.float32) keep = rotate_gpu_nms(dets, NMS_THRESH) # D dets = dets[keep, :] //dets = dets[0:20] //dets[:, 4] = dets[:, 4] * 0.45 dets[:, 2] = dets[:, 2] / cfg.TEST.GT_MARGIN dets[:, 3] = dets[:, 3] / cfg.TEST.GT_MARGIN results = write_result_ICDAR( im_file, dets, CONF_THRESH, result_dir, im_height, im_width) return results
Better to use a for loop to get predictions of different classes according to the bbox score
@mjq11302010044 if the CLASSES = ('chinese', 'japenese',"English","germany"),I want to get the different class's result, how can I modify the code below: //Visualize detections for each class CONF_THRESH = conf NMS_THRESH = 0.3 for cls_ind, cls in enumerate(CLASSES[1:]): cls_ind += 1 # because we skipped background cls_boxes = boxes[:, 5 cls_ind:5 (cls_ind + 1)] # D cls_scores = scores[:, cls_ind] dets = np.hstack((cls_boxes, cls_scores[:, np.newaxis])).astype(np.float32) keep = rotate_gpu_nms(dets, NMS_THRESH) # D dets = dets[keep, :] //dets = dets[0:20] //dets[:, 4] = dets[:, 4] * 0.45 dets[:, 2] = dets[:, 2] / cfg.TEST.GT_MARGIN dets[:, 3] = dets[:, 3] / cfg.TEST.GT_MARGIN results = write_result_ICDAR( im_file, dets, CONF_THRESH, result_dir, im_height, im_width) return results