LeslieZhoa / HeadSwap

This is a HeadSwap project not only face
MIT License
25 stars 8 forks source link

If you get errors in Colab #10

Open gibiee opened 6 months ago

gibiee commented 6 months ago

Try this version : https://colab.research.google.com/drive/1zoRLaQvpqEBLpxk-Vp4MtNnkaku5Lb5t?usp=sharing

I think the face-alignment version seems to be particularly prone to errors.

kampelmuehler commented 5 months ago

In fact face-alignment==1.3.5 is the latest working version.

kampelmuehler commented 5 months ago

I'll take it back. Best to stay with face-alignment==1.3.3 as you do in your version @gibiee

gibiee commented 5 months ago

@kampelmuehler Thanks for your efforts!

Part-Work commented 2 months ago

I run this version, but I got this error in last section.

oup = model.run_single(source_path, target_path, crop_align=True,cat=True)

please help me

ValueError                                Traceback (most recent call last)
[<ipython-input-16-9f1905b26271>](https://localhost:8080/#) in <cell line: 1>()
----> 1 oup = model.run_single(source_path, target_path, crop_align=True,cat=True)
      2 cv2_imshow(oup)

3 frames
[/content/HeadSwap/model/third/Deep3dRec/preprocess.py](https://localhost:8080/#) in align_img(img, lm, lm3D, mask, target_size, rescale_factor)
     75     # processing the image
     76     img_new, lm_new, mask_new = resize_n_crop_img(img, lm, t, s, target_size=target_size, mask=mask)
---> 77     trans_params = np.array([w0, h0, s, t[0], t[1]],dtype=np.float32)
     78 
     79     return trans_params, img_new, lm_new, mask_new

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Try this version : https://colab.research.google.com/drive/1zoRLaQvpqEBLpxk-Vp4MtNnkaku5Lb5t?usp=sharing

I think the face-alignment version seems to be particularly prone to errors.

LeslieZhoa commented 2 months ago

Thanks your reply. You can also change here to face_alignment.LandmarksType.THREE_D

mnotgod96 commented 1 month ago

I run this version, but I got this error in last section.

oup = model.run_single(source_path, target_path, crop_align=True,cat=True)

please help me

ValueError                                Traceback (most recent call last)
[<ipython-input-16-9f1905b26271>](https://localhost:8080/#) in <cell line: 1>()
----> 1 oup = model.run_single(source_path, target_path, crop_align=True,cat=True)
      2 cv2_imshow(oup)

3 frames
[/content/HeadSwap/model/third/Deep3dRec/preprocess.py](https://localhost:8080/#) in align_img(img, lm, lm3D, mask, target_size, rescale_factor)
     75     # processing the image
     76     img_new, lm_new, mask_new = resize_n_crop_img(img, lm, t, s, target_size=target_size, mask=mask)
---> 77     trans_params = np.array([w0, h0, s, t[0], t[1]],dtype=np.float32)
     78 
     79     return trans_params, img_new, lm_new, mask_new

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Try this version : https://colab.research.google.com/drive/1zoRLaQvpqEBLpxk-Vp4MtNnkaku5Lb5t?usp=sharing I think the face-alignment version seems to be particularly prone to errors.

change the line 77 to trans_params = np.array([w0, h0, s, t[0][0], t[1][0]],dtype=np.float32)

GoldenFlash0824 commented 2 weeks ago

I tried on colab, but there is an error like: ![Uploading Capture.JPG…]()

GoldenFlash0824 commented 2 weeks ago

I tried on colab, but there is an error like: Capture