Add imagecodecs packages
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- docker, python
- Domain
- build-system, infrastructure
Research direction
Start by reviewing the package-removal change in Kaggle/docker-python PR #1425 and reproduce the reported imageio.imread("data.tif") failure with the provided TIFF download. Identify where this image provides Python packages, restore imagecodecs there, and verify that the reproduction decodes the TIFF with shape (512, 512).
Written by the indexing model from the issue text.
Description
🐛 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!
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 1k
- Avg merge
- 7h 38m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kaggle/docker-python
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Kaggle/docker-python#1482 · 2 reactions ·
Maintainers usually reply within 1 day
-
loraOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
Kaggle/docker-python#1564 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Kaggle/docker-python#1563 ·
Maintainers usually reply within 1 day
-
ذOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
Kaggle/docker-python#1555 ·
Maintainers usually reply within 1 day
-
Pytorch CUDA P100 GPU IncompatibilityPossibly taken @shivansh193 claimed this 76 days ago. Openbug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Kaggle/docker-python#1546 · 4 comments · 2 reactions ·
Maintainers usually reply within 1 day
All issues in Kaggle/docker-python
Similar issues
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 74/100
BrainLesion/BraTS#200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenHands/extensions#970 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rl-institut/enetra#91 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
huggingface/datasets#9100 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/garak#2486 · 1 comment ·
Maintainers usually reply within 2 days