SimSwap icon indicating copy to clipboard operation
SimSwap copied to clipboard

TypeError: 'NoneType' object is not iterable

Open sao-g opened this issue 2 years ago • 2 comments

i keep getting the above error. Of the 26 faces i've used, only one successfully returns a swap. All else gives this error. Any help is appreciated. i'm VERY new to this. Full error code:

set det-size: (640, 640) Traceback (most recent call last): File "test_wholeimage_swapsingle.py", line 62, in img_a_align_crop, _ = app.get(img_a_whole,crop_size) TypeError: 'NoneType' object is not iterable

sao-g avatar Mar 11 '22 22:03 sao-g

Hello, you can find your solution here: https://github.com/neuralchen/SimSwap/issues/39#issuecomment-873758730

You should reduce the face detection threshold in test_wholeimage_swapsingle.py for the following code:

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

BeaverInGreenland avatar May 25 '22 09:05 BeaverInGreenland

Hello, you can find your solution here: #39 (comment)

You should reduce the face detection threshold in test_wholeimage_swapsingle.py for the following code:

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

This is correct !! A detection threshold of 0.2 works well for me, even for side faces. Insight Face library (that the authors use for face detection) looks crappy though, as some very clear faces are detected with quite low probability - Or their models suffer from adversarial problems !!

sukritshankar avatar Jan 19 '23 17:01 sukritshankar