image cannot display correctly
I have installed with no errors, but when I run the demo_showcandidates.py, the image can not display correctly, the image looks like this:
the image can display when I use the following code
from skimage.viewer import ImageViewer
viewer = ImageViewer(img)
viewer.show()

I have solved this problem the code demo_showcandidates.py line35 should be
self.qimg = QImage(ndimg.data, w, h, QImage.Format_RGB888)
there two test can not pass
class TestMergeSimilaritySet:
error message:
feature_extractor = <class 'test_selective_search.Feature'>
Ak = {0: set([1, 4]), 1: set([0, 4]), 4: set([0, 1])}, S = [(1, (0, 1))], i = 2
j = 3, t = 4
def _merge_similarity_set(feature_extractor, Ak, S, i, j, t):
# remove entries which have i or j
S = list(filter(lambda x: not(i in x[1] or j in x[1]), S))
# calculate similarity between region t and its adjacencies
St = [(feature_extractor.similarity(t, x), (t, x)) for x in Ak[t] if t < x] +\
> [(feature_extractor.similarity(x, t), (x, t)) for x in Ak[t] if x < t]
E TypeError: unbound method <lambda>() must be called with Feature instance as first argument (got int instance instead)
hdd/workspace/PycharmProjects/selective_search_py/selective_search.py:60: TypeError
============== 11 tests deselected by '-k TestMergeSimilaritySet' ==============
=================== 1 failed, 11 deselected in 0.40 seconds ====================
the second one is :
class TestFeaturesColorHistogram:
error message:
hdd/workspace/PycharmProjects/selective_search_py/test_features.py .F
self = <test_features.TestFeaturesColorHistogram instance at 0x7f93250bca70>
def test_1region_255color(self):
self.setup_method(self, w = 1, h = 256)
for y in range(self.h):
self.f.image[y, :, :] = y
hist = self.f._Features__init_color(1)
assert len(hist) == 1
assert hist[0].shape == (75,)
r_expected = [11] * 23 + [3, 0] # because bin width equals 11
g_expected = [11] * 23 + [3, 0]
b_expected = [11] * 23 + [3, 0]
expected = numpy.array(r_expected + g_expected + b_expected)
> numpy.testing.assert_array_almost_equal(hist[0].ravel(), expected / numpy.sum(expected))
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E (mismatch 96.0%)
E x: array([ 0.014323, 0.014323, 0.014323, 0.014323, 0.014323, 0.014323,
E 0.014323, 0.014323, 0.014323, 0.014323, 0.014323, 0.014323,
E 0.014323, 0.014323, 0.014323, 0.014323, 0.014323, 0.014323,...
E y: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
E 0, 0, 0, 0, 0, 0])
hdd/workspace/PycharmProjects/selective_search_py/test_features.py:35: AssertionError
can you fix it?
Can you share the original image file that you specified to the code if you still have? Since I cannot reproduce the situation, guessing the image file is something special format that I hadn't supposed (like endian, alpha channel, ...).
I met the same problem as @auroua . His fix works for me. The image used is: https://www.dropbox.com/s/esdu4vevnnk0yev/breadmix.png?dl=0
Same issue for me. @auroua 's fix works.
Same issue for me. @auroua 's fix works. Thanks!