visual-layer / fastdup

fastdup is a powerful free tool designed to rapidly extract valuable insights from your image & video datasets. Assisting you to increase your dataset images & labels quality and reduce your data operations costs at an unparalleled scale.
Other
1.54k stars 74 forks source link

[Bug]: Invalid number of channels in input images where scn is 4 #219

Closed pgarciacamou closed 1 year ago

pgarciacamou commented 1 year ago

Similar Issue: https://github.com/visual-layer/fastdup/issues/190


What happened?

When running fastdup via https://registry.hub.docker.com/r/karpadoni/fastdup-ubuntu-20.04/ I get the following error:

2023-06-25 23:43:19 [ERROR] Failed to read image /home/Photos/IMG_8034.PNG OpenCV(4.6.0) /mnt/data/openc
v/modules/imgproc/src/color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function 'cv::impl:
:{anonymous}::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, i
nt) [with VScn = cv::impl::{anonymous}::Set<1>; VDcn = cv::impl::{anonymous}::Set<3, 4>; VDepth = cv:
:impl::{anonymous}::Set<0, 2, 5>; cv::impl::{anonymous}::SizePolicy sizePolicy = cv::impl::<unnamed>:
:NONE; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'          
> Invalid number of channels in input image:                                                         
>     'VScn::contains(scn)'                                                                          
> where                                                                                              
>     'scn' is 4

IMG_8034.PNG:

What did you expect to see?

No response

What version of fastdup were you runnning on?

1.17

What version of Python were you running on?

Python 3.8

Operating System

Ubuntu 20.04.6 LTS

Reproduction steps

  1. Run the docker container inside my DS220+ Synology NAS.
  2. Run python3 run_fastdup.py

run_fastdup.py:

import fastdup

# Set the working directory and the directory containing the images
work_dir = '/fastdup'
images_dir = '/home'

# Create a FastDup instance and run it
fd = fastdup.create(work_dir, images_dir)
fd.run()

Relevant log output

No response

Attach a screenshot [Optional]

No response

Contact Details [Optional]

No response

dbickson commented 1 year ago

Hi @pgarciacamou. Thanks for the detailed error report! I looked at your image and it is somehow non standard. It is RGBA 16 bit. We have added a fix in version 1.21, it will be out today.

dbickson commented 1 year ago

Version 1.21 is out please try it out.

pgarciacamou commented 1 year ago

Tested it and it works as expected now. 👍 thank you!