INNER CODE UNIT · Python
set_dataset_type
tensorlayer/HyperPose · hyperpose/Config/__init__.py:379
def set_dataset_type(dataset_type):
'''set the dataset for train and evaluate
set which dataset to use, the process of downlaoding, decoding, reformatting of different type
of dataset is automatic.
the evaluation metric of different dataset follows their official metric,
for COCO is MAP, for MPII is MPCH.
This API also receive user-defined dataset class, which should implement the following functions
| __init__: take the config object with all configuration to init the dataset
| get_parts: return a enum class which defines the key point definition of the dataset
| get_limbs: return a [2*num_limbs] array which defines the limb definition of the dataset
| get_colors: return a list which defines the visualization color of the limbs
| get_train_dataset: return a tensorflow dataset which contains elements for training. each element should contains an image path and a target dict decoded in bytes by _pickle
| get_eval_dataset: return a tensorflow dataset which contains elements for evaluating. each element should contains an image path and an image id
| official_eval: if want to evaluate on this user-defined dataset, evalutation function should be implemented.
one can refer the Dataset.mpii_dataset and Dataset.mscoco_dataset for detailed information.