thohemp / 6DRepNet

Official Pytorch implementation of 6DRepNet: 6D Rotation representation for unconstrained head pose estimation.
MIT License
550 stars 72 forks source link

Could not achieve same results in demo #51

Open tszhang97 opened 11 months ago

tszhang97 commented 11 months ago

I use the code of demo.py and test the video in the demo. The results below look wired. I also test other videos and a common problem is that the results have lots of jitters. https://github.com/thohemp/6DRepNet/assets/39046939/740edd75-7565-4bfa-a82b-0303b7ee9bde

tszhang97 commented 11 months ago

video results: https://github.com/thohemp/6DRepNet/assets/39046939/8f45a2ed-7e46-4a20-bbde-446bea43a3aa

thohemp commented 11 months ago

Did you use my demo video with box visualization as input to process it again?

tszhang97 commented 11 months ago

@thohemp Do you mean this part? I've already used the code below: detector = RetinaFace(gpu_id=gpu) with torch.no_grad(): for frame in img_list: faces = detector(frame) for box, landmarks, score in faces:

Print the location of each face in this image

            if score < .95:
                continue
            x_min = int(box[0])
            y_min = int(box[1])
            x_max = int(box[2])
            y_max = int(box[3])

            bbox_width = abs(x_max - x_min)
            bbox_height = abs(y_max - y_min)

            x_min = max(0, x_min - int(0.2 * bbox_height))
            y_min = max(0, y_min - int(0.2 * bbox_width))
            x_max = x_max + int(0.2 * bbox_height)
            y_max = y_max + int(0.2 * bbox_width)
            img = frame[y_min:y_max, x_min:x_max]