Deepstream 学习
source-list group 和 source-attr-all group 是拥有多个source的时候source group的进阶版,这里source list 主要声明uri, souce-attr-all除了uri其余和source group完全相同。
主要参考博客
bbox的主要设置在osd group中,但是Primary gie group中bbox-border-colorid 和 bbox-bg-colorid可以给label中不同类别设置不同的形式。
1.source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt
【source 0】
num-source=4
【source 1】
num-source=4
代表这个source 0 source1里面分别有4个源,共有8个
sink0 sink1 sink2分别是三种对结果的操作方式:
直接显示、保存为视频文件、转为RTSP视频流,
这里只能enable一种sink,其他两种enable置0。
【primary gie】中的config file 中:
【class-attrs-all】表示对所有labels的操作
【class-attrs-0】表示对id为0的label的操作
【primary gie】
【secondary-gie0】
【secondary-gie1】
他们几个是等价的,每一个gie中使用不同的config file,来实现对不同source的不同目的的检测。如primary检测人、车、自行车。secondary检测车的种类。最后视频播放中每一个source都被四种gie检测过,即每一个source都会输出类似车、绿色、轿车、奔驰这样的信息。而不是每一个source只被一种gie检测过,只能输出车或颜色或汽车种类或汽车品牌四种中的一种。
有多个source的时候,display时需要左键点击某一个source放大才能看到更多信息。
2.source4_1080p_dec_preprocess_infer-resnet_preprocess_sgie_tiled_display_int8.txt :
描述:Demonstrates four stream decodes with preprocess plugin in PGIE mode followed by primary inferencing, preprocess plugin in SGIE mode, and three different secondary classifiers. (For dGPU and Jetson AGX Xavier platforms only.)
这个sample的重点在于它的prepocess过程,文件config_prepocess.txt文件里声明了三个group,
其中group0的src-ids为-1,表示对默认的没有在其他group中处理的所有source进行操作,这里group1 2 分别对source 2 3进行操作,那么group0就对source0 1 进行了roi区域的选定。
参数roi-params-src-id在一个group中只有一个会生效,即使在src-ids =-1时,可以对多个source处理的时候,也只会使用第一个参数,不能给不同的source分别使用不同的roi,必须得另外加group
问题1:从结果上来看,每个source中都只执行了primary gie,其余secondary gie都没有使用到。理论上检测结果应该是和1中txt的检测结果是一致的
问题2: second preprocess的作用,注释掉仍然可以运行,猜想是对preprocess的补充作用,声明了一些更加具体的信息如input object min width等
preprocess group 文件指南
3.source1_csi_dec_infer_resnet_int8.txt
这个的source 0是使用CSI摄像头的,将source0改为uri,可以正常运行。
4.source1_usb_dec_infer_resnet_int8.txt
这个的source 0是使用USB摄像头的,将source0改为uri,可以正常运行。
5.source2_1080p_dec_infer-resnet_demux_int8.txt
这里两个sink都是enable的,sink0的source-id 为0,sink1的source-id为1.这里实现了将两个视频分别保存。
问题:2中sink0的source id为0,为什么还能显示4个source???
猜想是只有一个sink enable的时候,那么所有source都会从这个sink执行。
5.source2_csi_usb_dec_infer_resnet_int8.txt
相当于3,4的结合,一个source为usb camera,另一个source为csi camera
6.source30_1080p_dec_infer-resnet_tiled_display_int8.txt
只有一个primary gie , source 0 和 source 1分别有15个source。
7.source30_1080p_dec_preprocess_infer-resnet_tiled_display_int8.txt
6的基础上加了preprocess
preprocess 中的group0 对source2 source3 以外的所有source进行操作。
gie中的model engine文件的名称:resnet10.caffemodel_b1_gpu0_int8.engine
其中的b1表示 batch_size1,
例如source4 中的primary gie 的batchsize4 使用的model 是:resnet10.caffemodel_b4_gpu0_int8.engine
secondary gie的batchsize16 使用的model是resnet10.caffemodel_b16_gpu0_int8.engine
source30 中primary gie的batchsize60 使用的model是 resnet10.caffemodel_b60_gpu0_int8.engine