neuralchen / SimSwap

An arbitrary face-swapping framework on images and videos with one single trained model!
Other
4.56k stars 897 forks source link

TypeError: cannot unpack non-iterable NoneType object #39

Open loboere opened 3 years ago

loboere commented 3 years ago

when I use an custom image I get this

-------------- End ----------------
input mean and std: 127.5 127.5
find model: ./insightface_func/models/antelope/glintr100.onnx recognition
find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection
set det-size: (640, 640)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-c61bb4ca883a> in <module>()
     23 # img_a = Image.open(pic_a).convert('RGB')
     24 img_a_whole = cv2.imread(pic_a)
---> 25 img_a_align_crop, _ = app.get(img_a_whole,crop_size)
     26 img_a_align_crop_pil = Image.fromarray(cv2.cvtColor(img_a_align_crop[0],cv2.COLOR_BGR2RGB))
     27 img_a = transformer_Arcface(img_a_align_crop_pil)

TypeError: cannot unpack non-iterable NoneType object
NNNNAI commented 3 years ago

Could you show me your full command line ? Cause i cannot identify which command you are using.Many thanks.

loboere commented 3 years ago

is the last cell of the colab just change iron man for another face

AceSix commented 3 years ago

Hello, it seems this error is caused by face detection failure in the source image your provided. You can try to turn down det_thresh in the app.prepare function in the last cell, right after model creation:

app = Face_detect_crop(name='antelope', root='./insightface_func/models')
app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640))

or use another image.