(self, fpath, body_key=None, head_key=None, if_gt=True)
| 497 | self.scorelist = None |
| 498 | |
| 499 | def loadData(self, fpath, body_key=None, head_key=None, if_gt=True): |
| 500 | # assert os.path.isfile(fpath), fpath + " does not exist!" |
| 501 | with PetrelHelper.open(fpath) as f: |
| 502 | # with open(fpath, "r") as f: |
| 503 | lines = [] |
| 504 | for line in f: |
| 505 | lines.append(line) |
| 506 | records = [json.loads(line.strip('\n')) for line in lines] |
| 507 | if if_gt: |
| 508 | records = records[0] |
| 509 | for record in records: |
| 510 | self.images[record["ID"]] = Image(self.eval_mode) |
| 511 | self.images[record["ID"]].load(record, body_key, head_key, PERSON_CLASSES, True) |
| 512 | else: |
| 513 | for record in records: |
| 514 | self.images[record["ID"]].load(record, body_key, head_key, PERSON_CLASSES, False) |
| 515 | self.images[record["ID"]].clip_all_boader() |
| 516 | |
| 517 | def compare(self, thres=0.5, matching=None): |
| 518 | """ |
no test coverage detected