neuralchen / SimSwap

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

TypeError: RetinaFace.detect() got an unexpected keyword argument 'threshold' #407

Open phpdesigner opened 1 year ago

phpdesigner commented 1 year ago

i just use: python test_video_swapsingle.py --crop_size 224 --use_mask --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path ./demo_file/Iron_man.jpg --video_path ./demo_file/multi_people_1080p.mp4 --output_path ./output/multi_test_swapsingle.mp4 --temp_path ./temp_results

it's not work. err:

Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', 'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': '18446744073709551615', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', 'tunable_op_enabled': '0'}, 'CPUExecutionProvider': {}} find model: ./insightface_func/models\antelope\glintr100.onnx recognition Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'do_copy_in_default_stream': '1', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', 'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': '18446744073709551615', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_use_max_workspace': '1', 'cudnn_conv1d_pad_to_nc1d': '0', 'tunable_op_enabled': '0'}, 'CPUExecutionProvider': {}} find model: ./insightface_func/models\antelope\scrfd_10g_bnkps.onnx detection set det-size: (640, 640) Traceback (most recent call last): File "E:\openai\faceswap\SimSwap\test_video_swapsingle.py", line 64, in img_a_aligncrop, = app.get(img_a_whole,crop_size) File "E:\openai\faceswap\SimSwap\insightface_func\face_detect_crop_single.py", line 64, in get bboxes, kpss = self.det_model.detect(img, TypeError: RetinaFace.detect() got an unexpected keyword argument 'threshold'

phpdesigner commented 1 year ago

torch 2.0.1+cu118 torchaudio 2.0.2+cu118 torchvision 0.15.2+cu118 onnx 1.14.0 onnxruntime-gpu 1.14.1 opencv-python 4.7.0.72 opencv-python-headless 4.7.0.72 moviepy 1.0.3 imageio 2.28.1 insightface 0.7.3

weTerence commented 1 year ago

@phpdesigner The problem was caused by the wrong version of torch. I tried torch==1.12 and then the bug was gone

woctezuma commented 11 months ago

Related:

I can fix this with: