Esempio n. 1
0
def get_validation_set(opt, spatial_transform, temporal_transform,
                       target_transform):
    assert opt.dataset in ['jester', 'egogesture', 'nv']

    if opt.dataset == 'jester':
        validation_data = Jester(opt.video_path,
                                 opt.annotation_path,
                                 'validation',
                                 opt.n_val_samples,
                                 spatial_transform,
                                 temporal_transform,
                                 target_transform,
                                 modality=opt.modality,
                                 sample_duration=opt.sample_duration)
    elif opt.dataset == 'egogesture':
        validation_data = EgoGesture(opt.video_path,
                                     opt.annotation_path,
                                     'validation',
                                     opt.n_val_samples,
                                     spatial_transform,
                                     temporal_transform,
                                     target_transform,
                                     modality=opt.modality,
                                     sample_duration=opt.sample_duration)
    elif opt.dataset == 'nv':
        validation_data = NV(opt.video_path,
                             opt.annotation_path,
                             'validation',
                             spatial_transform=spatial_transform,
                             temporal_transform=temporal_transform,
                             target_transform=target_transform,
                             sample_duration=opt.sample_duration,
                             modality=opt.modality)
    return validation_data
Esempio n. 2
0
def get_test_set(opt, spatial_transform, temporal_transform, target_transform):
    assert opt.dataset in ['jester', 'egogesture', 'nv', 'sc', 'ems']
    assert opt.test_subset in ['val', 'test']

    if opt.test_subset == 'val':
        subset = 'validation'
    else:
        subset = 'testing'

    if opt.dataset == 'ems':
        test_data = EMS(opt.video_path,
                        opt.annotation_path,
                        subset,
                        opt.n_val_samples,
                        spatial_transform,
                        temporal_transform,
                        target_transform,
                        modality=opt.modality,
                        sample_duration=opt.sample_duration)
    elif opt.dataset == 'sc':
        test_data = Jester(opt.video_path,
                           opt.annotation_path,
                           subset,
                           opt.n_val_samples,
                           spatial_transform,
                           temporal_transform,
                           target_transform,
                           modality=opt.modality,
                           sample_duration=opt.sample_duration)
    elif opt.dataset == 'jester':
        test_data = Jester(opt.video_path,
                           opt.annotation_path,
                           subset,
                           opt.n_val_samples,
                           spatial_transform,
                           temporal_transform,
                           target_transform,
                           modality=opt.modality,
                           sample_duration=opt.sample_duration)
    elif opt.dataset == 'egogesture':
        test_data = EgoGesture(opt.video_path,
                               opt.annotation_path,
                               subset,
                               opt.n_val_samples,
                               spatial_transform,
                               temporal_transform,
                               target_transform,
                               modality=opt.modality,
                               sample_duration=opt.sample_duration)
    elif opt.dataset == 'nv':
        test_data = NV(opt.video_path,
                       opt.annotation_path,
                       'validation',
                       spatial_transform=spatial_transform,
                       temporal_transform=temporal_transform,
                       target_transform=target_transform,
                       sample_duration=opt.sample_duration,
                       modality=opt.modality)
    return test_data
Esempio n. 3
0
def get_training_set(opt, spatial_transform, temporal_transform,
                     target_transform):
    assert opt.dataset in [
        'kinetics', 'jester', 'ucf101', 'egogesture', 'nvgesture'
    ]

    if opt.train_validate:
        subset = ['training', 'validation']
    else:
        subset = 'training'

    if opt.dataset == 'kinetics':
        training_data = Kinetics(opt.video_path,
                                 opt.annotation_path,
                                 'training',
                                 spatial_transform=spatial_transform,
                                 temporal_transform=temporal_transform,
                                 target_transform=target_transform,
                                 sample_duration=opt.sample_duration)
    elif opt.dataset == 'jester':
        training_data = Jester(opt.video_path,
                               opt.annotation_path,
                               'training',
                               spatial_transform=spatial_transform,
                               temporal_transform=temporal_transform,
                               target_transform=target_transform,
                               sample_duration=opt.sample_duration)
    elif opt.dataset == 'ucf101':
        training_data = UCF101(opt.video_path,
                               opt.annotation_path,
                               'training',
                               spatial_transform=spatial_transform,
                               temporal_transform=temporal_transform,
                               target_transform=target_transform,
                               sample_duration=opt.sample_duration)
    elif opt.dataset == 'egogesture':
        training_data = EgoGesture(opt.video_path,
                                   opt.annotation_path,
                                   subset,
                                   spatial_transform=spatial_transform,
                                   temporal_transform=temporal_transform,
                                   target_transform=target_transform,
                                   sample_duration=opt.sample_duration,
                                   modality=opt.modality)
    elif opt.dataset == 'nvgesture':
        training_data = NV(opt.video_path,
                           opt.annotation_path,
                           subset,
                           spatial_transform=spatial_transform,
                           temporal_transform=temporal_transform,
                           target_transform=target_transform,
                           sample_duration=opt.sample_duration,
                           modality=opt.modality)
    return training_data
