Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'cv2' has no attribute 'cvtColor' #34

Open
phattydee opened this issue Apr 22, 2024 · 1 comment
Open

AttributeError: module 'cv2' has no attribute 'cvtColor' #34

phattydee opened this issue Apr 22, 2024 · 1 comment

Comments

@phattydee
Copy link

I'm using instant style through Pinokio and keep getting this error using the default settings applying a style to another photograph...

here's the full error... any help appreciated.

Traceback (most recent call last):
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\gradio\queueing.py", line 527, in process_events
response = await route_utils.call_process_api(
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\gradio\route_utils.py", line 261, in call_process_api
output = await app.get_blocks().process_api(
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\gradio\blocks.py", line 1788, in process_api
result = await self.call_function(
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\gradio\blocks.py", line 1340, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\anyio_backends_asyncio.py", line 2144, in run_sync_in_worker_thread
return await future
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\anyio_backends_asyncio.py", line 851, in run
result = context.run(func, *args)
File "D:\pinokio\api\instantstyle.git\app\env\lib\site-packages\gradio\utils.py", line 759, in wrapper
response = f(*args, **kwargs)
File "D:\pinokio\api\instantstyle.git\app\app.py", line 178, in create_image
cv_input_image = pil_to_cv2(input_image)
File "D:\pinokio\api\instantstyle.git\app\app.py", line 218, in pil_to_cv2
image_cv2 = cv2.cvtColor(image_np, cv2.COLOR_RGB2BGR)
AttributeError: module 'cv2' has no attribute 'cvtColor'

@haofanwang
Copy link
Member

Try

pip install opencv-python
pip install opencv-contrib-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants