GuidoBartoli / sherloq

An open-source digital image forensic toolset
GNU General Public License v3.0
2.63k stars 242 forks source link

IndexError with Channel Histogram and Quality Estimation #66

Open bel2k10x opened 1 year ago

bel2k10x commented 1 year ago

Hi, Great tool, thanks for that. I installed it with mamba on windows 10 plateform. Everything is Ok but when i try to use 'Channel Histogram' or 'Quality Estimation' i receive the error messages below. (i tried different picture format jpg bmp webp png)

I have the mathplotlib version 3.6.0 like asked in requirments.txt and python=3.8.15 all the version in requirments.txt are the same, except that i had to remove python-magic and installed python-magic-bin=0.4.14 as explained here https://github.com/GuidoBartoli/sherloq/issues/46#issuecomment-921231675

Thanks for any help.

(sherloq) D:\AI\FakeDetect\sherloq\gui>python sherloq.py WARNING:tensorflow:From C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\tensorflow\python\compat\v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term Traceback (most recent call last): File "sherloq.py", line 347, in open_tool tool_widget = HistWidget(self.image) File "D:\AI\FakeDetect\sherloq\gui\histogram.py", line 105, in init self.redraw() File "D:\AI\FakeDetect\sherloq\gui\histogram.py", line 165, in redraw self.axes.fill_between(x, y, alpha=alpha, facecolor="k", step=step) File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib__init.py", line 1423, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\axes_axes.py", line 5335, in fill_between return self._fill_between_x_or_y( File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\axes_axes.py", line 5263, in _fill_between_x_or_y for idx0, idx1 in cbook.contiguous_regions(where): File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\cbook\init__.py", line 1333, in contiguous_regions idx, = np.nonzero(mask[:-1] != mask[1:]) IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

Traceback (most recent call last): File "sherloq.py", line 387, in open_tool tool_widget = QualityWidget(self.filename, self.image) File "D:\AI\FakeDetect\sherloq\gui\quality.py", line 41, in init axes.fill_between(x, y 100, alpha=0.2) File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib__init__.py", line 1423, in inner return func(ax, map(sanitize_sequence, args), **kwargs) File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\axes_axes.py", line 5335, in fill_between return self._fill_between_x_or_y( File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\axes_axes.py", line 5263, in _fill_between_x_or_y for idx0, idx1 in cbook.contiguous_regions(where): File "C:\Users\Did\mambaforge\envs\sherloq\lib\site-packages\matplotlib\cbook__init__.py", line 1333, in contiguous_regions idx, = np.nonzero(mask[:-1] != mask[1:]) IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

GuidoBartoli commented 1 year ago

Hi, Great tool, thanks for that.

Thanks to you! 👍🏻

I installed it with mamba on windows 10 platform. Everything is Ok but when i try to use 'Channel Histogram' or 'Quality Estimation' i receive the error messages below. (i tried different picture format jpg bmp webp png)

Ok, thanks for the detailed report, I will look into that as soon as possible, I have to setup a Windows VM to try it out, because at the moment I only have Linux on my PCs.

GuidoBartoli commented 3 months ago

Is this an error you receive for any image you load or it happens only with one in particular?