Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yolov5-face inference ’camera input’ FPS is lower than normal yolov5? #258

Open
NoNounknow opened this issue Jul 5, 2023 · 2 comments

Comments

@NoNounknow
Copy link

NoNounknow commented Jul 5, 2023

English is not my native language; please excuse typing errors.
“我在使用摄像头输入的数据用以推理的时候发现帧数只有5FPS左右,而使用原版的YOLOV5却有20FPS”
"When I used the data input from the camera for inference, I found that the frame rate was only about 5FPS, while the original YOLOV5 had 20FPS."
以下是我的代码:
Here's my code:

model = torch.hub.load('D:/dl/code/yolov5-face',
                       'custom',
                       'face.pt',
                       source='local')
cap = cv2.VideoCapture(0)
while True:
    ret,frame = cap.read()
    img_cvt = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
    results = model(img_cvt)
    results_ = results.xyxy[0].numpy()
    for box in results_:
        l,t,r,b = box[:4].astype('int')
        imgd = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
        cv2.rectangle(imgd,(r,b),(l,t),(0,255,0),2)
    cv2.imshow("result",imgd)

I understand now that the default inference device for YOLOv5 Face is the CPU.
Now, I'm trying to perform GPU inference with YOLOv5 Face.

@zryzds
Copy link

zryzds commented Jul 22, 2023

我也想加入摄像头,方便留下联系方式交流一下吗。打扰了

@NoNounknow
Copy link
Author

NoNounknow commented Jul 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants