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

UnboundLocalError: local variable 'box_size' referenced before assignment #107

Open
O-O1024 opened this issue Dec 4, 2024 · 2 comments
Open

Comments

@O-O1024
Copy link

O-O1024 commented Dec 4, 2024

运行 V2 版出现以下错误:

Traceback (most recent call last):
  File "/root/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
  File "/root/ComfyUI/execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
  File "/root/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/root/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/root/ComfyUI/custom_nodes/ComfyUI_EchoMimic/EchoMimic_node.py", line 471, in em_main
    output_video=process_video_v2(image, audio_file, width, height, length, seed,
  File "/root/ComfyUI/custom_nodes/ComfyUI_EchoMimic/utils.py", line 93, in process_video_v2
    pose_img,_,_=visualizer(np.asarray(i),[5])
  File "/root/ComfyUI/custom_nodes/ComfyUI_EchoMimic/src/pose.py", line 124, in __call__
    pose_result_image, keypoints,box_size = self.estimate_pose(img, bboxes,filter_obj_done)
  File "/root/miniconda3/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/root/ComfyUI/custom_nodes/ComfyUI_EchoMimic/src/pose.py", line 157, in estimate_pose
    return result_img, all_keypoints,box_size
UnboundLocalError: local variable 'box_size' referenced before assignment

查看输出,错误发生在对齐姿势:

image

Starting the first frame gesture alignment based on the input image *** 基于输入图片,开始首帧手势缩放对齐 !
  0%|                                                                                                       | 0/60 [00:00<?, ?it/s]
0: 640x640 (no detections), 8.3ms
Speed: 2.7ms preprocess, 8.3ms inference, 0.6ms postprocess per image at shape (1, 3, 640, 640)

bboxes:  []

之前的姿势检查是正常的:

***** start infer video to npy files for drive pose ! ***** 

0: 640x640 1 person, 2 chairs, 1 potted plant, 7.4ms
Speed: 3.7ms preprocess, 7.4ms inference, 56.5ms postprocess per image at shape (1, 3, 640, 640)

bboxes:  [[146  30 624 765]] 


0: 640x640 1 person, 7.9ms
Speed: 2.6ms preprocess, 7.9ms inference, 1.6ms postprocess per image at shape (1, 3, 640, 640)

bboxes:  [[109  36 654 767]]

使用的姿势视频是EchoMimicV2生成的:

20241127_064839_sig.mp4
@O-O1024
Copy link
Author

O-O1024 commented Dec 4, 2024

😑 换了一个视频又可以了,似乎那个姿势模型会受噪声闪烁干扰

@smthemex
Copy link
Owner

smthemex commented Dec 5, 2024

YOLO首帧无法检测到人体,要么是你说的闪烁,要么是视频首帧是黑色的,我下次更新加个判断吧,

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

2 participants