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

实时生成视频时出现ValueError错误 #233

Open
BIGshuaishuaishuai opened this issue Dec 3, 2024 · 3 comments
Open

实时生成视频时出现ValueError错误 #233

BIGshuaishuaishuai opened this issue Dec 3, 2024 · 3 comments

Comments

@BIGshuaishuaishuai
Copy link

报错信息:

541
  1%|▍                                                            | 1/136 [00:00<01:59,  1.13it/s]Exception in thread Thread-2 (process_frames):
Traceback (most recent call last):
  File "/home/xll/miniconda3/envs/musetalk/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/home/xll/miniconda3/envs/musetalk/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/xll/MuseTalk/scripts/realtime_inference.py", line 215, in process_frames
    combine_frame = get_image_blending(ori_frame,res_frame,bbox,mask,mask_crop_box)
  File "/home/xll/MuseTalk/musetalk/utils/blending.py", line 93, in get_image_blending
    face_large[y-y_s:y1-y_s, x-x_s:x1-x_s]=face
ValueError: could not broadcast input array from shape (330,261,3) into shape (330,0,3)
100%|███████████████████████████████████████████████████████████| 136/136 [00:12<00:00, 10.66it/s]
Total process time of 541 frames without saving images = 12.757274866104126s

貌似是face对象的第二个维度出现问题?请问应该如何解决

@BIGshuaishuaishuai
Copy link
Author

            mask = self.mask_list_cycle[self.idx%(len(self.mask_list_cycle))]
            mask_crop_box = self.mask_coords_list_cycle[self.idx%(len(self.mask_coords_list_cycle))]
            #combine_frame = get_image(ori_frame,res_frame,bbox)
            combine_frame = get_image_blending(ori_frame,res_frame,bbox,mask,mask_crop_box)

我检查了一下,mask_crop_box这个bbox存在负数的坐标,导致后续get_image_blending切片时索引错误,为什么会产生这样的负数坐标?

@praymich
Copy link

请问你解决了吗?我也遇到这个问题了

@BIGshuaishuaishuai
Copy link
Author

请问你解决了吗?我也遇到这个问题了

作者这部分代码可能写的不是很严谨,可以参考这个回答把代码改一下|
#220 (comment)

另外注意把输入图像脸占画幅的比重缩小一点,离边框远一点。我之前这里出现负数就是因为经过扩散过程后,生成图像脸的像素位置变了,可能越过边框,导致数组溢出

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