Closed davideschiavon closed 1 year ago
Hello,
filter-out-class-ids < use this function. see this link. https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html?highlight=filter%20out%20class%20ids
You can add this to force all the classes besides 0 to a high conf threshold,
[class-attrs-all]
nms-iou-threshold=0.99
pre-cluster-threshold=0.99
topk=1
[class-attrs-0]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300
or you could simply add the below statement to your config.
operate-on-class-ids=0
It will force nvinfer to only operate on the 0. You can also add more classes with commas like so,
operate-on-class-ids=0,69
Use filter-out-class-ids
.
Example:
Class 0: Car Class 1: Person Class 2: Bike
filter-out-class-ids=0;2
It will show only the person class
I tried operate-on-class-ids , filter-out-class-ids and force all the classes besides 0 to a high conf threshold, but still has the same issue.
The operate-on-class-ids
is for secondary gie. You should use filter-out-class-ids
in the [property]
section to filter the classes (as I said the the example above).
Thank you so much, that works, Also any way to set a different threshold for each class?
You can set like
[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300
[class-attrs-0]
pre-cluster-threshold=0.2
[class-attrs-1]
pre-cluster-threshold=0.5
I tried thia aet as well, the inference result shows that it only concerned the [class-attrs-all] and it didn't care about specific threshold in each class. should I enable anything to make that happen?
Referring to https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html in the Gst-nvinfer File Configuration Specifications
section, setting the class-attr
key as I said is enough to filter the classes.
Hello,
I am trying to detect only "person" (class 0). I have found from the Deepstream documentation that creating a section in the config_infer_primary.txt will enable the option to select a specific class.
I configured [class-attrs-all] to [class-attrs-0] (I also tried 00) but it keeps showing me all classes. Any suggestions?
`[property] gpu-id=0 net-scale-factor=0.0039215697906911373 model-color-format=0 custom-network-config=yolov5s.cfg model-file=yolov5s.wts model-engine-file=model_b1_gpu0_fp32.engine
int8-calib-file=calib.table
labelfile-path=labels.txt batch-size=1 network-mode=0 num-detected-classes=80 interval=0 gie-unique-id=1 process-mode=1 network-type=0 cluster-mode=2 maintain-aspect-ratio=1 parse-bbox-func-name=NvDsInferParseYolo custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so engine-create-func-name=NvDsInferYoloCudaEngineGet
filter-out-class-ids=56
[class-attrs-00] threshold=0.5 nms-iou-threshold=0.45 pre-cluster-threshold=0.25 topk=300 `
Thanks! Dave