deepinsight / deepinsight/insightface
Just for use "insight_face"!!! get_multi_input() is ok???
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
About detecting multiple faces,Minor change on "get_input": an attribute of FaceModel in face_model.py
def get_multi_input(self, face_img):
"""
get multi-inputs/aligned
"""
ret = self.detector.detect_face(face_img, det_type=self.args.det)
if ret is None:
return None
bboxs, points = ret
if bboxs.shape[0] == 0:
return None
aligned_list = []
for b, p in zip(bboxs, points):
bbox = b[0:4]
points = p.reshape((2, 5)).T
# print(bbox)
# print(points)
# face_acc = b[-1]
# print("Face Acc: {0:.3f}".format(face_acc))
nimg = face_preprocess.preprocess(face_img, bbox, points, image_size='112,112')
nimg = cv2.cvtColor(nimg, cv2.COLOR_BGR2RGB)
aligned = np.transpose(nimg, (2, 0, 1))
aligned_list.append(aligned)
return np.array(aligned_list)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in face_model.py by comparing FaceModel.get_input with the proposed get_multi_input flow, especially detector.detect_face and face_preprocess.preprocess. Use a multi-face image to verify the intended behavior: one aligned RGB, channel-first result per detected face, with no result when detection returns none.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, opencv, python
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100