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

运行人脸检测demo时会一直打印:[info] *** dropping frame 7 at ts 3584。请问:dropping frame是什么意思?是检测时抽帧检测的吗?谢谢 #113

Open
QQiangren opened this issue May 8, 2024 · 4 comments

Comments

@QQiangren
Copy link

我的代码如下:
import torch
import torch.nn.functional as F
import numpy as np
import sys
import time
import tensorrt as trt
import bmf.hml.hmp as mp
from nms import NMS
import PIL
from PIL import Image

def main():
graph1 = graph({'dump_graph':1})

video = graph1.decode({
    "input_path": "./face.mp4",
    #"video_params": {
    #    "hwaccel": "cuda",
    #}
})["video"]

video = video.module("trt_face_detect", {
    "model_path": "./version-RFB-640.engine",
    "label_to_frame": 1,
    "input_shapes": {
        "input": [1, 3, 480, 640]
    }}, entry="trt_face_detect.trt_face_detect")

video = video.encode(
    None, {
        "output_path": "./trt_out.mp4",
        "video_params": {
            "codec": "h264_nvenc",
            "bit_rate": 5000000,
        }
    })

video.run()

if name == "main":
main()

@sfeiwong
Copy link
Collaborator

sfeiwong commented May 8, 2024

这是编码(video.encode)时默认按照25 fps的帧率根据你的输入视频帧率来决定是否丢帧的策略。

@QQiangren
Copy link
Author

麻烦请问编码时默认的25 fps帧率是否可以修改?在哪里可以设置。谢谢

@sfeiwong
Copy link
Collaborator

sfeiwong commented May 9, 2024

可以在encode的参数中配置:
"video_params": {
"max_fr": 30
},
参考bmf文档:https://babitmf.github.io/docs/bmf/api/encode_module/

@QQiangren
Copy link
Author

感谢指导,增加max_fr参数后,可以达到预期目标

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