iPERDance / iPERCore

Liquid Warping GAN with Attention: A Unified Framework for Human Image Synthesis
https://iperdance.github.io/work/impersonator-plus-plus.html
Apache License 2.0
2.42k stars 311 forks source link

Getting error while running on custom image. #45

Open snehitvaddi opened 3 years ago

snehitvaddi commented 3 years ago
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/content/iPERCore/iPERCore/services/preprocess.py", line 153, in run
    except Exception("model error!") as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
        Pre-processing: digital deformation completed...
the current number of sources are 1, while the pre-defined number of sources are 2. 
    Pre-processing: failed...

Whats could be the reason for this error and How can this be resolved?

piaozhx commented 3 years ago

Did you run this code on Colab? Could you provide the full command for debugging?

snehitvaddi commented 3 years ago
model_id = "donald_trump_2"
src_path = ""path?=/content/iPERCore/assets/samples/sources/balayya/bal.PNG,name?=balayya""

ref_path = ""path?=/content/iPERCore/assets/samples/references/akun_1.mp4,"
"name?=akun_2,"
"pose_fc?=300|"
"path?=/content/iPERCore/assets/samples/references/mabaoguo_short.mp4,"
"name?=mabaoguo_short,"
"pose_fc?=400"" 

print(ref_path)

!python -m iPERCore.services.run_imitator
--gpu_ids $gpu_ids
--num_source $num_source
--image_size $image_size
--output_dir $output_dir
--model_id $model_id
--cfg_path $cfg_path
--src_path $src_path
--ref_path $ref_path

This is the command I was trying to run. Before running this command, I created a folder called /balayya in assets/samples/sources with a picture bal.jpg and also replaced name?=donald_trump_2\ with name?=balayya\ Is this the correct implementation?? If not, please mention the steps for testing on Custom images.

piaozhx commented 3 years ago

change model_id = "donald_trump_2" to model_id = "balayya"

If you use "donald_trump_2", it will use the model of "donald_trump_2", which is pretrained by the image of trump.

snehitvaddi commented 3 years ago

Yes, I have changed model_id = "donald_trump_2" to model_id = "balayya" and kept everything as itis. Still, I am facing an error. Command:

model_id = "balayya"

# the source input information, here \" is escape character of double duote "
src_path = "\"path?=/content/iPERCore/assets/samples/sources/balayya/bal.PNG,name?=balayya\""

ref_path = "\"path?=/content/iPERCore/assets/samples/references/akun_1.mp4,"  \
             "name?=akun_2," \
             "pose_fc?=300|" \
             "path?=/content/iPERCore/assets/samples/references/mabaoguo_short.mp4," \
             "name?=mabaoguo_short," \
             "pose_fc?=400\""

print(ref_path)

!python -m iPERCore.services.run_imitator  \
  --gpu_ids     $gpu_ids       \
  --num_source  $num_source    \
  --image_size  $image_size    \
  --output_dir  $output_dir    \
  --model_id    $model_id      \
  --cfg_path    $cfg_path      \
  --src_path    $src_path      \
  --ref_path    $ref_path

Error that I am facing now is:

File "/content/iPERCore/iPERCore/services/options/process_info.py", line 140, in convert_to_src_info
src_infos = read_src_infos(self.vid_infos, num_source)
File "/content/iPERCore/iPERCore/services/options/process_info.py", line 233, in read_src_infos
pad_ids = np.random.choice(src_ids, need_pad)
File "mtrand.pyx", line 908, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/content/iPERCore/iPERCore/services/preprocess.py", line 153, in run
except Exception("model error!") as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
Pre-processing: digital deformation completed...
the current number of sources are 1, while the pre-defined number of sources are 2.
Pre-processing: failed...

Is it fine to use balayya as a model?? bcoz, balayya isn't a pre-trained model right!!

piaozhx commented 3 years ago

@snehitvaddi Remove the results folder and rerun it. Maybe there are some temporary files that have affected the result.

CrossLee1 commented 3 years ago

how to use my custom image for testing, dont know how to upload the custom image.

Yisng commented 1 year ago

I have the same problem. Have you solved this problem? Can you share your experience?