def test_SUN(tmpdir, matlab, color_stimulus, grayscale_stimulus):
    model = pysaliency.SUN(location=str(tmpdir))
    print('Testing color')
    saliency_map = model.saliency_map(color_stimulus)
    np.testing.assert_allclose(
        saliency_map,
        np.load(
            os.path.join('tests', 'external_models',
                         '{}_color_stimulus.npy'.format(model.__modelname__))))
    print('Testing Grayscale')
    saliency_map = model.saliency_map(grayscale_stimulus)
    np.testing.assert_allclose(
        saliency_map,
        np.load(
            os.path.join(
                'tests', 'external_models',
                '{}_grayscale_stimulus.npy'.format(model.__modelname__))))
Ejemplo n.º 2
0
]
MatlabOptions.octave_names = []

# Load The Image
path = './imgs/balloons.png'
img = mpimg.imread(path)
img = skimage.img_as_float(img)

# initiate our model
IK = IttiKoch(verbose=False)
saliency, _ = IK.run(img)

# initate models
aim = pysaliency.AIM(location='test_models',
                     cache_location=os.path.join('model_caches', 'AIM'))
sun = pysaliency.SUN(location='test_models',
                     cache_location=os.path.join('model_caches', 'SUN'))
cas = pysaliency.ContextAwareSaliency(location='test_models',
                                      cache_location=os.path.join(
                                          'model_caches',
                                          'ContextAwareSaliency'))
covsal = pysaliency.CovSal(location='test_models',
                           cache_location=os.path.join('model_caches',
                                                       'CovSal'))
gbvs = pysaliency.GBVS(location='test_models',
                       cache_location=os.path.join('model_caches', 'GBVS'))
gbvs_ik = pysaliency.GBVSIttiKoch(location='test_models',
                                  cache_location=os.path.join(
                                      'model_caches', 'GBVS'))

# bms = pysaliency.BMS(location='test_models', cache_location=os.path.join('model_caches', 'BMS'))
# judd = pysaliency.Judd(location='test_models', cache_location=os.path.join('model_caches', 'Judd'))
 def create_model(self, location):
     return pysaliency.SUN(location=location)