Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to map actual image name with dask_image.imread #200

Closed
satish-madugula opened this issue Apr 16, 2021 · 3 comments
Closed

Not able to map actual image name with dask_image.imread #200

satish-madugula opened this issue Apr 16, 2021 · 3 comments

Comments

@satish-madugula
Copy link

Not able to get the respective filename by using dask-image.

import glob
import cv2
from dask_image import imread as imr

img_names = glob.glob(r'D:\dataset2\*.jpg')
imgs = imr.imread(r'D:\dataset2\*.jpg',arraytype='numpy')

print(img_names[124])  
cv2.imshow(img_names[124],imgs[124].compute())
cv2.waitKey(0)
cv2.destroyAllWindows()

For example:
img_names[124] is actually 'abc.jpg'
imgs[124].compute() loads gives me 'xyz.jpg'

also tried using sorted(glob.glob(r'D:\dataset2\*.jpg'))

  • Dask version: 0.5.0
  • Python version:3.7
  • Operating System: windows 10
  • Install method : pip
@GenevieveBuckley
Copy link
Collaborator

Hi @satish-madugula, I can't reproduce the behaviour you're describing here, so it's hard to know what might be going on.

  1. Which version of the pims library are you using?
  2. Can you try this with dask-image installed from the master branch, like this:
python -m pip install git+https://github.com/dask/dask-image.git

I make this second suggestion because there was a recent change that added an explicit sort to the filename glob:

filenames = sorted(glob.glob(sfname)) # pims also does this

I'm not sure if that would make a difference, because pims should already be doing that for you, and I don't see any strange behaviour when I try dask-image=0.5.0 (I'm on Linux instead of Windows though).

@satish-madugula
Copy link
Author

Hi @GenevieveBuckley

Thanks for the response, it is working after installing dask-image using master branch.

python -m pip install git+https://github.com/dask/dask-image.git

@GenevieveBuckley
Copy link
Collaborator

Hm, interesting. We've been intending to make a new release, so I think I should do that sooner rather than later given the bug you've described.

Thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants