Skip to content

feat: YoloSegPostprocess plugin + shared parallel NMS helpers - #320

Open
triple-mu wants to merge 3 commits into
mainfrom
feat/seg-plugin
Open

feat: YoloSegPostprocess plugin + shared parallel NMS helpers#320
triple-mu wants to merge 3 commits into
mainfrom
feat/seg-plugin

Conversation

@triple-mu

@triple-mu triple-mu commented Jun 10, 2026

Copy link
Copy Markdown
Owner

YoloSegPostprocess 插件 + 共享 NMS 助手 + 并行 NMS(自包含)

后处理插件家族第二个。新增 seg 插件(decode+NMS,gather 32 维 mask 系数;proto 矩阵乘/拼装仍在 host),并抽取共享 nms_common.cuh

NMS 为并行版(EfficientNMS 式、无依赖):每候选一线程,被任意更高分同类重叠框(>iou_thr)抑制 → flag;再单线程 compact 按分取 topk(无 IoU);保留 cub 排序维持 topk 按分。det 也在本 PR 重构到共享并行 suppress。

  • 共享 suppress_xyxy_kernel(det/seg);workspace 加 flag 数组。
  • PostSeg.plugin + export-seg.py --pluginengine.py 按属性名在全图定位 NMS 节点;segment.cpp 按 binding 名自动识别。

实测(det 插件引擎):conf 0.25 结果不变、~1.3ms;conf 0.001(数百候选)5.78→1.65ms(3.5×)。分离目标 parallel==greedy(bus.jpg seg 仍 6 目标)。TRT 8.6/10.16/11.0 编译。

栈在 #319 之上。

🤖 Generated with Claude Code

triple-mu and others added 3 commits June 10, 2026 17:09
Raw uint8 image -> NCHW float input via a CUDA kernel (letterbox + RGB + /255),
staged through a pinned host buffer for a fast async H2D. Opt-in, default-off;
the CPU path is unchanged. CMake enables CUDA only when nvcc is found.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Opt-in custom plugin (libyolov8_plugins.so, BUILD_PLUGINS=ON) fusing YOLOv8
detection decode + NMS + top-k as an alternative to EfficientNMS_TRT; consumes
the decoded boxes+scores and emits num_dets/bboxes/scores/labels. Plugin .so
loaded via --plugin-lib / $YOLOV8_PLUGIN_LIB (Python ctypes + C++ dlopen);
detect.cpp auto-detects raw vs End2End/plugin engines. export-det.py --plugin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the seg plugin (decode+NMS, gathers 32 mask coeffs; proto matmul stays on
host) and extracts shared helpers into nms_common.cuh. NMS is parallel
(EfficientNMS-style: one thread per candidate marks suppression vs higher-scoring
overlaps; single-thread compaction gathers top-k) — det refactored onto the shared
parallel suppression too. PostSeg.plugin + export-seg.py --plugin; engine.py finds
the NMS node by attribute name anywhere in the graph; segment.cpp auto-detects.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@triple-mu triple-mu changed the title feat: YoloSegPostprocess plugin + shared NMS helpers feat: YoloSegPostprocess plugin + shared parallel NMS helpers Jun 10, 2026
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

Successfully merging this pull request may close these issues.

1 participant