yolov8-face-landmarks-opencv-dnn icon indicating copy to clipboard operation
yolov8-face-landmarks-opencv-dnn copied to clipboard

AttributeError: 'tuple' object has no attribute 'flatten'

Open EscaticZheng opened this issue 10 months ago • 2 comments

图片无人脸情况下,cv2.dnn.NMSBoxes输出的indices是空的tuple()。 有人脸情况下输出的是array([2])。 所以if len(indices) > 0: 判断这里是无效的,会在上一句直接报错。烦请修改一下

EscaticZheng avatar Apr 16 '24 03:04 EscaticZheng

在main.py里122行

EscaticZheng avatar Apr 16 '24 03:04 EscaticZheng

对,这个异常情况,需要考虑的

---Original--- From: @.> Date: Tue, Apr 16, 2024 11:21 AM To: @.>; Cc: @.***>; Subject: [hpc203/yolov8-face-landmarks-opencv-dnn] AttributeError: 'tuple'object has no attribute 'flatten' (Issue #13)

图片无人脸情况下,cv2.dnn.NMSBoxes输出的indices是空的tuple()。 有人脸情况下输出的是array([2])。 所以if len(indices) > 0: 判断这里是无效的,会在上一句直接报错。烦请修改一下

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

hpc203 avatar Apr 16 '24 07:04 hpc203