Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: test_video_swapspecific.py #63

Closed
instant-high opened this issue Jul 23, 2021 · 10 comments
Closed

ERROR: test_video_swapspecific.py #63

instant-high opened this issue Jul 23, 2021 · 10 comments

Comments

@instant-high
Copy link

Since test_video_swapsingle 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_results_dir, '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
Copy link

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

@NNNNAI
Copy link
Collaborator

NNNNAI commented Jul 24, 2021

Did you test on your own video?

@instant-high
Copy link
Author

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
Copy link
Collaborator

NNNNAI commented Jul 24, 2021

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
Copy link
Collaborator

NNNNAI commented Jul 24, 2021

And all the images in the temp result folder are swapped

@instant-high
Copy link
Author

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
Copy link
Author

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

@NNNNAI
Copy link
Collaborator

NNNNAI commented Jul 24, 2021

Could you provide the full Traceback report?

@instant-high
Copy link
Author

instant-high commented Jul 24, 2021

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
Copy link
Collaborator

NNNNAI commented Jul 24, 2021

Never mind. Have a nice day~.

@NNNNAI NNNNAI closed this as completed Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants