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.43k stars 316 forks source link

AttributeError: 'ConfigDict' object has no attribute 'nms' #147

Closed Visciera closed 1 year ago

Visciera commented 2 years ago

I can't really run the Human Mattor...

(iperc) E:\Deepfake Movement\iPERCore-main>python demo/motion_imitate.py --gpu_ids 0 --image_size 512 --num_source 2 --output_dir "./results" --assets_dir "./assets" --model_id "tzuyu" --src_path "path?=./assets/samples/sources/tzuyu/tzuyu.png,name?=tzuyu" --ref_path "path?=./assets/samples/references/FortniteDefaultDanceGreenscreen.mp4,name?=FortniteDefaultDanceGreenscreen,pose_fc?=300" ./assets/executables/ffmpeg-4.3.1-win64-static/bin/ffprobe.exe -show_entries stream=codec_type -of json ./assets/samples/references/FortniteDefaultDanceGreenscreen.mp4 -loglevel error ./assets/executables/ffmpeg-4.3.1-win64-static/bin/ffprobe.exe -v error -select_streams v -of default=noprint_wrappers=1:nokey=1 -show_entries stream=r_frame_rate ./assets/samples/references/FortniteDefaultDanceGreenscreen.mp4 Pre-processing: start... ----------------------MetaProcess---------------------- meta_input: path: ./assets/samples/sources/tzuyu/tzuyu.png bg_path: name: tzuyu primitives_dir: ./results\primitives\tzuyu processed_dir: ./results\primitives\tzuyu\processed vid_info_path: ./results\primitives\tzuyu\processed\vid_info.pkl

----------------------MetaProcess---------------------- meta_input: path: ./assets/samples/references/FortniteDefaultDanceGreenscreen.mp4 bg_path: name: FortniteDefaultDanceGreenscreen audio: ./results\primitives\FortniteDefaultDanceGreenscreen\processed\audio.mp3 fps: 30.0 pose_fc: 300.0 cam_fc: 100 effect: primitives_dir: ./results\primitives\FortniteDefaultDanceGreenscreen processed_dir: ./results\primitives\FortniteDefaultDanceGreenscreen\processed vid_info_path: ./results\primitives\FortniteDefaultDanceGreenscreen\processed\vid_info.pkl

E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\builder.py:53: UserWarning: train_cfg and test_cfg is deprecated, please specify them in model 'please specify them in model', UserWarning) load checkpoint from local path: ./assets/checkpoints/detection/point_rend_r50_caffe_fpn_mstrain_3x_coco-e0ebb6b7.pth load checkpoint from local path: ./assets/checkpoints/mattors/gca_r34_4x10_200k_comp1k_SAD-34.77_20200604_213848-4369bea0.pth load checkpoint from local path: ./assets/checkpoints/inpainting/deepfillv2_256x256_8x2_places_20200619-10d15793.pth load checkpoint from local path: ./assets/checkpoints/restorers/esrgan_psnr_x4c64b23g32_1x16_1000k_div2k_20200420-bf5c993c.pth E:\REPOS\anaconda3\envs\iperc\lib\site-packages\torch\functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2890.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] 1.1 Preprocessing, running Preprocessor to detect the human boxes of ./results\primitives\tzuyu\processed\orig_images... 100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:03<00:00, 3.52s/it] 1.1 Preprocessing, finish detect the human boxes of ./results\primitives\tzuyu\processed\orig_images ... 1.2 Preprocessing, cropping all images in ./results\primitives\tzuyu\processed\orig_images by estimated boxes ... 1it [00:02, 2.01s/it] 1.2 Preprocessing, finish crop the human by boxes, and save them in ./results\primitives\tzuyu\processed\images ... 1.3 Preprocessing, running Preprocessor to 3D pose estimation of all images in./results\primitives\tzuyu\processed\images ... 100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:02<00:00, 2.54s/it] 1.3 Preprocessing, finish 3D pose estimation successfully .... 1.4 Preprocessing, running Preprocessor to run human matting in ./results\primitives\tzuyu\processed\parse ... 0%| | 0/1 [00:00<?, ?it/s]E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\datasets\utils.py:70: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file. 'data pipeline in your config file.', UserWarning) 0%| | 0/1 [00:00<?, ?it/s] Process PreprocessConsumer_0: Traceback (most recent call last): File "E:\Deepfake Movement\iPERCore-main\iPERCore\services\preprocess.py", line 80, in run visual=True, File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\processors\base_preprocessor.py", line 114, in execute self._execute_post_parser(processed_info) File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\processors\preprocessors.py", line 244, in _execute_post_parser out_img_dir, out_parse_dir, valid_img_names, save_visual=False File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\human_mattors\point_render_parser.py", line 222, in run has_person, segm_mask, trimap, pred_alpha = self.run_matting(img_path) File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\human_mattors\point_render_parser.py", line 164, in run_matting has_person, segm_mask, trimap = self.run_detection(img_or_path) File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\human_mattors\point_render_parser.py", line 112, in run_detection result = inference_detector(self.detection_model, img_path) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\apis\inference.py", line 151, in inference_detector results = model(return_loss=False, rescale=True, data) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\torch\nn\modules\module.py", line 1131, in _call_impl return forward_call(*input, *kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmcv\runner\fp16_utils.py", line 98, in new_func return old_func(args, kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\detectors\base.py", line 174, in forward return self.forward_test(img, img_metas, kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\detectors\base.py", line 147, in forward_test return self.simple_test(imgs[0], img_metas[0], kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\detectors\two_stage.py", line 179, in simple_test proposal_list = self.rpn_head.simple_test_rpn(x, img_metas) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\dense_heads\dense_test_mixins.py", line 130, in simple_test_rpn proposal_list = self.get_bboxes(rpn_outs, img_metas=img_metas) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmcv\runner\fp16_utils.py", line 186, in new_func return old_func(args, kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\dense_heads\base_dense_head.py", line 105, in get_bboxes **kwargs) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\dense_heads\rpn_head.py", line 187, in _get_bboxes_single img_shape) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmdet\models\dense_heads\rpn_head.py", line 231, in _bbox_postprocess dets, = batched_nms(proposals, scores, ids, cfg.nms) File "E:\REPOS\anaconda3\envs\iperc\lib\site-packages\mmcv\utils\config.py", line 48, in getattr raise ex AttributeError: 'ConfigDict' object has no attribute 'nms'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\REPOS\anaconda3\envs\iperc\lib\multiprocessing\process.py", line 297, in _bootstrap self.run() File "E:\Deepfake Movement\iPERCore-main\iPERCore\services\preprocess.py", line 83, in run except Exception("model error!") as e: TypeError: catching classes that do not inherit from BaseException is not allowed Pre-processing: digital deformation start... Process HumanDigitalDeformConsumer_0: Traceback (most recent call last): File "E:\REPOS\anaconda3\envs\iperc\lib\multiprocessing\process.py", line 297, in _bootstrap self.run() File "E:\Deepfake Movement\iPERCore-main\iPERCore\services\preprocess.py", line 129, in run part_path=self.opt.part_path File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\human_digitalizer\deformers\clothlinks_deformer.py", line 21, in init self.smpl_link = SmplLinker(smpl_model=smpl_model, part_path=part_path, device=device) File "E:\Deepfake Movement\iPERCore-main\iPERCore\tools\human_digitalizer\deformers\link_utils.py", line 78, in init self.left_leg_verts_idx = np.array(self.smpl_part_info['04_left_leg']['vertex']) KeyError: '04_left_leg' Pre-processing: digital deformation completed... the current number of sources are 1, while the pre-defined number of sources are 2. Pre-processing: failed...

(iperc) E:\Deepfake Movement\iPERCore-main>

haofanwang commented 2 years ago

Got the same error, and I solved it via change '04_left_leg' to '02_left_leg'.

Visciera commented 2 years ago

Got the same error, and I solved it via change '04_left_leg' to '02_left_leg'.

That still doesn't work... can u pls explain the clue on how to fix this?