Пример #1
0
    def __init__(self, feat_extract_name , n_processes, low_pass, high_pass, gauss_noise, roi, size_percentage,\
                 feature_extractor__shape_norm, feature_extractor__shape_conv, \
                 feature_extractor__shape_pool, feature_extractor__n_filters, \
                 feature_extractor__stride_pool, feature_extractor__stoc_pool, \
                 feature_extractor__div_norm, feature_extractor__region_shape, \
                 feature_extractor__region_stride, feature_extractor__top_regions, \
                 feature_extractor__stride_pool_recurrent, feature_extractor__analysis_shape, \
                 feature_extractor__method, \
                 feature_extractor__n_tiles, augmentation, multi_column, aug_rotate \
                 ):
        self.low_pass = low_pass
        self.high_pass = high_pass
        self.gauss_noise = gauss_noise
        self.roi = roi
        self.size_percentage = size_percentage
        self.augmentation = augmentation
        self.aug_rotate = aug_rotate
        self.multi_column = multi_column
        self.feat_extract_name = feat_extract_name
        self.n_processes = n_processes

        if feat_extract_name.lower() == 'convnet':
            self.feature_extractor = eval(feat_extract_name + '()')
            self.feature_extractor.n_filters = feature_extractor__n_filters
            self.feature_extractor.shape_norm = feature_extractor__shape_norm
            self.feature_extractor.shape_conv = feature_extractor__shape_conv
            self.feature_extractor.shape_pool = feature_extractor__shape_pool
            self.feature_extractor.stride_pool = feature_extractor__stride_pool
            self.feature_extractor.div_norm = feature_extractor__div_norm
            self.feature_extractor.stoc_pool = feature_extractor__stoc_pool
        elif feat_extract_name.lower() == 'mrrconvnet':
            self.feature_extractor = eval(feat_extract_name + '()')
            convnet = ConvNet()
            convnet.n_filters = feature_extractor__n_filters
            convnet.shape_norm = feature_extractor__shape_norm
            convnet.shape_conv = feature_extractor__shape_conv
            convnet.shape_pool = feature_extractor__shape_pool
            convnet.stride_pool = feature_extractor__stride_pool
            convnet.div_norm = feature_extractor__div_norm
            convnet.stoc_pool = feature_extractor__stoc_pool
            self.feature_extractor.convnet = convnet
            self.feature_extractor.region_shape = feature_extractor__region_shape
            self.feature_extractor.region_stride = feature_extractor__region_stride
            self.feature_extractor.top_regions = feature_extractor__top_regions
            self.feature_extractor.stride_pool_recurrent = feature_extractor__stride_pool_recurrent
            self.feature_extractor.analysis_shape = feature_extractor__analysis_shape

        elif feat_extract_name.lower() == 'lbp':
            self.feature_extractor = eval(feat_extract_name + '()')
            self.feature_extractor.method = feature_extractor__method
            self.feature_extractor.n_tiles = feature_extractor__n_tiles
 def __init__(self, feat_extract_name , n_processes, low_pass, high_pass, gauss_noise, roi, size_percentage,\
              feature_extractor__shape_norm, feature_extractor__shape_conv, \
              feature_extractor__shape_pool, feature_extractor__n_filters, \
              feature_extractor__stride_pool, feature_extractor__stoc_pool, \
              feature_extractor__div_norm, feature_extractor__region_shape, \
              feature_extractor__region_stride, feature_extractor__top_regions, \
              feature_extractor__stride_pool_recurrent, feature_extractor__analysis_shape, \
              feature_extractor__method, \
              feature_extractor__n_tiles, augmentation, multi_column, aug_rotate \
              ):
     self.low_pass = low_pass
     self.high_pass = high_pass
     self.gauss_noise = gauss_noise
     self.roi = roi
     self.size_percentage = size_percentage
     self.augmentation = augmentation
     self.aug_rotate = aug_rotate
     self.multi_column = multi_column
     self.feat_extract_name = feat_extract_name
     self.n_processes = n_processes
     
     if feat_extract_name.lower() == 'convnet':
         self.feature_extractor = eval(feat_extract_name+'()')
         self.feature_extractor.n_filters = feature_extractor__n_filters
         self.feature_extractor.shape_norm = feature_extractor__shape_norm
         self.feature_extractor.shape_conv = feature_extractor__shape_conv
         self.feature_extractor.shape_pool = feature_extractor__shape_pool
         self.feature_extractor.stride_pool = feature_extractor__stride_pool
         self.feature_extractor.div_norm = feature_extractor__div_norm
         self.feature_extractor.stoc_pool = feature_extractor__stoc_pool
     elif feat_extract_name.lower() == 'mrrconvnet':
         self.feature_extractor = eval(feat_extract_name+'()')
         convnet = ConvNet()
         convnet.n_filters = feature_extractor__n_filters
         convnet.shape_norm = feature_extractor__shape_norm
         convnet.shape_conv = feature_extractor__shape_conv
         convnet.shape_pool = feature_extractor__shape_pool
         convnet.stride_pool = feature_extractor__stride_pool
         convnet.div_norm = feature_extractor__div_norm
         convnet.stoc_pool = feature_extractor__stoc_pool
         self.feature_extractor.convnet = convnet
         self.feature_extractor.region_shape = feature_extractor__region_shape
         self.feature_extractor.region_stride = feature_extractor__region_stride
         self.feature_extractor.top_regions = feature_extractor__top_regions
         self.feature_extractor.stride_pool_recurrent = feature_extractor__stride_pool_recurrent
         self.feature_extractor.analysis_shape =feature_extractor__analysis_shape
         
     elif feat_extract_name.lower() == 'lbp':
         self.feature_extractor = eval(feat_extract_name+'()')
         self.feature_extractor.method = feature_extractor__method
         self.feature_extractor.n_tiles = feature_extractor__n_tiles