easycv.datasets.pose.data_sources package

class easycv.datasets.pose.data_sources.PoseTopDownSourceCoco(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

CocoSource for top-down pose estimation.

Microsoft COCO: Common Objects in Context’ ECCV’2014 More details can be found in the `paper .

The source loads raw features to build a data meta object containing the image info, annotation info and others.

COCO keypoint indexes:

0: 'nose',
1: 'left_eye',
2: 'right_eye',
3: 'left_ear',
4: 'right_ear',
5: 'left_shoulder',
6: 'right_shoulder',
7: 'left_elbow',
8: 'right_elbow',
9: 'left_wrist',
10: 'right_wrist',
11: 'left_hip',
12: 'right_hip',
13: 'left_knee',
14: 'right_knee',
15: 'left_ankle',
16: 'right_ankle'
Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

  • dataset. Default (validation) – False.

__init__(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.PoseTopDownSource(ann_file, img_prefix, data_cfg, dataset_info, coco_style=True, test_mode=False)[source]

Bases: object

Class for keypoint 2D top-down pose estimation with single-view RGB image as the data source.

Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • coco_style (bool) – Whether the annotation json is coco-style. Default: True

  • test_mode (bool) – Store True when building test or validation dataset. Default: False.

__init__(ann_file, img_prefix, data_cfg, dataset_info, coco_style=True, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

load_image(image_file)[source]
class easycv.datasets.pose.data_sources.HandCocoPoseTopDownSource(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

Coco Whole-Body-Hand Source for top-down hand pose estimation.

“Whole-Body Human Pose Estimation in the Wild”, ECCV’2020. More details can be found in the paper .

The dataset loads raw features and apply specified transforms to return a dict containing the image tensors and other information.

COCO-WholeBody Hand keypoint indexes:

0: 'wrist',
1: 'thumb1',
2: 'thumb2',
3: 'thumb3',
4: 'thumb4',
5: 'forefinger1',
6: 'forefinger2',
7: 'forefinger3',
8: 'forefinger4',
9: 'middle_finger1',
10: 'middle_finger2',
11: 'middle_finger3',
12: 'middle_finger4',
13: 'ring_finger1',
14: 'ring_finger2',
15: 'ring_finger3',
16: 'ring_finger4',
17: 'pinky_finger1',
18: 'pinky_finger2',
19: 'pinky_finger3',
20: 'pinky_finger4'
Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or validation dataset. Default: False.

__init__(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.WholeBodyCocoTopDownSource(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

CocoWholeBodyDataset dataset for top-down pose estimation.

“Whole-Body Human Pose Estimation in the Wild”, ECCV’2020. More details can be found in the paper .

The dataset loads raw features and apply specified transforms to return a dict containing the image tensors and other information.

COCO-WholeBody keypoint indexes:

0-16: 17 body keypoints,
17-22: 6 foot keypoints,
23-90: 68 face keypoints,
91-132: 42 hand keypoints

In total, we have 133 keypoints for wholebody pose estimation.
Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • test_mode (bool) – Store True when building test or validation dataset. Default: False.

__init__(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.PoseTopDownSourceCoco2017(data_cfg, path='', download=True, split='train', dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.coco.PoseTopDownSourceCoco

Parameters
  • path – target dir

  • download – whether download

  • split – train or val

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

  • dataset. Default (validation) – False.

__init__(data_cfg, path='', download=True, split='train', dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.PoseTopDownSourceCrowdPose(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False, **kwargs)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

CrowdPose keypoint indexes:

0 ‘left_shoulder’, 1 ‘right_shoulder’, 2 ‘left_elbow’, 3 ‘right_elbow’, 4 ‘left_wrist’, 5 ‘right_wrist’, 6 ‘left_hip’, 7 ‘right_hip’, 8 ‘left_knee’, 9 ‘right_knee’, 10 ‘left_ankle’, 11 ‘right_ankle’, 12 ‘head’, 13 ‘neck’

Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

  • dataset. Default (validation) – False.

__init__(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.PoseTopDownSourceChHuman(ann_file, img_prefix, data_cfg, subset=None, dataset_info=None, test_mode=False, **kwargs)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

Oc Human Source for top-down pose estimation.

Pose2Seg: Detection Free Human Instance Segmentation’ ECCV’2019 More details can be found in the `paper .

The source loads raw features to build a data meta object containing the image info, annotation info and others.

Oc Human keypoint indexes:

0: 'nose',
1: 'left_eye',
2: 'right_eye',
3: 'left_ear',
4: 'right_ear',
5: 'left_shoulder',
6: 'right_shoulder',
7: 'left_elbow',
8: 'right_elbow',
9: 'left_wrist',
10: 'right_wrist',
11: 'left_hip',
12: 'right_hip',
13: 'left_knee',
14: 'right_knee',
15: 'left_ankle',
16: 'right_ankle'
Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • subset – Applicable to non-coco or coco style data sets, if subset == train or val or test, in non-coco style else subset == None , in coco style

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

__init__(ann_file, img_prefix, data_cfg, subset=None, dataset_info=None, test_mode=False, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.PoseTopDownSourceMpii(data_cfg, path='/home/docs/.cache/easycv/', download=False, dataset_info=None, test_mode=False, **kwargs)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

Oc Human Source for top-down pose estimation.

Pose2Seg: Detection Free Human Instance Segmentation’ ECCV’2019 More details can be found in the `paper .

The source loads raw features to build a data meta object containing the image info, annotation info and others.

Oc Human keypoint indexes:

0: 'right_ankle',
1: 'right_knee',
2: 'right_hip',
3: 'left_hip',
4: 'right_ear',
5: 'left_ankle',
6: 'pelvis',
7: 'thorax',
8: 'neck',
9: 'head',
10: 'right_wrist',
11: 'right_elbow',
12: 'right_shoulder',
13: 'left_shoulder',
14: 'left_elbow',
15: 'left_wrist'
Parameters
  • data_cfg (dict) – config

  • path – This parameter is optional. If download is True and path is not provided, a temporary directory is automatically created for downloading

  • download – If the value is True, the file is automatically downloaded to the path directory. If False, automatic download is not supported and data in the path is used

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

__init__(data_cfg, path='/home/docs/.cache/easycv/', download=False, dataset_info=None, test_mode=False, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

load_points_bbox(scale, objpos, points)[source]
deal_annolist(num_list, char)[source]
download()[source]

Submodules

easycv.datasets.pose.data_sources.coco module

class easycv.datasets.pose.data_sources.coco.PoseTopDownSourceCoco(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.top_down.PoseTopDownSource

CocoSource for top-down pose estimation.

Microsoft COCO: Common Objects in Context’ ECCV’2014 More details can be found in the `paper .

The source loads raw features to build a data meta object containing the image info, annotation info and others.

COCO keypoint indexes:

0: 'nose',
1: 'left_eye',
2: 'right_eye',
3: 'left_ear',
4: 'right_ear',
5: 'left_shoulder',
6: 'right_shoulder',
7: 'left_elbow',
8: 'right_elbow',
9: 'left_wrist',
10: 'right_wrist',
11: 'left_hip',
12: 'right_hip',
13: 'left_knee',
14: 'right_knee',
15: 'left_ankle',
16: 'right_ankle'
Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

  • dataset. Default (validation) – False.

__init__(ann_file, img_prefix, data_cfg, dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.coco.PoseTopDownSourceCoco2017(data_cfg, path='', download=True, split='train', dataset_info=None, test_mode=False)[source]

Bases: easycv.datasets.pose.data_sources.coco.PoseTopDownSourceCoco

Parameters
  • path – target dir

  • download – whether download

  • split – train or val

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • test_mode (bool) – Store True when building test or

  • dataset. Default (validation) – False.

__init__(data_cfg, path='', download=True, split='train', dataset_info=None, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

easycv.datasets.pose.data_sources.top_down module

class easycv.datasets.pose.data_sources.top_down.DatasetInfo(dataset_info)[source]

Bases: object

__init__(dataset_info)[source]

Initialize self. See help(type(self)) for accurate signature.

class easycv.datasets.pose.data_sources.top_down.PoseTopDownSource(ann_file, img_prefix, data_cfg, dataset_info, coco_style=True, test_mode=False)[source]

Bases: object

Class for keypoint 2D top-down pose estimation with single-view RGB image as the data source.

Parameters
  • ann_file (str) – Path to the annotation file.

  • img_prefix (str) – Path to a directory where images are held. Default: None.

  • data_cfg (dict) – config

  • dataset_info (DatasetInfo) – A class containing all dataset info.

  • coco_style (bool) – Whether the annotation json is coco-style. Default: True

  • test_mode (bool) – Store True when building test or validation dataset. Default: False.

__init__(ann_file, img_prefix, data_cfg, dataset_info, coco_style=True, test_mode=False)[source]

Initialize self. See help(type(self)) for accurate signature.

load_image(image_file)[source]