JiehangXie / PaddleBoBo

基于飞桨开发的虚拟主播
GNU General Public License v3.0
1.04k stars 297 forks source link

人脸检测结果为[0 0 0 0] #63

Open iamfoolberg opened 1 year ago

iamfoolberg commented 1 year ago

在/usr/local/python3.7.0/lib/python3.7/site-packages/ppgan/apps/first_order_predictor.py的如下函数中

    def extract_bbox(self, image):
        detector = face_detection.FaceAlignment(
            face_detection.LandmarksType._2D,
            flip_input=False,
            face_detector=self.face_detector)

        h, w, _ = image.shape
        print("extract_box: image height=", h)
        print("extract_box: image width=", w)

        frame = [image]
        #frame = image
        predictions = detector.get_detections_for_image(np.array(frame))
        person_num = len(predictions)
        print("extract_box", "person_num=",person_num)
        if person_num == 0:
            return np.array([])
        results = []
        face_boxs = []
        for rect in predictions:
            print("extract_box: a rect in predictions =", rect)

检测输出始终为:

extract_box: image height= 624
extract_box: image width= 656
extract_box person_num= 1
extract_box: a rect in predictions = (0, 0, 0, 0)
1 persons have been detected
Got a person's face in rect: [0 0 0 0 0]

导致后续无法生成视频。

tangsipeng commented 1 year ago

我也遇到这个问题

jwmemail commented 1 year ago

请问这个问题怎么解决的呀

tangsipeng commented 1 year ago

我记得是版本问题,需要各种试