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

Error with Image OpenCV(4.8.1) #30

Open
Cheety opened this issue Nov 23, 2024 · 2 comments
Open

Error with Image OpenCV(4.8.1) #30

Cheety opened this issue Nov 23, 2024 · 2 comments

Comments

@Cheety
Copy link

Cheety commented Nov 23, 2024

any idea what's wrong? i get this after image upload

` main - ERROR - Error in engine: Failed to modify image: OpenCV(4.8.1) /io/opencv/modules/imgproc/src/imgwarp.cpp:2729: error: (-215:Assertion failed) src.cols >0 && src.rows > 0 in function 'warpAffine'

2024-11-23 23:47:44,251 - main - ERROR - Full traceback:
Traceback (most recent call last):
File "/workspace/FacePoke/engine.py", line 209, in transform_image
mask_ori = await asyncio.to_thread(prepare_paste_back,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/FacePoke/liveportrait/utils/crop.py", line 402, in prepare_paste_back
mask_ori = _transform_img(mask_crop, crop_M_c2o, dsize)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/FacePoke/liveportrait/utils/crop.py", line 33, in _transform_img
return cv2.warpAffine(img, M[:2, :], dsize=_dsize, flags=flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`

@Cheety Cheety changed the title Error with Image Error with Image OpenCV(4.8.1) Nov 23, 2024
@Sakurajima-Pang
Copy link

I have a similar problem
cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\imgwarp.cpp:2729: error: (-215:Assertion failed) src.cols > 0 && src.rows > 0 in function 'cv::warpAffine'

@Sakurajima-Pang
Copy link

I use the integration package made by others (the environment and dependencies are packaged), which can only identify objects, but cannot be modified. At the same time, the same error is reported. Maybe our hardware has some problems. I use gtx1650, CUDA12.7、cuda12.6,torch2.5.1-cu12.4-cp310
FutureWarning: rcondparameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to passrcond=None, to keep using the old, explicitly pass rcond=-1. P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4

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