Demo inference has five steps, get input, preprocess, model inference, postprocess, decode and draw.
Before this problem, all results are right and you do not do other changes expect RTSP input and decoding. However, from your draw_result code, it is right.
From my experience, if i meat this problem, i will save a picture with wrong result. Then infer this picture on PC with original model to make sure model if model is right. Second, infer this picture on VIM3. In general, it has the same problem. If not, it means picture input and camera input is not the same. And then analyze results and model output to check if decoding is right. Proprocess and postprocess is right. Because if one of them have problem, all results will be incorrect.
Two thing may help you to check.
inference.sh
In convert tool, it can infer first picture in dateset.txt and save input and output.
Run 0_import_model.sh and 1_quantize_model.sh, and then run inference.sh.
NN Tool FAQ (0.5).pdf section 4.2
This doc is in aml_npu_sdk/docs/en. vsi_nn_SaveTensorToTextByFp32 should add in aml_npu_app/detect_library/model_code/detect_yolov8n/yolov8n.c. It is the api for save model origin input and output in txt.
We do not have RTSP camera, so we can not try to reproduce your problem. Above all hopefully will help you.
thank you very much for your detailed explanation and response.
I tested it as you suggested.
As you said, as a result of inferring from the picture on PC and Vim3, the box was drawn normally on PC, but the same problem still occurred on Vim3. So is this a decoding issue? Any idea why I’m having decoding issues? Is there a problem with importing the video as rtsp? I wonder if I have to get it only with a USB cam or mipi cam.
I don’t have a USB camera, so I couldn’t demo it with a USB camera. I’m really sorry, but I can’t give you any pictures due to copyright issues. Could it be that something went wrong with my model conversion?
We will update VIM3 New Demo and update documents in next two weeks. At that time, you can try to use any other model to detect vehicle, like YOLOv8. You can also choose to wait for it.
If you do not want to other get your model and video, you can send a message for me.