gt_bboxes_list = [[np.zeros((0, 4)) for _ in six.moves.range(n_img)]
for _ in six.moves.range(n_class)]
gt_difficults_list =\
[[np.zeros((0,), dtype=np.bool) for _ in six.moves.range(n_img)]
for _ in six.moves.range(n_class)]
for i in six.moves.range(n_img):
for cls in six.moves.range(n_class):
gt_bboxes_cls = []
gt_difficults_cls = []
for j in six.moves.range(gt_bboxes[i].shape[0]):
if cls == gt_labels[i][j]:
gt_bboxes_cls.append(gt_bboxes[i][j])
if gt_difficults is not None:
gt_difficults_cls.append(gt_difficults[i][j])
else:
gt_difficults_cls.append(
np.array(False, dtype=np.bool))
if len(gt_bboxes_cls) > 0:
gt_bboxes_list[cls][i] = np.stack(gt_bboxes_cls)
gt_difficults_list[cls][i] = np.stack(gt_difficults_cls)
valid_cls[cls] = True
// Accumulate recacall, precison and ap
results = {}