diff --git a/mmpose/datasets/pipelines/bottom_up_transform.py b/mmpose/datasets/pipelines/bottom_up_transform.py index 2cec1be4d3..89e31a8397 100644 --- a/mmpose/datasets/pipelines/bottom_up_transform.py +++ b/mmpose/datasets/pipelines/bottom_up_transform.py @@ -165,8 +165,8 @@ def __call__(self, joints): tot = 0 for idx, pt in enumerate(joints[i]): x, y = int(pt[0]), int(pt[1]) - if (pt[2] > 0 and x >= 0 and y >= 0 and x < self.output_res - and y < self.output_res): + if (pt[2] > 0 and 0 <= y < self.output_res + and 0 <= x < self.output_res): if self.tag_per_joint: visible_kpts[i][tot] = \ (idx * output_res**2 + y * output_res + x, 1) diff --git a/mmpose/models/backbones/regnet.py b/mmpose/models/backbones/regnet.py index 24825bcd41..f5fcf74de0 100644 --- a/mmpose/models/backbones/regnet.py +++ b/mmpose/models/backbones/regnet.py @@ -132,7 +132,7 @@ def __init__(self, self.stem_channels = stem_channels self.base_channels = base_channels self.num_stages = num_stages - assert num_stages >= 1 and num_stages <= 4 + assert 1 <= num_stages <= 4 self.strides = strides self.dilations = dilations assert len(strides) == len(dilations) == num_stages diff --git a/mmpose/models/backbones/resnet.py b/mmpose/models/backbones/resnet.py index 14f2e80cc1..f6a5bb74c6 100644 --- a/mmpose/models/backbones/resnet.py +++ b/mmpose/models/backbones/resnet.py @@ -500,7 +500,7 @@ def __init__(self, self.stem_channels = stem_channels self.base_channels = base_channels self.num_stages = num_stages - assert num_stages >= 1 and num_stages <= 4 + assert 1 <= num_stages <= 4 self.strides = strides self.dilations = dilations assert len(strides) == len(dilations) == num_stages