MCPcopy Create free account
hub / github.com/3DAnimals/3DAnimals / load_pascal_annotations

Function load_pascal_annotations

evaluation/evaluate.py:155–171  ·  view source on GitHub ↗
(pascal_annotations_path)

Source from the content-addressed store, hash-verified

153
154
155def load_pascal_annotations(pascal_annotations_path):
156 anno = sio.loadmat(
157 pascal_annotations_path, struct_as_record=False, squeeze_me=True
158 )["images"]
159 parsed = {}
160 for sample in anno:
161 name = sample.rel_path[:-4] + f"_{sample.voc_rec_id}"
162 box = [
163 sample.bbox.x1,
164 sample.bbox.y1,
165 sample.bbox.x2 - sample.bbox.x1,
166 sample.bbox.y2 - sample.bbox.y1,
167 ]
168 kp = sample.parts[:2].transpose()
169 visible = sample.parts[2]
170 parsed[name] = {"box": box, "kp": kp, "visible": visible}
171 return parsed
172
173
174def crop_keypoints(kp, name, data_dir, box_postfix):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected