DenisTome / Lifting-from-the-Deep-release

Implementation of "Lifting from the Deep: Convolutional 3D Pose Estimation from a Single Image"

Home Page:https://denistome.github.io/papers/lifting-from-the-deep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: cannot reshape array of size 0 into shape (0,newaxis,2)

MritulaC opened this issue · comments

in normalise_data
d2 = d2.reshape(d2.shape[0], -1, 2).transpose(0, 2, 1)
ValueError: cannot reshape array of size 0 into shape (0,newaxis,2)

Hi,
I am getting the above error when giving a jpeg image for reconstruction. How am I to overcome this error?#
Thanks,
Mritula

That means that for that specific frame there are no predictions.
Probably, by playing with /packages/lifting/utils/config.py VISIBLE_PART, you can find a threshold that is better for your specific images.

How to determine the maximum and minimum values for Visible part? I have given 1e-10 and 1e-20, and still the same error.

Okay that is weird. Just to be sure about it, what happens if you check the content of d2?

The way it's working right now is to have the mean(heatmap) > VISIBLE_PART

part_hmap[:, :, pid]) > config.VISIBLE_PART

you could change that to max(heatmap).

Thanks, I will check it and update you.

I did try but still, the same problem exists

so, what's the content of the variable part_hmap?

I have given print statement for part_hmap output, but the program is not priniting out the value
for oid, (yc, xc) in enumerate(centers):
part_hmap = skimage.transform.resize(
..........
print(part_hmap)

not sure why :-(

the reason it's not printing anything is probably because it's empty.
One thing you can do is to say:

if len(centers) < 1:
# skip to next frame
return None, None, None

I did that and i got the following
ValueError: too many values to unpack (expected 2)

len(centers) is 0.

Hi, When I run this code, I am also getting ValueError: cannot reshape array of size 0 into shape (0,newaxis,2).

The png file I am using was created using an iOS app. This app creates an image of myself as JPEG. I converted it to a png file using Preview Export option. The program works with the test_image.png.

Can you help me understand what is it that I am missing?

I've updated the code to catch that error. However in order to fix that, you need to try to change the packages/lifting/utils/config.py file, specifically CENTER_TR.

Thanks Denis. What do you suggest I change the CENTER_TR to from 0.4? Why do you suggest that I change it?

After changing the CENTER_TR to 0.2, I did manage to go past this error and get the output generated. Thanks.

Perfect.
Yeah, at the end there are 2 thresholds controlling everything and by adjusting them you can control the visibility.

Thanks, I will try the same and update.