MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / load_gt_boxes

Method load_gt_boxes

PATH/core/solvers/utils/peddet_tester_dev.py:386–414  ·  view source on GitHub ↗
(self, dict_input, key_name, class_names)

Source from the content-addressed store, hash-verified

384 self.gtboxes = _clip_boundary(self.gtboxes, self._height, self._width)
385
386 def load_gt_boxes(self, dict_input, key_name, class_names):
387 assert key_name in dict_input
388 if len(dict_input[key_name]) < 1:
389 return np.empty([0, 5]), np.empty([0, 5])
390 head_bbox = []
391 body_bbox = []
392 for rb in dict_input[key_name]:
393 if rb['tag'] in class_names:
394 body_tag = class_names.index(rb['tag'])
395 head_tag = 1
396 else:
397 body_tag = -1
398 head_tag = -1
399 if 'extra' in rb:
400 if 'ignore' in rb['extra']:
401 if rb['extra']['ignore'] != 0:
402 body_tag = -1
403 head_tag = -1
404 if 'head_attr' in rb:
405 if 'ignore' in rb['head_attr']:
406 if rb['head_attr']['ignore'] != 0:
407 head_tag = -1
408 # head_bbox.append(np.hstack((rb['hbox'], head_tag)))
409 body_bbox.append((*rb['fbox'], body_tag))
410 # head_bbox = np.array(head_bbox)
411 # head_bbox[:, 2:4] += head_bbox[:, :2]
412 body_bbox = np.array(body_bbox)
413 body_bbox[:, 2:4] += body_bbox[:, :2]
414 return body_bbox, head_bbox
415
416 def load_det_boxes(self, dict_input, key_name, key_box, key_score=None, key_tag=None):
417 assert key_name in dict_input

Callers 1

loadMethod · 0.95

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected