warmshao / FasterLivePortrait

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

Retargeting function 'landmark' attribute error #68

Closed tivikoff closed 2 months ago

tivikoff commented 2 months ago

When pressing "Retargeting" button it shows error

Traceback (most recent call last):
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1897, in process_api
    result = await self.call_function(
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1483, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\utils.py", line 816, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\app.py", line 40, in gpu_wrapped_execute_image
    return gradio_pipeline.execute_image(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 194, in execute_image
    self.prepare_retargeting(input_image, flag_do_crop)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 233, in prepare_retargeting
    lmk = src_face.landmark  # this is the 106 landmarks from insightface
AttributeError: 'numpy.ndarray' object has no attribute 'landmark'
warmshao commented 2 months ago

When pressing "Retargeting" button it shows error

Traceback (most recent call last):
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1897, in process_api
    result = await self.call_function(
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1483, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\utils.py", line 816, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\app.py", line 40, in gpu_wrapped_execute_image
    return gradio_pipeline.execute_image(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 194, in execute_image
    self.prepare_retargeting(input_image, flag_do_crop)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 233, in prepare_retargeting
    lmk = src_face.landmark  # this is the 106 landmarks from insightface
AttributeError: 'numpy.ndarray' object has no attribute 'landmark'

Got it, It is indeed a bug, and it will be fixed as soon as possible.

warmshao commented 2 months ago

When pressing "Retargeting" button it shows error

Traceback (most recent call last):
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1897, in process_api
    result = await self.call_function(
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\blocks.py", line 1483, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Admin\Neural\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 "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\venv\lib\site-packages\gradio\utils.py", line 816, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\app.py", line 40, in gpu_wrapped_execute_image
    return gradio_pipeline.execute_image(*args, **kwargs)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 194, in execute_image
    self.prepare_retargeting(input_image, flag_do_crop)
  File "C:\Users\Admin\Neural\FasterLivePortrait-windows-20240811\src\pipelines\gradio_live_portrait_pipeline.py", line 233, in prepare_retargeting
    lmk = src_face.landmark  # this is the 106 landmarks from insightface
AttributeError: 'numpy.ndarray' object has no attribute 'landmark'

Got it, It is indeed a bug, and it will be fixed as soon as possible.

Fixed it, Please download the latest source code and then unzip it to overwrite the Windows package. You only need to download the code, which is essentially a patch to avoid having to download the large Windows package again.