def get_all_contactpose_samples()

in contactopt/create_dataset_contactpose.py [0:0]


def get_all_contactpose_samples():
    """
    Gets all participants and objects from ContactPose
    Cuts out grasps with two hands or grasps using left hand
    :return: list of (participant_num, intent, object_name, ContactPose_object)
    """
    samples = []

    print('Reading ContactPose dataset')
    for participant_id in tqdm(range(1, 51)):
        for intent in ['handoff', 'use']:
            for object_name in get_object_names(participant_id, intent):
                cp = ContactPose(participant_id, intent, object_name, load_mano=False)
                if cp._valid_hands != [1]:  # If anything else than just the right hand, remove
                    continue

                samples.append((participant_id, intent, object_name, cp))

    print('Valid ContactPose samples:', len(samples))

    return samples