Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

remove redundant variables and lines, fix typos #904

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions maskrcnn_benchmark/structures/keypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def __init__(self, keypoints, size, mode=None):
# in my version this would consistently return a CPU tensor
device = keypoints.device if isinstance(keypoints, torch.Tensor) else torch.device('cpu')
keypoints = torch.as_tensor(keypoints, dtype=torch.float32, device=device)
num_keypoints = keypoints.shape[0]
if num_keypoints:
keypoints = keypoints.view(num_keypoints, -1, 3)
num_persons = keypoints.shape[0]
Johnqczhang marked this conversation as resolved.
Show resolved Hide resolved
if num_persons:
keypoints = keypoints.view(num_persons, -1, 3)

# TODO should I split them?
# self.visibility = keypoints[..., 2]
Expand Down