warmshao / FasterLivePortrait

Bring portraits to life in Real Time!onnx/tensorrt support!实时肖像驱动!
455 stars 42 forks source link

KeyError: 'xpose' using last windows package #77

Open real-marshal opened 4 weeks ago

real-marshal commented 4 weeks ago

Downloaded windows-20240811 package and ran app.bat, as soon as I click animate (with is_animal checked) I get the following error:

process source:C:\Users\Real Marshal\AppData\Local\Temp\gradio\ce7df9580e4a7e9505bdce12b11615bcba9c29ad\ComfyUI_temp_vaveg_00003_.png >>>>>>>>
  0%|                                                                                            | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "D:\FasterLivePortrait-windows-20240811\src\pipelines\faster_live_portrait_pipeline.py", line 137, in prepare_source
    lmk = self.model_dict["xpose"].run(
KeyError: 'xpose'
Traceback (most recent call last):
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api
    output = await app.get_blocks().process_api(
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1897, in process_api
    result = await self.call_function(
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1483, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\utils.py", line 816, in wrapper
    response = f(*args, **kwargs)
  File "D:\FasterLivePortrait-windows-20240811\app.py", line 36, in gpu_wrapped_execute_video
    return gradio_pipeline.execute_video(*args, **kwargs)
  File "D:\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 110, in execute_video
    video_path, video_path_concat, total_time = self.run_local(input_driving_video_path, input_source_path,
  File "D:\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 125, in run_local
    raise gr.Error(f"Error in processing source:{source_path} 💥!", duration=5)
gradio.exceptions.Error: 'Error in processing source:C:\\Users\\Real Marshal\\AppData\\Local\\Temp\\gradio\\ce7df9580e4a7e9505bdce12b11615bcba9c29ad\\ComfyUI_temp_vaveg_00003_.png 💥!'
D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\torch\functional.py:513: 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:3610.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
D:\FasterLivePortrait-windows-20240811\src\utils\animal_landmark_runner.py:52: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(model_checkpoint_path, map_location=lambda storage, loc: storage)
D:\FasterLivePortrait-windows-20240811\venv\lib\site-packages\torch\storage.py:414: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  return torch.load(io.BytesIO(b))

The image and video are fine as the original animal live portrait model processes them without any problems.

warmshao commented 4 weeks ago

Downloaded windows-20240811 package and ran app.bat, as soon as I click animate (with is_animal checked) I get the following error:

You may need to wait for a while until all the animal models are loaded. During the loading process

real-marshal commented 4 weeks ago

Thanks, I waited a bit after checking is_animal and it worked. Then I had an error with ffmpeg, in video_has_audio() you call ffmpeg.probe() which fails on windows because it expects ffmpeg in PATH. I had to change video_has_audio(driving_video_path) to video_has_audio(driving_video_path, FFMPEG) and then use this new argument in ffmpeg.probe(video_file, select_streams='a') changing it to ffmpeg.probe(video_file, select_streams='a', cmd=ffmpeg_cmd) to make ffmpeg-python use included ffmpeg instead.