Custom Semantic Segmentation Parser

How do I add a custom semantic segmentation parser to DeepStream? Looking at the docs for nvinfer there’s parse-bbox-func-name for detections and parse-bbox-instance-mask-func-name for instance segmentation, but I can’t see any for semantic segmentation. I tried using the built in one but it’s not working properly. It only gets the width and height right, the number of classes is set to 0.

Is my only choice to set network-type to 100 (custom) and parse the tensors and then add a NvDsInferSegmentationMeta to the batch?

Looking through the code for NvDsInferStatus SegmentPostprocessor::fillSegmentationOutputI can see why it’s not working. It’s assuming the first tensor is the tensor with probabilities. Because I’m using DeepLab V3 I get 4 tensors and the first one is the predictions:

1 OUTPUT kFLOAT RawSemanticPredictions 800x800
2 OUTPUT kFLOAT RawSemanticProbabilities 800x800x6
3 OUTPUT kFLOAT SemanticProbabilities 800x800x6
4 OUTPUT kINT32 SemanticPredictions 800x800

So you figure out the root cause, let me know if need more help.