Esempio n. 4
0
def get_training_set(opt, spatial_transform, temporal_transform,
                     target_transform):
    assert opt.dataset in ['jester', 'nv', 'ipn']

    if opt.train_validate:
        subset = ['training', 'validation']
    else:
        subset = 'training'
    if opt.dataset == 'jester':
        training_data = Jester(opt.video_path,
                               opt.annotation_path,
                               subset,
                               spatial_transform=spatial_transform,
                               temporal_transform=temporal_transform,
                               target_transform=target_transform,
                               sample_duration=opt.sample_duration,
                               modality=opt.modality)
    elif opt.dataset == 'egogesture':
        training_data = EgoGesture(opt.video_path,
                                   opt.annotation_path,
                                   subset,
                                   spatial_transform=spatial_transform,
                                   temporal_transform=temporal_transform,
                                   target_transform=target_transform,
                                   sample_duration=opt.sample_duration,
                                   modality=opt.modality)
    elif opt.dataset == 'nv':
        training_data = NV(opt.video_path,
                           opt.annotation_path,
                           subset,
                           spatial_transform=spatial_transform,
                           temporal_transform=temporal_transform,
                           target_transform=target_transform,
                           sample_duration=opt.sample_duration,
                           modality=opt.modality)
    elif opt.dataset == 'ipn':
        training_data = IPN(opt.video_path,
                            opt.annotation_path,
                            subset,
                            spatial_transform=spatial_transform,
                            temporal_transform=temporal_transform,
                            target_transform=target_transform,
                            sample_duration=opt.sample_duration,
                            modality=opt.modality)
    elif opt.dataset == 'denso':
        training_data = Denso(opt.video_path,
                              opt.annotation_path,
                              subset,
                              spatial_transform=spatial_transform,
                              temporal_transform=temporal_transform,
                              target_transform=target_transform,
                              sample_duration=opt.sample_duration,
                              modality=opt.modality,
                              no_subject_crop=opt.no_scrop)
    elif opt.dataset == 'AHG':
        training_data = AHG(opt.video_path,
                            opt.annotation_path,
                            subset,
                            spatial_transform=spatial_transform,
                            temporal_transform=temporal_transform,
                            target_transform=target_transform,
                            sample_duration=opt.sample_duration,
                            modality=opt.modality,
                            no_subject_crop=opt.no_scrop)
    return training_data
Esempio n. 5
0
def get_validation_set(opt, spatial_transform, temporal_transform,
                       target_transform):
    assert opt.dataset in ['jester', 'nv', 'ipn']

    if opt.dataset == 'jester':
        validation_data = Jester(opt.video_path,
                                 opt.annotation_path,
                                 'validation',
                                 opt.n_val_samples,
                                 spatial_transform,
                                 temporal_transform,
                                 target_transform,
                                 modality=opt.modality,
                                 sample_duration=opt.sample_duration)
    elif opt.dataset == 'egogesture':
        validation_data = EgoGesture(opt.video_path,
                                     opt.annotation_path,
                                     'validation',
                                     opt.n_val_samples,
                                     spatial_transform,
                                     temporal_transform,
                                     target_transform,
                                     modality=opt.modality,
                                     sample_duration=opt.sample_duration)
    elif opt.dataset == 'nv':
        validation_data = NV(opt.video_path,
                             opt.annotation_path,
                             'validation',
                             spatial_transform=spatial_transform,
                             temporal_transform=temporal_transform,
                             target_transform=target_transform,
                             sample_duration=opt.sample_duration,
                             modality=opt.modality)
    elif opt.dataset == 'ipn':
        validation_data = IPN(opt.video_path,
                              opt.annotation_path,
                              'validation',
                              spatial_transform=spatial_transform,
                              temporal_transform=temporal_transform,
                              target_transform=target_transform,
                              sample_duration=opt.sample_duration,
                              modality=opt.modality)
    elif opt.dataset == 'denso':
        validation_data = Denso(opt.video_path,
                                opt.annotation_path,
                                'validation',
                                true_valid=opt.true_valid,
                                spatial_transform=spatial_transform,
                                temporal_transform=temporal_transform,
                                target_transform=target_transform,
                                sample_duration=opt.sample_duration,
                                modality=opt.modality,
                                no_subject_crop=opt.no_scrop)
    elif opt.dataset == 'AHG':
        validation_data = AHG(opt.video_path,
                              opt.annotation_path,
                              'validation',
                              spatial_transform=spatial_transform,
                              temporal_transform=temporal_transform,
                              target_transform=target_transform,
                              sample_duration=opt.sample_duration,
                              modality=opt.modality,
                              no_subject_crop=opt.no_scrop)
    return validation_data