NVlabs / few-shot-vid2vid

Pytorch implementation for few-shot photorealistic video-to-video translation.
Other
1.8k stars 275 forks source link

How to run 'n_shot' inference? #23

Closed howardgriffin closed 4 years ago

howardgriffin commented 4 years ago

I have noticed that there is an "n_shot" parameter in the base_options.py. When testing the pose datasets, I have 5 reference images to be pose transfered, so I set "n_shot" to 5. Howevery, I got only one reference image in the result directory. I wonder if this means that only one reference image is used for testing?Is there any advice for me?

rainingDesert commented 4 years ago

I have noticed that there is an "n_shot" parameter in the base_options.py. When testing the pose datasets, I have 5 reference images to be pose transfered, so I set "n_shot" to 5. Howevery, I got only one reference image in the result directory. I wonder if this means that only one reference image is used for testing?Is there any advice for me?

I think so. I print the shape of data["ref_image"], and saw only one image are input to the model. I think "n_shot" is only used for training, while inference should modify "ref_img_id". Related code can be saw in function "get_video_params" of file "./data/base_dataset.py".

Moreover, you need to modify the first two lines of function "concat_frame" in file "./data/base_dataset.py". I don't know the reason why these are added. I tried multiple reference images for face transferred, and the result looks fine.

tcwang0509 commented 4 years ago

Yes, you will need to specify both n_shot and the frame indices you want to use in the command.