diff --git a/mmpose/datasets/pipelines/bottom_up_transform.py b/mmpose/datasets/pipelines/bottom_up_transform.py index a019d64307..61783a427f 100644 --- a/mmpose/datasets/pipelines/bottom_up_transform.py +++ b/mmpose/datasets/pipelines/bottom_up_transform.py @@ -76,7 +76,7 @@ def _resize_align_multi_scale(image, input_size, current_scale, min_scale): return image_resized, center, scale -class HeatmapGenerator(): +class HeatmapGenerator: """Generate heatmaps for bottom-up models. Args: @@ -126,7 +126,7 @@ def __call__(self, joints): return hms -class JointsEncoder(): +class JointsEncoder: """Encodes the visible joints into (coordinates, score); The coordinate of one joint and its score are of `int` type. diff --git a/mmpose/datasets/pipelines/mesh_transform.py b/mmpose/datasets/pipelines/mesh_transform.py index f17ab5ae40..509145018b 100644 --- a/mmpose/datasets/pipelines/mesh_transform.py +++ b/mmpose/datasets/pipelines/mesh_transform.py @@ -167,7 +167,7 @@ def _flip_joints_3d(joints_3d, joints_3d_visible, flip_pairs): @PIPELINES.register_module() -class LoadIUVFromFile(object): +class LoadIUVFromFile: """Loading IUV image from file.""" def __init__(self, to_float32=False): @@ -195,7 +195,7 @@ def __call__(self, results): @PIPELINES.register_module() -class IUVToTensor(): +class IUVToTensor: """Transform IUV image to part index mask and uv coordinates image. The 3 channels of IUV image means: part index, u coordinates, v coordinates. @@ -222,7 +222,7 @@ def __call__(self, results): @PIPELINES.register_module() -class MeshRandomChannelNoise(): +class MeshRandomChannelNoise: """Data augmentation with random channel noise. Required keys: 'img' @@ -251,7 +251,7 @@ def __call__(self, results): @PIPELINES.register_module() -class MeshRandomFlip(): +class MeshRandomFlip: """Data augmentation with random image flip. Required keys: 'img', 'joints_2d','joints_2d_visible', 'joints_3d', @@ -307,7 +307,7 @@ def __call__(self, results): @PIPELINES.register_module() -class MeshGetRandomScaleRotation(): +class MeshGetRandomScaleRotation: """Data augmentation with random scaling & rotating. Required key: 'scale'. Modifies key: 'scale' and 'rotation'. @@ -343,7 +343,7 @@ def __call__(self, results): @PIPELINES.register_module() -class MeshAffine(): +class MeshAffine: """Affine transform the image to get input image. Affine transform the 2D keypoints, 3D kepoints and IUV image too. diff --git a/mmpose/datasets/pipelines/shared_transform.py b/mmpose/datasets/pipelines/shared_transform.py index 91be1798f3..6d70ce3acf 100644 --- a/mmpose/datasets/pipelines/shared_transform.py +++ b/mmpose/datasets/pipelines/shared_transform.py @@ -8,7 +8,7 @@ @PIPELINES.register_module() -class ToTensor(): +class ToTensor: """Transform image to Tensor. Required key: 'img'. Modifies key: 'img'. @@ -23,7 +23,7 @@ def __call__(self, results): @PIPELINES.register_module() -class NormalizeTensor(): +class NormalizeTensor: """Normalize the Tensor image (CxHxW), with mean and std. Required key: 'img'. Modifies key: 'img'. diff --git a/mmpose/datasets/pipelines/top_down_transform.py b/mmpose/datasets/pipelines/top_down_transform.py index 2a1f678929..c95dd88179 100644 --- a/mmpose/datasets/pipelines/top_down_transform.py +++ b/mmpose/datasets/pipelines/top_down_transform.py @@ -7,7 +7,7 @@ @PIPELINES.register_module() -class TopDownRandomFlip(): +class TopDownRandomFlip: """Data augmentation with random image flip. Required keys: 'img', 'joints_3d', 'joints_3d_visible', 'center' and @@ -46,7 +46,7 @@ def __call__(self, results): @PIPELINES.register_module() -class TopDownHalfBodyTransform(): +class TopDownHalfBodyTransform: """Data augmentation with half-body transform. Keep only the upper body or the lower body at random. @@ -126,7 +126,7 @@ def __call__(self, results): @PIPELINES.register_module() -class TopDownGetRandomScaleRotation(): +class TopDownGetRandomScaleRotation: """Data augmentation with random scaling & rotating. Required key: 'scale'. Modifies key: 'scale' and 'rotation'. @@ -162,7 +162,7 @@ def __call__(self, results): @PIPELINES.register_module() -class TopDownAffine(): +class TopDownAffine: """Affine transform the image to make input. Required keys:'img', 'joints_3d', 'joints_3d_visible', 'ann_info','scale', @@ -198,7 +198,7 @@ def __call__(self, results): @PIPELINES.register_module() -class TopDownGenerateTarget(): +class TopDownGenerateTarget: """Generate the target heatmap. Required keys: 'joints_3d', 'joints_3d_visible', 'ann_info'. diff --git a/tests/test_compose.py b/tests/test_compose.py index f4c858f7f2..d7fcf3bd85 100644 --- a/tests/test_compose.py +++ b/tests/test_compose.py @@ -36,7 +36,7 @@ def test_compose(): # test Compose when forward data is None results = None - class ExamplePipeline(): + class ExamplePipeline: def __call__(self, results): return None