neuralchen / SimSwap

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

I feel that the processing speed is a little slow #91

Open wubangjunjava opened 3 years ago

wubangjunjava commented 3 years ago

I feel that the processing speed is a little slow. How can I improve it? It takes too long for a video to be processed.

NNNNAI commented 3 years ago

You can install the gpu version of onnx, the time to process a video will be greatly reduced. Using the command line below should be fine:

pip install onnxruntime-gpu==1.2.0

(Note: the version of onnxruntime-gpu may vary,which depend on you cuda version)

wubangjunjava commented 3 years ago

You can install the gpu version of onnx, the time to process a video will be greatly reduced. Using the command line below should be fine:

pip install onnxruntime-gpu==1.2.0

(Note: the version of onnxruntime-gpu may vary,which depend on you cuda version)

thank you. Problem solving.

ramnnv commented 3 years ago

You can install the gpu version of onnx, the time to process a video will be greatly reduced. Using the command line below should be fine:

pip install onnxruntime-gpu==1.2.0

(Note: the version of onnxruntime-gpu may vary,which depend on you cuda version)

Hi. My installation of SimSwap was doing great and working perfectly, but i update to onnxruntime and now im getting error and not working. May you help me to know what i doing wrong please, im newbie with all of this but i want to try that speed improvement. Thank you for all your work.

I have Windows 10, GTX 1060 6gb and my SimSwap installation are on my second hard drive (E:)

C:\Users\ramnnv\anaconda3\envs\simswap\lib\site-packages\onnxruntime\capi_pybind_state.py:13: UserWarning: Cannot load onnxruntime.capi. Error: 'DLL load failed: No se puede encontrar el módulo especificado.' warnings.warn("Cannot load onnxruntime.capi. Error: '{0}'".format(str(e))) Traceback (most recent call last): File "C:\Users\ramnnv\anaconda3\envs\simswap\lib\site-packages\insightface__init.py", line 8, in import onnxruntime File "C:\Users\ramnnv\anaconda3\envs\simswap\lib\site-packages\onnxruntime\init__.py", line 12, in from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, RunOptions, SessionOptions, set_default_logger_severity, NodeArg, ModelMetadata, GraphOptimizationLevel, ExecutionMode ImportError: cannot import name 'get_all_providers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "test_video_swapsingle.py", line 11, in from insightface_func.face_detect_crop_single import Face_detect_crop File "E:\SimSwap\SimSwap-main\insightface_func\face_detect_crop_single.py", line 8, in from insightface.model_zoo import model_zoo File "C:\Users\ramnnv\anaconda3\envs\simswap\lib\site-packages\insightface__init__.py", line 11, in "Unable to import dependency onnxruntime. " ImportError: Unable to import dependency onnxruntime.

NNNNAI commented 3 years ago

@ramnnv Did you use this command line :pip install onnxruntime-gpu==1.2.0 to install onnx gpu? If so ,you can try to use older version of onnx gpu like 1.1.2 by using pip install onnxruntime-gpu==1.1.2

ramnnv commented 3 years ago

@NNNNAI yes, first i use 1.2.0, then i tried the old version you said (1.1.2), but still getting the same error. Now i back to the cpu onnx and SimSwap it's working again...

NNNNAI commented 3 years ago

@ramnnv which version of cuda did you use.You can type nvcc -V in your terminal to find out the cuda version

ramnnv commented 3 years ago

@NNNNAI CUDA Version: 11.2

NNNNAI commented 3 years ago

As shown in the offcial website of onnx,you could try to install 1.7.0 or 1.8.0 image @ramnnv

ramnnv commented 3 years ago

@NNNNAI I just tried 1.7.0 and 1.8.0 and got the same error, but thank you for trying to help me. In a few days i will reinstall windows, anaconda, gpu drivers, simswap... etc, so let's hope my problem can be solved.

NNNNAI commented 3 years ago

Hope you can solve the problem, have a nice day.

JamesWilson19947 commented 3 years ago

@NNNNAI I just tried 1.7.0 and 1.8.0 and got the same error, but thank you for trying to help me. In a few days i will reinstall windows, anaconda, gpu drivers, simswap... etc, so let's hope my problem can be solved.

Try 1.9.0. I think this should solve your issues.

pip install onnxruntime-gpu==1.9.0