deepcam-cn / yolov5-face

YOLO5Face: Why Reinventing a Face Detector (https://arxiv.org/abs/2105.12931) ECCV Workshops 2022)
GNU General Public License v3.0
2.11k stars 501 forks source link

torch2trt/main.py中有几行代码错误 #222

Open QAQEthan opened 2 years ago

QAQEthan commented 2 years ago

torch2trt/main.py 69~71行,此处cv2.rectangle接收的就是左上角和右下角坐标,这里不需要使用xyxy2xywh,并且也不需要 除以gn进行归一化,landmarks同理。

                xywh = (xyxy2xywh(det[j, :4].view(1, 4)) / gn).view(-1).tolist()
                conf = det[j, 4].cpu().numpy()
                landmarks = (det[j, 5:15].view(1, 10) / gn_lks).view(-1).tolist()

也就是应该和detect_face.py的174~176行一致,但是不知道为什么多写了,修改后为:

                xywh = det[j, :4].view(1, 4).view(-1).tolist()
                conf = det[j, 4].cpu().numpy()
                landmarks = (det[j, 5:15].view(1, 10)).view(-1).tolist()