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

Error when importing from URL #11

Open
daniel-at-hive opened this issue Mar 30, 2024 · 0 comments
Open

Error when importing from URL #11

daniel-at-hive opened this issue Mar 30, 2024 · 0 comments

Comments

@daniel-at-hive
Copy link

Hello, I haven't been able to get this library working with a list of URLs as the image source.
Running the example code from the docs: Import images from url location fails with the following trace:

[/usr/local/lib/python3.10/dist-packages/undouble/undouble.py](https://localhost:8080/#) in import_data(self, targetdir, black_list, return_results)
    165         # logger.info("Retrieving files from: [%s]" %(self.params['targetdir']))
    166         # Preprocessing the images the get them in the right scale and size etc
--> 167         self.results = self.clustimage.import_data(self.params['targetdir'], black_list=black_list)
    168         # Remove keys that are not used.
    169         if 'labels' in self.results: self.results.pop('labels')

[/usr/local/lib/python3.10/dist-packages/clustimage/clustimage.py](https://localhost:8080/#) in import_data(self, Xraw, flatten, black_list)
    992             Xraw = url2disk(Xraw, self.params['tempdir'])
    993             # Do not store in the object if the find functionality is used
--> 994             X = self.preprocessing(Xraw['pathnames'], grayscale=self.params['cv2_imread_colorscale'], dim=self.params['dim'], flatten=flatten)
    995             # Add the url location
    996             if Xraw['url'] is not None:

[/usr/local/lib/python3.10/dist-packages/clustimage/clustimage.py](https://localhost:8080/#) in preprocessing(self, pathnames, grayscale, dim, flatten)
    803         # Read and preprocess data
    804         imgs = list(map(lambda x: self.imread(x, colorscale=grayscale, dim=dim, flatten=flatten, return_succes=True), tqdm(pathnames, disable=disable_tqdm(), desc='[clustimage]')))
--> 805         img, imgOK = zip(*imgs)
    806         img = np.array(img)
    807 

ValueError: not enough values to unpack (expected 2, got 0)

Thanks

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

1 participant