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

TypeError: group_keypoints() got an unexpected keyword argument 'demo' #103

Closed
sxstone opened this issue Dec 22, 2020 · 20 comments
Closed

Comments

@sxstone
Copy link

sxstone commented Dec 22, 2020

I try to run the demo on Google collab, but the following errors always appear. All processes are carried out according to the video, and the input image is also used test.png Why do the following errors occur? After trying many solutions, I don't know if anyone has the same problem. Can it be solved?


TypeError Traceback (most recent call last)
in ()
3 load_state(net, checkpoint)
4
----> 5 get_rect(net.cuda(), [image_path], 512)

in get_rect(net, images, height_size)
28 total_keypoints_num += extract_keypoints(heatmaps[:, :, kpt_idx], all_keypoints_by_type, total_keypoints_num)
29
---> 30 pose_entries, all_keypoints = group_keypoints(all_keypoints_by_type, pafs, demo=True)
31 for kpt_id in range(all_keypoints.shape[0]):
32 all_keypoints[kpt_id, 0] = (all_keypoints[kpt_id, 0] * stride / upsample_ratio - pad[1]) / scale

TypeError: group_keypoints() got an unexpected keyword argument 'demo'

@dickkky
Copy link

dickkky commented Dec 22, 2020

Same problem.

@gormonn
Copy link

gormonn commented Dec 22, 2020

the same problem:

`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
3 load_state(net, checkpoint)
4
----> 5 get_rect(net.cuda(), [image_path], 512)

in get_rect(net, images, height_size)
28 total_keypoints_num += extract_keypoints(heatmaps[:, :, kpt_idx], all_keypoints_by_type, total_keypoints_num)
29
---> 30 pose_entries, all_keypoints = group_keypoints(all_keypoints_by_type, pafs, demo=True)
31 for kpt_id in range(all_keypoints.shape[0]):
32 all_keypoints[kpt_id, 0] = (all_keypoints[kpt_id, 0] * stride / upsample_ratio - pad[1]) / scale

TypeError: group_keypoints() got an unexpected keyword argument 'demo'`

@rdelrosa2000
Copy link

I have the same problem. I’ve been trying it for the past 3 days since Sunday and I’m gettin the same error message.

@kuritaTD
Copy link

I have error that is like below... I don't know how to solve this error..
Please teach me how to solve this error...


TypeError Traceback (most recent call last)
in ()
3 load_state(net, checkpoint)
4
----> 5 get_rect(net.cuda(), [image_path], 512)

in get_rect(net, images, height_size)
28 total_keypoints_num += extract_keypoints(heatmaps[:, :, kpt_idx], all_keypoints_by_type, total_keypoints_num)
29
---> 30 pose_entries, all_keypoints = group_keypoints(all_keypoints_by_type, pafs, demo=True)
31 for kpt_id in range(all_keypoints.shape[0]):
32 all_keypoints[kpt_id, 0] = (all_keypoints[kpt_id, 0] * stride / upsample_ratio - pad[1]) / scale

TypeError: group_keypoints() got an unexpected keyword argument 'demo'

@shackhornold
Copy link

Same issue!! Glad I'm not alone!

@MangoDev232
Copy link

Same Error since yesterday. Like 20 hours ago.

@knicholes
Copy link

knicholes commented Dec 23, 2020

The error is stating that the function is receiving an unexpected keyword argument named "demo." To get past this problem, stop passing the demo keyword argument to the group_keypoints function.

@sxstone
Copy link
Author

sxstone commented Dec 23, 2020

The error is stating that the function is receiving an unexpected keyword argument named "demo." To get past this problem, stop passing the demo keyword argument to the group_keypoints function.

Thank you for your reply. I did the same thing, that is, I deleted the demo keyword, but I don't know if it will bring other effects.

@EnricoBeltramo
Copy link

Same issue

@0692abhishek
Copy link

same issue plzz give some solution

@soheilpaper
Copy link

Please remove the demo=True from this part of code:

        pose_entries, all_keypoints = group_keypoints(all_keypoints_by_type, pafs, demo=True)

image

Also you can see the fixed code here:
https://colab.research.google.com/drive/1YZfHcLDJwRo-8Ty3tV1h0rN7iwrOmftT?usp=sharing

@shackhornold
Copy link

shackhornold commented Dec 24, 2020

Alright, but for some reason I am having this error:

Warning: opt is overwritten.
test data size:  1
initialize network with normal
initialize network with normal
generate mesh (test) ...
  0% 0/1 [00:00<?, ?it/s]/content/pifuhd/lib/data/EvalDataset.py:87: UserWarning: loadtxt: Empty input file: "/content/pifuhd/sample_images/shackcomm2tp_rect.txt"
  rects = np.loadtxt(rect_path, dtype=np.int32)
  0% 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/content/pifuhd/apps/simple_test.py", line 30, in <module>
    reconWrapper(cmd, args.use_rect)
  File "/content/pifuhd/apps/recon.py", line 220, in reconWrapper
    recon(opt, use_rect)
  File "/content/pifuhd/apps/recon.py", line 205, in recon
    test_data = test_dataset[i]
  File "/content/pifuhd/lib/data/EvalDataset.py", line 131, in __getitem__
    return self.get_item(index)
  File "/content/pifuhd/lib/data/EvalDataset.py", line 93, in get_item
    im = crop_image(im, rect)
  File "/content/pifuhd/lib/data/EvalDataset.py", line 17, in crop_image
    x, y, w, h = rect
ValueError: not enough values to unpack (expected 4, got 0)

The xxxxx_rect.txt file doesn't seem to be generating properly, as I have had no luck with it. Is this related to removing demo=True?

@CubeBag
Copy link

CubeBag commented Dec 31, 2020

Same, my _rect.txt file is empty

Edit: Actually on the fixed colab sheet it seems to just get stuck somewhere and it never finishes on the get_rect(net.cuda(), [image_path], 512) line

@HenrikoMagnifico
Copy link

Same error

@shunsukesaito
Copy link
Contributor

You can remove demo argument in group_keypoints(). I have removed it in the released colab notebook.
For those who experience empty rect file, likely no keypoint is detected in an input image. Feel free to post failure images here if you need further diagnosis.

@ahmedaisar
Copy link

Why is this closed when the problem is NOT FIXED??

@ahmedaisar
Copy link

We are still getting EMPTY rect_files

@mavericayman
Copy link

Can anyone help me solve the blank _rect file generated?

Actually on the fixed colab sheet it seems to just get stuck somewhere and it never finishes on the get_rect(net.cuda(), [image_path], 512) line

@davidbernat
Copy link

The _rect.txt file contains a bounding box which isolates the person in the image.

  1. The full-pipeline _rext.txt is generated by first using the openpose.py script to generate an OpenPose wireframe of each individual. OpenPose stores its results in an .obj file. Then, the PiFUHD script uses the OpenPose .obj file to generate the bounding box internally which it then stores in the _rect.txt. Alternatively, instead of using OpenPose, one can simply supply the _rect.txt. Presumably, if you do not have a bounding box you can set the bounding box to be the full dimensions of the image.
  2. Unfortunately, I do not know the format for the _rect.txt so I cannot help you write one by hand. If anyone has that information, and can post a sample file, please do. When I generate one I will post it here.

@ricardo7k
Copy link

Just change the last code before the cell with erro to use int instead of np.int, and change the np.bool from pifuhd/lib/sdf.py to use bool

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