Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add imagecodecs packages

Đang mở
#1,439 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, python

Hướng nghiên cứu

Bắt đầu bằng cách xem xét thay đổi loại bỏ package trong Kaggle/docker-python PR #1425 và tái hiện lỗi imageio.imread("data.tif") đã được báo cáo bằng bản tải xuống TIFF được cung cấp. Xác định nơi image này cung cấp các package Python, khôi phục imagecodecs tại đó và xác minh rằng việc tái hiện giải mã TIFF với shape (512, 512).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug help wanted

🐛 Bug

TLDR error: imagecodecs is not found by tifffile for decoding input images.

Error trace:

/opt/conda/lib/python3.10/site-packages/imageio/v3.py in ?(uri, index, plugin, extension, format_hint, **kwargs)
     50     if index is not None:
     51         call_kwargs["index"] = index
     52 
     53     with imopen(uri, "r", **plugin_kwargs) as img_file:
---> 54         return np.asarray(img_file.read(**call_kwargs))

/opt/conda/lib/python3.10/site-packages/imageio/plugins/tifffile_v3.py in ?(self, index, page, **kwargs)
    165             # read all series in the file and return them as a batch
    166             ndimage = np.stack([x for x in self.iter(**kwargs)])
    167         else:
    168             index = None if index is Ellipsis else index
--> 169             ndimage = self._fh.asarray(series=index, **kwargs)
    170 
    171         return ndimage

/opt/conda/lib/python3.10/site-packages/tifffile/tifffile.py in ?(self, key, series, level, squeeze, out, maxworkers, buffersize)

/opt/conda/lib/python3.10/site-packages/tifffile/tifffile.py in ?(self, out, squeeze, lock, maxworkers, buffersize)

/opt/conda/lib/python3.10/site-packages/tifffile/tifffile.py in ?(self, lock, maxworkers, func, sort, buffersize, _fullsize)

/opt/conda/lib/python3.10/site-packages/tifffile/tifffile.py in ?(args, decodeargs, decode)
   9179     def get_resolution(
-> 9180         self,
   9181         unit: RESUNIT | int | str | None = None,
   9182         scale: float | int | None = None,
   9183     ) -> tuple[int | float, int | float]:

/opt/conda/lib/python3.10/site-packages/tifffile/tifffile.py in ?(exc, *args, **kwargs)
   8603             def unpack(data: bytes, /) -> NDArray[Any]:
-> 8604                 # return NumPy array from packed integers
   8605                 return imagecodecs.packints_decode(
   8606                     data, dtype, self.bitspersample, runlen=stwidth * samples
   8607                 )

ValueError: <COMPRESSION.LZW: 5> requires the 'imagecodecs' package
To Reproduce
import imageio.v3 as imageio
!wget -q https://owncloud.gwdg.de/index.php/s/3gAgXzzObADpAoL/download -O data.tif
image = imageio.imread("data.tif")
Expected behavior

This works seamlessly in my local system.

(sam) anwai@anwai:~/data/test$ python
Python 3.10.0 | packaged by conda-forge | (default, Nov 20 2021, 02:24:10) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import imageio.v3 as imageio
>>> import subprocess
>>> subprocess.run(["wget", "https://owncloud.gwdg.de/index.php/s/3gAgXzzObADpAoL/download", "-O", "data.tif"])
--2024-11-13 18:34:14--  https://owncloud.gwdg.de/index.php/s/3gAgXzzObADpAoL/download
Resolving owncloud.gwdg.de (owncloud.gwdg.de)... 134.76.23.45
Connecting to owncloud.gwdg.de (owncloud.gwdg.de)|134.76.23.45|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 215312 (210K) [image/tiff]
Saving to: ‘data.tif’

data.tif                           100%[================================================================>] 210,27K  --.-KB/s    in 0,02s   

2024-11-13 18:34:15 (12,5 MB/s) - ‘data.tif’ saved [215312/215312]

CompletedProcess(args=['wget', 'https://owncloud.gwdg.de/index.php/s/3gAgXzzObADpAoL/download', '-O', 'data.tif'], returncode=0)
>>> image = imageio.imread("data.tif")
>>> image.shape
(512, 512)
Additional context

Seems like the package was removed in this PR (https://github.com/Kaggle/docker-python/pull/1425).

Also, installing this using pip or conda (using pip install imagecodecs / conda install -c conda-forge imagecodecs) does not seem to resolve the issue.

Thanks in advance!

Ngôn ngữ chính
Python
Star
2.7k
Fork
1k
Merge trung bình
5 giờ 55 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Kaggle/docker-python

Tất cả issue của Kaggle/docker-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.