Closed instant-high closed 3 years ago
The problem is that you cannot iterate over swaped_imgs
for some reason here.
Did you test on your own video?
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)
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?
And all the images in the temp result folder are swapped
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?
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):
Could you provide the full Traceback report?
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
Never mind. Have a nice day~.
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