bmf
bmf copied to clipboard
请问如何在一个graph内设置两个输出?
运行人脸识别demo(trt_face_detect.py)把判断语句:if (output_queue_size >= 2):屏蔽掉,云溪谷会报错: [2024-05-11 04:09:39.784] [info] node:c_ffmpeg_encoder 3 scheduler 1 [2024-05-11 04:09:39.807] [error] node id:1 catch exception: KeyError: (1,) At: /root/bmf/lvyantest/tensorrt_post/trt_face_detect.py(226): process [2024-05-11 04:09:39.807] [error] node id:1 Process node failed, will exit. [2024-05-11 04:09:39.808] [info] node 1 got exception, close directly [2024-05-11 04:09:39.808] [info] schedule queue 0 start to join thread [2024-05-11 04:09:39.808] [error] node id:1 catch exception: KeyError: (1,)
At: /root/bmf/lvyantest/tensorrt_post/trt_face_detect_ok.py(226): process
[2024-05-11 04:09:39.808] [error] node id:1 Process node failed, will exit.
Traceback (most recent call last):
File "testtrt1.py", line 54, in
我的graph代码如下: 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",
"input_shapes": {
"input": [1, 3, 480, 640]
}}, entry="trt_face_detect_ok.trt_face_detect")
video = video.module("face_postprocess",
entry="face_postprocess.face_postprocess")
video = video.encode(
None, {
"output_path": "./trt_out.mp4",
"video_params": {
"codec": "h264_nvenc",
"bit_rate": 5000000,
"max_fr": 30
}
}
)
video.run()
if name == "main": main() 感谢!
video = module("TWO_OUTPUT"...) stream1 = video.module(...) stream2 = video.module(...)