diffus-me / sd-webui-facefusion

Next generation face swapper and enhancer
https://join.facefusion.io
88 stars 11 forks source link

cv2.error #19

Open Tbrock8905 opened 8 months ago

Tbrock8905 commented 8 months ago

I see a similar post but no solutions so trying again with the same problem.

Installed the extension on automatic1111

Face recognition works and frame preview does too. When I click start, it gives me this error

cv2.destroyAllWindows() # pylint: disable=no-member cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1266: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'

ReppiksProductions commented 8 months ago

I'm having the same issue. I am running SD on Runpod.io so it is not on windows. Here is my logs and I have the final error in bold text below. My error doesn't say the directory is "D:\a..." but it seem to be the same issue. The problem this causes is that everything works up until the point I "START" under the output box and an error pops up in that box. I've attach a photo of the visual error.

2024-01-14T08:11:39.726827428Z File "/workspace/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict 2024-01-14T08:11:39.726831195Z output = await app.get_blocks().process_api( 2024-01-14T08:11:39.726832818Z File "/workspace/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api 2024-01-14T08:11:39.726834421Z result = await self.call_function( 2024-01-14T08:11:39.726835513Z File "/workspace/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function 2024-01-14T08:11:39.726836626Z prediction = await anyio.to_thread.run_sync( 2024-01-14T08:11:39.726837818Z File "/workspace/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync 2024-01-14T08:11:39.726838920Z return await get_asynclib().run_sync_in_worker_thread( 2024-01-14T08:11:39.726840503Z File "/workspace/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread 2024-01-14T08:11:39.726852706Z return await future 2024-01-14T08:11:39.726854509Z File "/workspace/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run 2024-01-14T08:11:39.726855952Z result = context.run(func, args) 2024-01-14T08:11:39.726857084Z File "/workspace/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper 2024-01-14T08:11:39.726858146Z response = f(args, kwargs) 2024-01-14T08:11:39.726859719Z File "/workspace/stable-diffusion-webui/extensions/sd-webui-facefusion/facefusion/uis/components/output.py", line 51, in start 2024-01-14T08:11:39.726860861Z conditional_process() 2024-01-14T08:11:39.726862344Z File "/workspace/stable-diffusion-webui/extensions/sd-webui-facefusion/facefusion/core.py", line 192, in conditional_process 2024-01-14T08:11:39.726863607Z process_video() 2024-01-14T08:11:39.726864649Z File "/workspace/stable-diffusion-webui/extensions/sd-webui-facefusion/facefusion/core.py", line 216, in process_video 2024-01-14T08:11:39.726865761Z if predict_video(facefusion.globals.target_path): 2024-01-14T08:11:39.726866913Z File "/workspace/stable-diffusion-webui/extensions/sd-webui-facefusion/facefusion/predictor.py", line 57, in predictvideo 2024-01-14T08:11:39.726868035Z , probabilities = opennsfw2.predict_video_frames(video_path = video_path, frame_interval = FRAME_INTERVAL) 2024-01-14T08:11:39.726869147Z File "/workspace/venv/lib/python3.10/site-packages/opennsfw2/_inference.py", line 229, in predict_video_frames 2024-01-14T08:11:39.726870259Z cv2.destroyAllWindows() # pylint: disable=no-member 2024-01-14T08:11:39.726876642Z cv2.error: OpenCV(4.9.0) /io/opencv/modules/highgui/src/window.cpp:1266: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'**

FaceFusion error

Kekulkan commented 8 months ago

the same problem

Tbrock8905 commented 7 months ago

Found solution. opencv version is likely wrong. Have to install a previous version

Go to facefusion folder, open cmd, then:

then acvitate venv with: python -m venv venv venv\Scripts\activate

pip uninstall opencv-python opencv-python-headless

pip install opencv-python==4.8.1.78

Zhaze commented 7 months ago

I have the same issue also showing: "cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1266: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'" r

Reinstallation of opencv-python did not help.

Anyone figure this out?

Liusdaooo commented 2 months ago

Oh, damn it, I also have the same problem. Can you tell me how to solve it? 37 37

theSplund commented 2 months ago

Reinstallation of opencv-python didn't help me either.