soft-matter / pims

Python Image Sequence: Load video and sequential images in many formats with a simple, consistent interface.
http://soft-matter.github.io/pims/
Other
259 stars 67 forks source link

PyAV tests failing on main branch #414

Closed GenevieveBuckley closed 1 year ago

GenevieveBuckley commented 2 years ago

The PyAV tests are failing on the main branch. It looks like the PyAV dependency isn't included in the CI environments, so this might be going unnoticed.

To reproduce

Create a regular pims development environment, and confirm that the tests pass:

conda create -n pims-dev python=3.9 pip ipython
conda activate pims-dev
cd GitHub/pims
python -m pip install -r requirements-dev.txt
python -m pip install -e .
pytest

Next, install the PyAV dependency with conda, and observe the failing tests:

conda install av -c conda-forge
pytest
Pytest output: ```python-traceback ============================= test session starts ============================== platform darwin -- Python 3.9.12, pytest-7.1.2, pluggy-1.0.0 rootdir: /Users/genevieb/Documents/GitHub/pims, configfile: pytest.ini collected 534 items pims/tests/test_bioformats.py ssssssssssssssssssssssssssssssssssssssssss [ 7%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 21%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 31%] pims/tests/test_cine.py ...... [ 32%] pims/tests/test_common.py .........................FFF.FFF...F......FFF. [ 41%] FFF...Fssssssssssssssssssssssssssssssssssssssssssssssssssss............. [ 55%] ............................................. [ 63%] pims/tests/test_display.py ...........ssssss...... [ 67%] pims/tests/test_factories.py . [ 67%] pims/tests/test_frame.py ...... [ 69%] pims/tests/test_imseq.py ............................................... [ 77%] ........................................................................ [ 91%] ......... [ 93%] pims/tests/test_multidimensional.py ........ [ 94%] pims/tests/test_norpix.py sssssss................. [ 99%] pims/tests/test_process.py .... [ 99%] pims/utils/tests/test_sort.py . [100%] =================================== FAILURES =================================== ____________________ TestVideo_PyAV_timed.test_getting_list ____________________ self = def test_getting_list(self): self.check_skip() actual = list(self.v[[1, 0, 0, 1, 1]]) expected = [self.frame1, self.frame0, self.frame0, self.frame1, self.frame1] > [assert_image_equal(a, b) for a, b in zip(actual, expected)] pims/tests/test_common.py:344: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pims/tests/test_common.py:344: in [assert_image_equal(a, b) for a, b in zip(actual, expected)] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 126, 59], ..., [137, 118, 53], ...[145, 125, 62], ..., [147, 128, 58], [140, 121, 56], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 124, 58], ..., [137, 117, 52], ...[145, 125, 61], ..., [147, 126, 57], [140, 120, 55], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 613964 / 814080 (75.4%) E Max absolute difference: 2 E Max relative difference: 0.04 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 126, 59],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 124, 58],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. ________________ TestVideo_PyAV_timed.test_getting_single_frame ________________ self = def test_getting_single_frame(self): self.check_skip() > assert_image_equal(self.v[0], self.frame0) pims/tests/test_common.py:334: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. ___________________ TestVideo_PyAV_timed.test_getting_slice ____________________ self = def test_getting_slice(self): self.check_skip() tmp = list(self.v[0:2]) frame0, frame1 = tmp > assert_image_equal(frame0, self.frame0) pims/tests/test_common.py:265: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. ______________________ TestVideo_PyAV_timed.test_iterator ______________________ self = def test_iterator(self): self.check_skip() i = iter(self.v) > assert_image_equal(next(i), self.frame0) pims/tests/test_common.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. __________________ TestVideo_PyAV_timed.test_pipeline_simple ___________________ self = def test_pipeline_simple(self): rescale = pims.pipeline(_rescale) rescaled_v = rescale(self.v[:1]) > assert_image_equal(rescaled_v[0], _rescale(self.frame0)) pims/tests/test_common.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[0.86231884, 0.72463768, 0.20289855], [0.86231884, 0.72463768, 0.20289855], [0.86231884, 0.724... 0.7173913 , 0.21014493], [0.8115942 , 0.67391304, 0.20289855], [0.79710145, 0.65942029, 0.1884058 ]]]) expected = array([[[0.86330935, 0.71223022, 0.20143885], [0.86330935, 0.71223022, 0.20143885], [0.86330935, 0.712... 0.70503597, 0.20863309], [0.81294964, 0.66906475, 0.20143885], [0.79856115, 0.65467626, 0.18705036]]]) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): assert_equal(actual, expected) else: if np.issubdtype(expected.dtype, np.integer): expected = expected/float(np.iinfo(expected.dtype).max) > assert_allclose(actual, expected, atol=1/256.) E AssertionError: E Not equal to tolerance rtol=1e-07, atol=0.00390625 E E Mismatched elements: 387898 / 814080 (47.6%) E Max absolute difference: 0.01308518 E Max relative difference: 0.32850242 E x: Frame([[[0.862319, 0.724638, 0.202899], E [0.862319, 0.724638, 0.202899], E [0.862319, 0.724638, 0.217391],... E y: array([[[0.863309, 0.71223 , 0.201439], E [0.863309, 0.71223 , 0.201439], E [0.863309, 0.71223 , 0.215827],... pims/tests/test_common.py:58: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. _________________ TestVideo_PyAV_timed.test_pipeline_with_args _________________ self = def test_pipeline_with_args(self): color_channel = pims.pipeline(_color_channel) red = color_channel(self.v, 0) green = color_channel(self.v, 1) > assert_image_equal(red[0], _color_channel(self.frame0, 0)) pims/tests/test_common.py:305: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[146, 146, 146, ..., 140, 141, 142], [146, 146, 146, ..., 140, 142, 142], [146, 146, 146, ..., 14..., 129, 120, 119], [146, 146, 145, ..., 137, 129, 126], [146, 146, 145, ..., 145, 139, 137]], dtype=uint8) expected = array([[146, 146, 146, ..., 140, 141, 142], [146, 146, 146, ..., 140, 142, 142], [146, 146, 146, ..., 14..., 129, 120, 119], [146, 146, 145, ..., 137, 129, 126], [146, 146, 145, ..., 145, 139, 137]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 95024 / 271360 (35%) E Max absolute difference: 1 E Max relative difference: 0.00877193 E x: Frame([[146, 146, 146, ..., 140, 141, 142], E [146, 146, 146, ..., 140, 142, 142], E [146, 146, 146, ..., 141, 143, 144],... E y: array([[146, 146, 146, ..., 140, 141, 142], E [146, 146, 146, ..., 140, 142, 142], E [146, 146, 146, ..., 141, 143, 144],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. ___________________ TestVideo_PyAV_timed.test_slice_of_slice ___________________ self = def test_slice_of_slice(self): # More thorough recursive slicing tests, making use of more than # the two frames available for these tests, are elsewhere: # see test_recursive_slicing. self.check_skip() tmp = self.v[0:2] tmp1 = tmp[1:] frame1 = tmp1[0] > assert_image_equal(frame1, self.frame1) pims/tests/test_common.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 126, 59], ..., [137, 118, 53], ...[145, 125, 62], ..., [147, 128, 58], [140, 121, 56], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 124, 58], ..., [137, 117, 52], ...[145, 125, 61], ..., [147, 126, 57], [140, 120, 55], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 613964 / 814080 (75.4%) E Max absolute difference: 2 E Max relative difference: 0.04 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 126, 59],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 124, 58],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:38 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:38 No accelerated colorspace conversion found from yuv420p to rgb24. ___________________ TestVideo_PyAV_indexed.test_getting_list ___________________ self = def test_getting_list(self): self.check_skip() actual = list(self.v[[1, 0, 0, 1, 1]]) expected = [self.frame1, self.frame0, self.frame0, self.frame1, self.frame1] > [assert_image_equal(a, b) for a, b in zip(actual, expected)] pims/tests/test_common.py:344: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pims/tests/test_common.py:344: in [assert_image_equal(a, b) for a, b in zip(actual, expected)] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 126, 59], ..., [137, 118, 53], ...[145, 125, 62], ..., [147, 128, 58], [140, 121, 56], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 124, 58], ..., [137, 117, 52], ...[145, 125, 61], ..., [147, 126, 57], [140, 120, 55], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 613964 / 814080 (75.4%) E Max absolute difference: 2 E Max relative difference: 0.04 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 126, 59],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 124, 58],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. _______________ TestVideo_PyAV_indexed.test_getting_single_frame _______________ self = def test_getting_single_frame(self): self.check_skip() > assert_image_equal(self.v[0], self.frame0) pims/tests/test_common.py:334: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. __________________ TestVideo_PyAV_indexed.test_getting_slice ___________________ self = def test_getting_slice(self): self.check_skip() tmp = list(self.v[0:2]) frame0, frame1 = tmp > assert_image_equal(frame0, self.frame0) pims/tests/test_common.py:265: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. _____________________ TestVideo_PyAV_indexed.test_iterator _____________________ self = def test_iterator(self): self.check_skip() i = iter(self.v) > assert_image_equal(next(i), self.frame0) pims/tests/test_common.py:258: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 127, 57], ..., [140, 121, 56], ...[145, 125, 62], ..., [145, 126, 56], [139, 120, 55], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 125, 56], ..., [140, 120, 55], ...[145, 125, 61], ..., [145, 124, 55], [139, 119, 54], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 602412 / 814080 (74%) E Max absolute difference: 2 E Max relative difference: 0.03846154 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 127, 57],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 125, 56],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. _________________ TestVideo_PyAV_indexed.test_pipeline_simple __________________ self = def test_pipeline_simple(self): rescale = pims.pipeline(_rescale) rescaled_v = rescale(self.v[:1]) > assert_image_equal(rescaled_v[0], _rescale(self.frame0)) pims/tests/test_common.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[0.86231884, 0.72463768, 0.20289855], [0.86231884, 0.72463768, 0.20289855], [0.86231884, 0.724... 0.7173913 , 0.21014493], [0.8115942 , 0.67391304, 0.20289855], [0.79710145, 0.65942029, 0.1884058 ]]]) expected = array([[[0.86330935, 0.71223022, 0.20143885], [0.86330935, 0.71223022, 0.20143885], [0.86330935, 0.712... 0.70503597, 0.20863309], [0.81294964, 0.66906475, 0.20143885], [0.79856115, 0.65467626, 0.18705036]]]) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): assert_equal(actual, expected) else: if np.issubdtype(expected.dtype, np.integer): expected = expected/float(np.iinfo(expected.dtype).max) > assert_allclose(actual, expected, atol=1/256.) E AssertionError: E Not equal to tolerance rtol=1e-07, atol=0.00390625 E E Mismatched elements: 387898 / 814080 (47.6%) E Max absolute difference: 0.01308518 E Max relative difference: 0.32850242 E x: Frame([[[0.862319, 0.724638, 0.202899], E [0.862319, 0.724638, 0.202899], E [0.862319, 0.724638, 0.217391],... E y: array([[[0.863309, 0.71223 , 0.201439], E [0.863309, 0.71223 , 0.201439], E [0.863309, 0.71223 , 0.215827],... pims/tests/test_common.py:58: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. ________________ TestVideo_PyAV_indexed.test_pipeline_with_args ________________ self = def test_pipeline_with_args(self): color_channel = pims.pipeline(_color_channel) red = color_channel(self.v, 0) green = color_channel(self.v, 1) > assert_image_equal(red[0], _color_channel(self.frame0, 0)) pims/tests/test_common.py:305: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[146, 146, 146, ..., 140, 141, 142], [146, 146, 146, ..., 140, 142, 142], [146, 146, 146, ..., 14..., 129, 120, 119], [146, 146, 145, ..., 137, 129, 126], [146, 146, 145, ..., 145, 139, 137]], dtype=uint8) expected = array([[146, 146, 146, ..., 140, 141, 142], [146, 146, 146, ..., 140, 142, 142], [146, 146, 146, ..., 14..., 129, 120, 119], [146, 146, 145, ..., 137, 129, 126], [146, 146, 145, ..., 145, 139, 137]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 95024 / 271360 (35%) E Max absolute difference: 1 E Max relative difference: 0.00877193 E x: Frame([[146, 146, 146, ..., 140, 141, 142], E [146, 146, 146, ..., 140, 142, 142], E [146, 146, 146, ..., 141, 143, 144],... E y: array([[146, 146, 146, ..., 140, 141, 142], E [146, 146, 146, ..., 140, 142, 142], E [146, 146, 146, ..., 141, 143, 144],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. __________________ TestVideo_PyAV_indexed.test_slice_of_slice __________________ self = def test_slice_of_slice(self): # More thorough recursive slicing tests, making use of more than # the two frames available for these tests, are elsewhere: # see test_recursive_slicing. self.check_skip() tmp = self.v[0:2] tmp1 = tmp[1:] frame1 = tmp1[0] > assert_image_equal(frame1, self.frame1) pims/tests/test_common.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ actual = Frame([[[146, 127, 55], [146, 127, 55], [146, 126, 59], ..., [137, 118, 53], ...[145, 125, 62], ..., [147, 128, 58], [140, 121, 56], [137, 118, 53]]], dtype=uint8) expected = array([[[146, 125, 54], [146, 125, 54], [146, 124, 58], ..., [137, 117, 52], ...[145, 125, 61], ..., [147, 126, 57], [140, 120, 55], [137, 117, 52]]], dtype=uint8) def assert_image_equal(actual, expected): if np.issubdtype(actual.dtype, np.integer): > assert_equal(actual, expected) E AssertionError: E Arrays are not equal E E Mismatched elements: 613964 / 814080 (75.4%) E Max absolute difference: 2 E Max relative difference: 0.04 E x: Frame([[[146, 127, 55], E [146, 127, 55], E [146, 126, 59],... E y: array([[[146, 125, 54], E [146, 125, 54], E [146, 124, 58],... pims/tests/test_common.py:54: AssertionError ------------------------------ Captured log call ------------------------------- WARNING libav.swscaler:pyav_reader.py:386 deprecated pixel format used, make sure you did set range correctly WARNING libav.swscaler:pyav_reader.py:386 No accelerated colorspace conversion found from yuv420p to rgb24. =========================== short test summary info ============================ FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_getting_list - A... FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_getting_single_frame FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_getting_slice - ... FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_iterator - Asser... FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_pipeline_simple FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_pipeline_with_args FAILED pims/tests/test_common.py::TestVideo_PyAV_timed::test_slice_of_slice FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_getting_list FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_getting_single_frame FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_getting_slice FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_iterator - Ass... FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_pipeline_simple FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_pipeline_with_args FAILED pims/tests/test_common.py::TestVideo_PyAV_indexed::test_slice_of_slice ================= 14 failed, 285 passed, 235 skipped in 23.23s ================= ```
GenevieveBuckley commented 2 years ago

