facebookresearch / pifuhd

High-Resolution 3D Human Digitization from A Single Image.
Other
9.5k stars 1.44k forks source link

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

Closed sxstone closed 3 years ago

sxstone commented 3 years ago

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 commented 3 years ago

Same problem.

gormonn commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Same issue!! Glad I'm not alone!

MangoDev232 commented 3 years ago

Same Error since yesterday. Like 20 hours ago.

knicholes commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Same issue

0692abhishek commented 3 years ago

same issue plzz give some solution

soheilpaper commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Same error

shunsukesaito commented 3 years ago

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 commented 2 years ago

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

ahmedaisar commented 2 years ago

We are still getting EMPTY rect_files

mavericayman commented 2 years ago

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 commented 1 year ago

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 commented 1 month ago

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