SimSwap
SimSwap copied to clipboard
Total new to all this please help
I followed the tutorial exactly however when i try to run it i get this
Traceback (most recent call last):
File "test_video_swapsingle.py", line 58, in
Any help would be great thank you.
Hello. Try this out.
In any of the swap scripts that your using, find the line that looks like this.
https://github.com/neuralchen/SimSwap/blob/dd1ecdd2a718636d33977ab3097a69a0ecf080d8/test_video_swapsingle.py#L58
Then add this parameter at the end.
app = Face_detect_crop(name='antelope', root='./insightface_func/models', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) # <--- Add this
Let us know if that works for you.
I've had the same problem and I tried adding the providers. However, now I am getting this:
app = Face_detect_crop(name='antelope', root='./insightface_func/models', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) TypeError: init() got an unexpected keyword argument 'providers'
I've had the same problem and I tried adding the providers. However, now I am getting this:
app = Face_detect_crop(name='antelope', root='./insightface_func/models', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) TypeError: init() got an unexpected keyword argument 'providers'
Sorry, missed a step :).
An easier way would be to remove the providers and uninstall onnxruntime-gpu, and follow with pip install onnxruntime==1.8.0
If you want to use a GPU with onnxruntime, you have to open face_detect_crop_single.py and add the providers in the Face_detect_crop class.
At this part:
https://github.com/neuralchen/SimSwap/blob/dd1ecdd2a718636d33977ab3097a69a0ecf080d8/insightface_func/face_detect_crop_single.py#L31
Add in:
def __init__(self, name, root='~/.insightface/models/',providers=None): # Yes None, this is not a typo.
After line 39 and before line 40 (so make a new line),
https://github.com/neuralchen/SimSwap/blob/dd1ecdd2a718636d33977ab3097a69a0ecf080d8/insightface_func/face_detect_crop_single.py#L39
Add in the necessary conditional operations (if else):
if onnx_file.find('_selfgen_')>0:
#print('ignore:', onnx_file)
continue
if providers is not None:
model = model_zoo.get_model(onnx_file, providers=providers )
else:
model = model_zoo.get_model(onnx_file)
if model.taskname not in self.models:
Try this and let us know your results.
Not the OP, but there are some more changes needed to pass it further upto the onnx inference object.
I've the same problem and I didn't solve the issue can you specify the other needed changes to make it work. Cause even with ExponentialML corrections I still get the same error.