Is it possible to use the --classes argument for the rpicam-apps?

Sorry if this is a stupid question but I’ve read that you can use the --classes argument to choose which labels to omit from yolo. I’ve tried adding it to the .json but it doesn’t work and rpicam-hello --help didn’t show any support for it. Is it possible to do with the rpi-cam-apps or should I move over to the basic pipelines? Also, does it remove the class before inference causing a gain in performance? Thanks in advance

Hi,
If you want to remove some classes from your application you can edit the post-process function in rpicam-apps or in the callback function in Hailo basic pipelines example. The easiest way is to read the label of all detections and remove the ones with the class you do not want.
In Hailo basic pipeline you can remove a detection using:

for detection in detections:
    label = detection.get_label()
    if label == "person":
        roi.remove_object(detection)

It is possible to remove classes from a network and this indeed can lead to a gain in performance but you will probably need to retrain or at least recompile the network.

1 Like

Thank you for replying, I used to filter them out when I was using the coral accelerators, I was just hoping there was a way to do it before inference. Am I right in thinking that training data from my intended location will be better than using generic images?

Training with a specific dataset will give you better results for that specific dataset or images similar to it.
But, you are also in the to risk of over fitting and making your model very specific which will cause it to fail on images which are not so similar.
If the generic model give you good enough accuracy I suggest using it.