首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >[deepstream][原创]过滤模型中某些类别

[deepstream][原创]过滤模型中某些类别

作者头像
云未归来
发布2025-07-18 17:44:13
发布2025-07-18 17:44:13
780
举报

比如deepstream中yolov3是80类别,我只想要person这个类别,其他类别过率掉,怎么搞。这个其实很简单,修改插件源码即可

打开nvdsparsebbox_Yolo.cpp源码加个判断即可

static void addBBoxProposal(const float bx, const float by, const float bw, const float bh,

const uint stride, const uint& netW, const uint& netH, const int maxIndex,

const float maxProb, std::vector<NvDsInferParseObjectInfo>& binfo)

{

NvDsInferParseObjectInfo bbi = convertBBox(bx, by, bw, bh, stride, netW, netH);

if (bbi.width < 1 || bbi.height < 1) return;

bbi.detectionConfidence = maxProb;

bbi.classId = maxIndex;

if(bbi.classId==0)

binfo.push_back(bbi);

}

直接加一句if(bbi.classId==0)即可完成过滤任务!

结果展示:

参考文献:

1.Tried to use classId filtering with "infer-on-class-ids" into primary_gie but not working - DeepStream SDK - NVIDIA Developer Forums

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-11-16,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档