Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
MiXaiLL76 committed Apr 22, 2024
1 parent 739d1b1 commit 27f5e11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions faster_coco_eval/extra/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ def generate_ann_polygon(
elif iouType == "keypoints":
skeleton = category_id_to_skeleton.get(ann.get("category_id"))
keypoints = ann.get("keypoints")

if (skeleton is None) or (keypoints is None):
return

xyz = np.int0(keypoints).reshape(-1, 3)
ready_bones = {i : True for i in range(xyz.shape[0])}
ready_bones = {i: True for i in range(xyz.shape[0])}
for p1, p2 in skeleton:
if ready_bones.get(p1 - 1, False) and ready_bones.get(p2 - 1, False):
if ready_bones.get(p1 - 1, False) and ready_bones.get(
p2 - 1, False
):
all_x += [xyz[int(p1 - 1), 0], xyz[int(p2 - 1), 0], None]
all_y += [xyz[int(p1 - 1), 1], xyz[int(p2 - 1), 1], None]
else:
raise ValueError()

return go.Scatter(
x=all_x,
y=all_y,
Expand Down
2 changes: 1 addition & 1 deletion faster_coco_eval/extra/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
self.kpt_oks_sigmas = np.array(kpt_oks_sigmas)
else:
self.kpt_oks_sigmas = None

assert self.cocoGt is not None, "cocoGt is empty"

if (self.cocoGt is not None) and (self.cocoDt is not None):
Expand Down

0 comments on commit 27f5e11

Please sign in to comment.