Exemplo n.º 1
0
 def f(image_source):
     if config.intersected_features:
         r = extract_intersected_features(image_source, targets, config)
     else:
         r = features.extract_features(image_source, targets,
                                       config.n_subchunks, config.patchsize)
     return r
Exemplo n.º 2
0
    def f(image_source):
        r_t = features.extract_features(image_source, targets, n_subchunks=1,
                                        patchsize=config.patchsize)
        r_a = features.extract_subchunks(image_source, subchunk_index=0,
                                         n_subchunks=1,
                                         patchsize=config.patchsize)
        if frac < 1.0:
            np.random.seed(1)
            r_a = r_a[np.random.rand(r_a.shape[0]) < frac]

        r_data = np.concatenate([r_t.data, r_a.data], axis=0)
        r_mask = np.concatenate([r_t.mask, r_a.mask], axis=0)
        r = np.ma.masked_array(data=r_data, mask=r_mask)
        return r
Exemplo n.º 3
0
 def f(image_source):
     r = features.extract_features(image_source, targets,
                                   config.n_subchunks, config.patchsize)
     return r