I got some issues while generating depth image
I got the following issue when I try to generate my own depth image:
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
I wouldn't get this issue if I use pictures from the web, but once I use my own picture which is screenshot this issue will happen.
Do you know how to solve this problem?
It should be a bug of skimage.rescale.
@wenbinTse
@shanjianwu
Traceback (most recent call last):
File "E:/yzu/lab/face anti spoofing/PRNet-master/demo.py", line 168, in
i always get this error, when i tried for the depth map
can you please help me to explain it?
Thanks in advance
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
@wenbinTse @shanjianwu @ksachdeva
How to overcome this error?
Thanks in advance
It's should be a bug of skimage.rescale. You can try another version of skimage or use cv2.resize like me.
Really happy for your response, Thank you so much
But this shape changes, is happens at the But api.py at line 58,
Def dlib_detect(self,image):
Self.face_detector Return self.face_detector(image,1)
When I print and see at here ,... The image size is like (1000,562,2). But the input image size is (1920,1080,3).
Can you please tell me where did you changed the size of the image Thanks in advance.
On Wed 29 Jul, 2020, 11:06 PM wenbin, [email protected] wrote:
It's should be a bug of skimage.rescale. You can try another version of skimage or use cv2.resize like me.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YadiraF/PRNet/issues/172#issuecomment-665720704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMM7B26ZJO6UXFWBRKFKIA3R6A3HRANCNFSM4L47GOQQ .
@wenbinTse Really happy for your response, Thank you so much
But this shape changes is happening at the But api.py at line 58,
Def dlib_detect(self,image):
Self.face_detector Return self.face_detector(image,1)
When I print and see here,... The image size is like (1000,562,2). But the input image size is (1920,1080,3).
Can you please tell me where did you change the size of the image Thanks in advance.
@wenbinTse
The shape changes because of the output_shape, and its scale. It has a value of 1.567 and makes a round-off and its changing into 2. But we need 3 to carry out the code
scale = np.atleast_1d(scale) if len(scale) > 1: if ((not multichannel and len(scale) != image.ndim) or (multichannel and len(scale) != image.ndim - 1)): raise ValueError("Supply a single scale, or one value per spatial " "axis") if multichannel: scale = np.concatenate((scale, [1])) orig_shape = np.asarray(image.shape) output_shape = np.round(scale * orig_shape)
Sorry, I don't remember the details and my code is on the server which is unavailable now.
@wenbinTse
Can you please tell me the size, because when I choose (256,256) so my image size will be (256,256,3), I am not getting any depth map, my depth_map value is full of 0 (zeros). and then I tried with (1000,562) as (1000,562,3) still, the values remain zero. And then I get one error as Bad allocation
@wenbinTse , Thank you so much, for your kind response,...
Can you please tell me the size, because when I choose (256,256) so my image size will be (256,256,3), I am not getting any depth map, my depth_map value is full of 0 (zeros). and then I tried with (1000,562) as (1000,562,3) still, the values remain zero. And then I get one error as Bad allocation.
When I display and see the values of the depth_map, which is fully zeros (0), I am quite confused about it.
Thanks in advance
It should be a bug of skimage.rescale.
same problem here: https://github.com/YadiraF/PRNet/pull/154#issue-329571724
关于
if max_size> 1000:
image = rescale(image, 1000./max_size)
image = (image*255).astype(np.uint8)
可能出现的问题
The rescale algorithm will be called with maxsize>1000 and the size of the channels will be reduced from 3 to 2.
This should be because the rescale algorithm thinks that the third channel also needs to rescale
The solution is to set multichannel flag to True:
image = rescale(image, 1000./max_size, multichannel=True)
in scikit_image-0.20.0,it is Invalid because of “rescale() got an unexpected keyword argument 'multichannel'”
image = rescale(image, 1000./max_size, multichannel=True)
in scikit_image-0.20.0,it is Invalid because of “rescale() got an unexpected keyword argument 'multichannel'”
image = rescale(image, 1000./max_size, multichannel=True)
Please use channel_axis instead