示例#1
0
    def __init__(self,
                 artifacts_root: str,
                 dataset_name: str,
                 properties: List[PropertyExtractor],
                 handler: DataHandler = DiskHandler(),
                 attack_label: str = 'attack',
                 real_label: str = 'real',
                 all_attacks_alias: str = 'all'):

        self.videos_root = join(artifacts_root, self.PATH_ORIGINAL_VIDEOS,
                                dataset_name)
        self.separated_pai_root = join(artifacts_root,
                                       self.PATH_SEPARATED_BY_PAI,
                                       dataset_name)
        self.separated_subset_root = join(artifacts_root,
                                          self.PATH_SEPARATED_BY_SUBSET,
                                          dataset_name)
        self.extracted_frames_root = join(artifacts_root,
                                          self.PATH_EXTRACTED_FRAMES,
                                          dataset_name)
        self.properties_root = join(artifacts_root, self.PATH_EXTRACTED_MAPS,
                                    dataset_name)
        self.aligned_root = join(artifacts_root, self.PATH_ALIGNED,
                                 dataset_name)

        self.properties = properties
        self.handler = handler

        self.videos = []
        self.aligner = Aligner()

        self.default_attack_label = attack_label
        self.default_real_label = real_label
        self.all_attacks_alias = all_attacks_alias
示例#2
0
    def __init__(self,
                 images_root_path: str,
                 base_output_path: str,
                 properties: List[PropertyExtractor],
                 models: List[CnnModel],
                 data_handler: DataHandler = DiskHandler(),
                 train_alias: str = 'train',
                 test_alias: str = 'test',
                 target_all: str = 'all'):

        self.images_root_path = images_root_path
        self.base_output_path = base_output_path
        self.properties = properties
        self.models = models
        self.data_handler = data_handler
        self.train_alias = train_alias
        self.test_alias = test_alias
        self.target_all = target_all

        self.intra_dataset_output = os.path.join(self.base_output_path,
                                                 self.INTRA_NAME)
        self.inter_dataset_output = os.path.join(self.base_output_path,
                                                 self.INTER_NAME)
        self.meta_dataset_output = os.path.join(self.base_output_path,
                                                self.META_NAME)
示例#3
0
    def __init__(self,
                 separated_path: str,
                 output_features: str,
                 models: List[CnnModel],
                 properties: List[PropertyExtractor],
                 data_handler: DataHandler = DiskHandler(),
                 train_alias: str = 'train',
                 test_alias: str = 'test',
                 attack_label: str = 'attack',
                 real_label: str = 'real', ):
        self.separated_root = separated_path
        self.models = models
        self.properties = properties

        self.data_handler = data_handler
        self.output_features = output_features

        self.train_alias = train_alias
        self.test_alias = test_alias

        self.IMAGE_WIDTH = 224
        self.IMAGE_HEIGHT = 224
        self.IMAGE_CHANNELS = 3

        self.attack_label = attack_label
        self.real_label = real_label

        self.frame_delimiter = '_frame_'
        self.exts = ('*.jpg', '*.png')