kathmandu777 / i-make

第33回全国高専プログラミングコンテスト【自由部門】に向けて開発している「iMake! -3次元仮想メイクで全人類の化粧技術向上-」です。
Other
4 stars 0 forks source link

effect.pyのエラー修正 #17

Closed kathmandu777 closed 2 years ago

kathmandu777 commented 2 years ago

Overview

(base) PS C:\Users\kator\Documents\projects\i-make\gen2-facemesh> python .\main_web_camera.py
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
  File ".\main_web_camera.py", line 55, in <module>
    effected_image_1 = renderer_1.render_effect(target_image, np.array(landmarks))
  File "C:\Users\kator\Documents\projects\i-make\gen2-facemesh\utils\effect.py", line 49, in render_effect
    effect = self.create_effect(target_image, target_landmarks)
  File "C:\Users\kator\Documents\projects\i-make\gen2-facemesh\utils\effect.py", line 91, in create_effect
    cropped_triangle = warp * mask
ValueError: operands could not be broadcast together with shapes (85,133,4) (0,19,4)
[ WARN:0@12.525] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
  File "/Users/kathmandu/projects/i-make/gen2-facemesh/main_web_camera.py", line 55, in <module>
    effected_image_1 = renderer_1.render_effect(target_image, np.array(landmarks))
  File "/Users/kathmandu/projects/i-make/gen2-facemesh/utils/effect.py", line 49, in render_effect
    effect = self.create_effect(target_image, target_landmarks)
  File "/Users/kathmandu/projects/i-make/gen2-facemesh/utils/effect.py", line 86, in create_effect
    cv2.fillConvexPoly(
cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'fillConvexPoly'
> Overload resolution failed:
>  - Layout of the output array img is incompatible with cv::Mat
>  - Expected Ptr<cv::UMat> for argument 'img'

Background of the improvement

Requirements

Considerations

Implementation policy

Test items

Remarks

kathmandu777 commented 2 years ago

顔を画面の端に持っていくと起きる