Here is the conda list of my dev environment, including the PyAV dependency

Details (click to expand) ``` (pims-dev) genevieb@dyn-130-194-109-212 pims % conda list # packages in environment at /Users/genevieb/mambaforge/envs/pims-dev: # # Name Version Build Channel alabaster 0.7.12 pypi_0 pypi aom 3.3.0 h07bb92c_1 conda-forge appnope 0.1.3 pyhd8ed1ab_0 conda-forge asttokens 2.0.5 pyhd8ed1ab_0 conda-forge attrs 21.4.0 pypi_0 pypi av 9.2.0 py39ha1d0045_0 conda-forge babel 2.10.1 pypi_0 pypi backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge beautifulsoup4 4.11.1 pypi_0 pypi black 22.3.0 pypi_0 pypi bleach 5.0.0 pypi_0 pypi bzip2 1.0.8 h3422bc3_4 conda-forge ca-certificates 2021.10.8 h4653dfc_0 conda-forge certifi 2021.10.8 pypi_0 pypi charset-normalizer 2.0.12 pypi_0 pypi click 8.1.3 pypi_0 pypi codecov 2.1.12 pypi_0 pypi commonmark 0.9.1 pypi_0 pypi coverage 6.3.2 pypi_0 pypi cycler 0.11.0 pypi_0 pypi decorator 5.1.1 pyhd8ed1ab_0 conda-forge docutils 0.17.1 pypi_0 pypi executing 0.8.3 pyhd8ed1ab_0 conda-forge ffmpeg 4.4.1 heb85afd_3 conda-forge flake8 4.0.1 pypi_0 pypi fonttools 4.33.3 pypi_0 pypi freetype 2.10.4 h17b34a0_1 conda-forge gettext 0.19.8.1 h049c9fb_1008 conda-forge giflib 5.2.1 h27ca646_2 conda-forge gmp 6.2.1 h9f76cd9_0 conda-forge gnutls 3.6.13 h706517b_1 conda-forge icu 70.1 h6b3803e_0 conda-forge idna 3.3 pypi_0 pypi imageio 2.16.1 pypi_0 pypi imagesize 1.3.0 pypi_0 pypi importlib-metadata 4.11.3 pypi_0 pypi iniconfig 1.1.1 pypi_0 pypi ipython 8.3.0 py39h2804cbe_0 conda-forge jbig 2.1 h3422bc3_2003 conda-forge jedi 0.18.1 py39h2804cbe_1 conda-forge jinja2 3.1.2 pypi_0 pypi jpeg 9e h1c322ee_1 conda-forge keyring 23.5.0 pypi_0 pypi kiwisolver 1.4.2 pypi_0 pypi lame 3.100 h27ca646_1001 conda-forge lcms2 2.12 had6a04f_0 conda-forge lerc 3.0 hbdafb3b_0 conda-forge libblas 3.9.0 14_osxarm64_openblas conda-forge libcblas 3.9.0 14_osxarm64_openblas conda-forge libcxx 14.0.3 h6a5c8ee_0 conda-forge libdeflate 1.10 h3422bc3_0 conda-forge libffi 3.4.2 h3422bc3_5 conda-forge libgfortran 5.0.0.dev0 11_0_1_hf114ba7_23 conda-forge libgfortran5 11.0.1.dev0 hf114ba7_23 conda-forge libiconv 1.16 h642e427_0 conda-forge liblapack 3.9.0 14_osxarm64_openblas conda-forge libopenblas 0.3.20 openmp_h2209c59_0 conda-forge libpng 1.6.37 hf7e6567_2 conda-forge libtiff 4.3.0 h77dc3b6_3 conda-forge libvpx 1.11.0 hc470f4d_3 conda-forge libwebp 1.2.2 h0d20362_0 conda-forge libwebp-base 1.2.2 h3422bc3_1 conda-forge libxcb 1.13 h9b22ae9_1004 conda-forge libxml2 2.9.14 h035c1df_0 conda-forge libzlib 1.2.11 h90dfc92_1014 conda-forge llvm-openmp 14.0.3 hd125106_0 conda-forge lz4-c 1.9.3 hbdafb3b_1 conda-forge markupsafe 2.1.1 pypi_0 pypi matplotlib 3.5.2 pypi_0 pypi matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge mccabe 0.6.1 pypi_0 pypi mpl-sphinx-theme 3.5.0 pypi_0 pypi mypy-extensions 0.4.3 pypi_0 pypi ncurses 6.3 h07bb92c_1 conda-forge nettle 3.6 hc6a1b29_0 conda-forge networkx 2.8 pypi_0 pypi numpy 1.22.3 py39h64940a9_2 conda-forge numpydoc 1.3.1 pypi_0 pypi openh264 2.1.1 habe5f53_0 conda-forge openjpeg 2.4.0 h062765e_1 conda-forge openssl 3.0.3 ha287fd2_0 conda-forge packaging 21.3 pypi_0 pypi parso 0.8.3 pyhd8ed1ab_0 conda-forge pathspec 0.9.0 pypi_0 pypi pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.1.0 py39hd72dd6b_2 conda-forge pims 0.4+297.gc49dc7a dev_0 pip 22.0.4 pyhd8ed1ab_0 conda-forge pkginfo 1.8.2 pypi_0 pypi platformdirs 2.5.2 pypi_0 pypi pluggy 1.0.0 pypi_0 pypi prompt-toolkit 3.0.29 pyha770c72_0 conda-forge pthread-stubs 0.4 h27ca646_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge py 1.11.0 pypi_0 pypi pycodestyle 2.8.0 pypi_0 pypi pydata-sphinx-theme 0.8.1 pypi_0 pypi pyflakes 2.4.0 pypi_0 pypi pygments 2.12.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.9 pypi_0 pypi pytest 7.1.2 pypi_0 pypi python 3.9.12 h14b404e_1_cpython conda-forge python-dateutil 2.8.2 pypi_0 pypi python_abi 3.9 2_cp39 conda-forge pytz 2022.1 pypi_0 pypi pywavelets 1.3.0 pypi_0 pypi readline 8.1 hedafd6a_0 conda-forge readme-renderer 35.0 pypi_0 pypi requests 2.27.1 pypi_0 pypi requests-toolbelt 0.9.1 pypi_0 pypi rfc3986 2.0.0 pypi_0 pypi rich 12.4.1 pypi_0 pypi scikit-image 0.19.2 pypi_0 pypi scipy 1.8.0 pypi_0 pypi setuptools 62.2.0 py39h2804cbe_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge slicerator 1.1.0 pypi_0 pypi snowballstemmer 2.2.0 pypi_0 pypi soupsieve 2.3.2.post1 pypi_0 pypi sphinx 4.5.0 pypi_0 pypi sphinx-copybutton 0.5.0 pypi_0 pypi sphinx-rtd-theme 1.0.0 pypi_0 pypi sphinxcontrib-applehelp 1.0.2 pypi_0 pypi sphinxcontrib-devhelp 1.0.2 pypi_0 pypi sphinxcontrib-htmlhelp 2.0.0 pypi_0 pypi sphinxcontrib-jsmath 1.0.1 pypi_0 pypi sphinxcontrib-qthelp 1.0.3 pypi_0 pypi sphinxcontrib-serializinghtml 1.1.5 pypi_0 pypi sqlite 3.38.5 h40dfcc0_0 conda-forge stack_data 0.2.0 pyhd8ed1ab_0 conda-forge svt-av1 0.9.1 h07bb92c_0 conda-forge tifffile 2022.5.4 pypi_0 pypi tk 8.6.12 he1e0b03_0 conda-forge tomli 2.0.1 pypi_0 pypi traitlets 5.2.0 pyhd8ed1ab_0 conda-forge twine 4.0.0 pypi_0 pypi typing-extensions 4.2.0 pypi_0 pypi tzdata 2022a h191b570_0 conda-forge urllib3 1.26.9 pypi_0 pypi wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 pypi_0 pypi wheel 0.37.1 pyhd8ed1ab_0 conda-forge x264 1!161.3030 h3422bc3_1 conda-forge x265 3.5 hbc6ce65_3 conda-forge xorg-libxau 1.0.9 h27ca646_0 conda-forge xorg-libxdmcp 1.1.3 h27ca646_0 conda-forge xz 5.2.5 h642e427_1 conda-forge zipp 3.8.0 pypi_0 pypi zlib 1.2.11 h90dfc92_1014 conda-forge zstd 1.5.2 h861e0a7_0 conda-forge ```
nkeim commented 1 year ago

Thanks @GenevieveBuckley ! Since #437 the CI tests include PyAV, and there was a change to the reader class in that PR; CI tests currently pass with av=10.0.0. I will close this issue but please speak up if I'm missing something!