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 316 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' #113

Closed htzheng closed 3 years ago

htzheng commented 3 years ago

When running the demo script

python demo/appearance_transfer.py --gpu_ids 1 \
   --image_size 512 \
   --num_source 2   \
   --output_dir "./results" \
   --assets_dir "./assets"  \
   --model_id   "afan_6=ns=2+trump" \
   --src_path   "path?=./assets/samples/sources/donald_trump_2/00000.PNG,name?=donald_trump_2,parts?=head|path?=./assets/samples/sources/afan_6/afan_6=ns=2,name?=afan_6=ns=2,bg_path?=./assets/samples/sources/afan_6/IMG_7217.JPG,parts?=body" \
   --ref_path   "path?=./assets/samples/references/akun_1.mp4,name?=akun_1,pose_fc?=300"

I got an error

100%|█████████████████████████████████████████████| 2/2 [00:00<00:00,  7.69it/s]
    1.4 Preprocessing, finish run human matting.
    1.5 Preprocessing, running Preprocessor to find 25 candidates front images in ./results/primitives/afan_6=ns=2/processed/images ...
100%|█████████████████████████████████████████████| 2/2 [00:00<00:00, 82.06it/s]
    1.5 Preprocessing, finish find the front images ....
    1.6 Preprocessing, running Preprocessor to run background inpainting ...
100%|█████████████████████████████████████████████| 2/2 [00:00<00:00,  3.39it/s]
    1.6 Preprocessing, finish run background inpainting ....
    1.7 Preprocessing, saving visualization to ./results/primitives/afan_6=ns=2/processed/visual.mp4 ...
100%|█████████████████████████████████████████████| 2/2 [00:00<00:00,  3.93it/s]
ffmpeg -y -i ./results/primitives/afan_6=ns=2/processed/visual.mp4.avi -vcodec h264 ./results/primitives/afan_6=ns=2/processed/visual.mp4 -loglevel quiet
    1.7 Preprocessing, saving visualization to ./results/primitives/afan_6=ns=2/processed/visual.mp4 ...
Preprocessor has finished...
Writing frames to file: done!
    1.1 Preprocessing, running Preprocessor to detect the human boxes of ./results/primitives/akun_1/processed/orig_images...
100%|████████████████████████████████████████▉| 868/869 [01:36<00:00,  8.97it/s]
Process PreprocessConsumer_1:
Traceback (most recent call last):
  File "/home/iPERCore/iPERCore/services/preprocess.py", line 63, in run
    parser=False, find_front=False, visual=False
  File "/home/iPERCore/iPERCore/tools/processors/base_preprocessor.py", line 83, in execute
    self._execute_detector(processed_info, factor=factor)
  File "/home/iPERCore/iPERCore/tools/processors/base_preprocessor.py", line 185, in _execute_detector
    cur_shape = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'

Not sure if that a bug.

justinjohn0306 commented 3 years ago

change the GPU ID from 1 to 0 so it looks like this: python demo/appearance_transfer.py --gpu_ids 0 \

If it's Windows machine the correct format is: python demo/appearance_transfer.py --gpu_ids 0 --image_size 512 --num_source 2 --output_dir "./results" --assets_dir "./assets" --model_id "afan_6=ns=2+trump" --src_path "path?=./assets/samples/sources/donald_trump_2/00000.PNG,name?=donald_trump_2,parts?=head|path?=./assets/samples/sources/afan_6/afan_6=ns=2,name?=afan_6=ns=2,bg_path?=./assets/samples/sources/afan_6/IMG_7217.JPG,parts?=body" --ref_path "path?=./assets/samples/references/akun_1.mp4,name?=akun_1,pose_fc?=300"

htzheng commented 3 years ago

I figure out error is caused by an accidental delete of the asset folder.