neuralchen / SimSwap

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

ERROR: test_video_swapspecific.py #63

Closed instant-high closed 3 years ago

instant-high commented 3 years ago

Since _test_videoswapsingle is working perfect, first attempt to swap specific face gives following error (after processing a few frames):

Traceback (most recent call last): File "test_video_swapspecific.py", line 83, in model, app, opt.output_path,temp_results_dir=opt.temp_path,no_simswaplogo=opt.no_simswaplogo,use_mask=opt.use_mask) File "C:\Tutorial\SimSwap\util\videoswap_specific.py", line 98, in video_swap os.path.join(temp_resultsdir, 'frame{:0>7d}.jpg'.format(frame_index)),no_simswaplogo,pasring_model =net,use_mask= use_mask, norm = spNorm) File "C:\Tutorial\SimSwap\util\reverse2original.py", line 88, in reverse2wholeimage for swaped_img, mat ,source_img in zip(swaped_imgs, mats,b_align_crop_tenor_list): TypeError: zip argument #1 must support iteration

woctezuma commented 3 years ago

The problem is that you cannot iterate over swaped_imgs for some reason here.

NNNNAI commented 3 years ago

Did you test on your own video?

instant-high commented 3 years ago

No. I used the mulri people video and the specific image from demo files so far. Looks like every specific image gives a different number of frames before the error occurs. But, none of them was swapped... (I opened the images in the temp result folder)

NNNNAI commented 3 years ago

I use the demo command line for test_video_swapspecific.py :

python test_video_swapspecific.py --use_mask --pic_specific_path ./demo_file/specific1.png --isTrain false  --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_specific.mp4 --temp_path ./temp_results 

But it works fine and no error occurs.Did you get the latest version of the code?

NNNNAI commented 3 years ago

And all the images in the temp result folder are swapped

instant-high commented 3 years ago

I've used the given commandline.

it crashes at the moment the specific image is recognized in the video.

I've cropped the video so it only contains 2 faces but the same... if specific face does not appear in the video it works, but nothing to swap ;-)

I'm not sure to have the latest version... SimSwap code should be up to date. Were there changes in pytorch or insightface? I did not update that.

Maybe it is a problem with my GPU - 2GB ? Got that problem with swapsingle at the beginning, (the old version) you remember?

instant-high commented 3 years ago

It runs OK to this point:

_video_path: ./demo_file/crop.mp4 which_epoch: latest -------------- 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_10gbnkps.onnx detection set det-size: (640, 640) (142, 366, 4) 0%| | 0/594 [00:00<?, ?it/s] Traceback (most recent call last):

NNNNAI commented 3 years ago

Could you provide the full Traceback report?

instant-high commented 3 years ago

I'm so sorry.... Now it seems to be working as expected.

I've added some extra parameters to reverse2original.py - reversing to the original file now -> looks like I did something wrong, it works perfect for single swap but causes the error to specific swap.

So it's my mistake. Mybe I did that not based on the latest version

NNNNAI commented 3 years ago

Never mind. Have a nice day~.