1adrianb / 1adrianb/face-alignment

Detector fails with gray images

オープン
#154 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
7.5k
フォーク
1.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

When dealing with single channel images, the following error was raised:
`Traceback (most recent call last):
File "face_align.py", line 5, in
lms = fa.get_landmarks_from_directory(dir)
File "/usr/local/lib/python3.5/dist-packages/face_alignment/api.py", line 223, in get_landmarks_from_directory
detected_faces = self.face_detector.detect_from_directory(path, extensions, recursive, show_progress_bar)
File "/usr/local/lib/python3.5/dist-packages/face_alignment/detection/core.py", line 97, in detect_from_directory
predictions[image_path] = self.detect_from_image(image_path)
File "/usr/local/lib/python3.5/dist-packages/face_alignment/detection/sfd/sfd_detector.py", line 51, in detect_from_image
bboxlist = detect(self.face_detector, image, device=self.device)
File "/usr/local/lib/python3.5/dist-packages/face_alignment/detection/sfd/detect.py", line 20, in detect
img = img - np.array([104, 117, 123])
ValueError: operands could not be broadcast together with shapes (398,377) (3,)`

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The error occurs in face_alignment/detection/sfd/detect.py line 20 where a single-channel image cannot subtract a 3-channel array. Start by reading the detect function and the SFD detector's image loading logic. Check how images are converted to RGB and handle grayscale inputs. Run the failing test with a grayscale image to reproduce the error, then modify the preprocessing step to support single-channel images.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, pytorch
領域
computer-vision
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。