TensorRT-For-YOLO-Series icon indicating copy to clipboard operation
TensorRT-For-YOLO-Series copied to clipboard

How to get accuracy metrics .trt models?

Open akashAD98 opened this issue 2 years ago • 4 comments

i just want to compare my yolov7 model with yolov7.trt model , performance, is there any way we can make comparison of model? like precision, recall,accuracy? @Linaom1214

akashAD98 avatar Nov 15 '22 06:11 akashAD98

i just want to compare my yolov7 model with yolov7.trt model , performance, is there any way we can make comparison of model? like precision, recall,accuracy? @Linaom1214

you can refer this file https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/post_training_quantization/pytorch_yolo_series/eval.py

Linaom1214 avatar Nov 15 '22 08:11 Linaom1214

@Linaom1214 for this i need to pass labeled (annotation data) right? but I have inference video (after running .trt model on video ) , so I don't have ground truth , its possible to save the detection result in folder same like yolov7?

akashAD98 avatar Nov 15 '22 08:11 akashAD98

@Linaom1214 for this i need to pass labeled (annotation data) right? but I have inference video (after running .trt model on video ) , so I don't have ground truth , its possible to save the detection result in folder same like yolov7?

save the detect result 'dets' from trt model.

https://github.com/Linaom1214/TensorRT-For-YOLO-Series/blob/71d82d9a3f3a280ff2d3e5783b218af82fb24620/utils/utils.py#L91

you just need a small modify

Linaom1214 avatar Nov 15 '22 13:11 Linaom1214

i printed below this lines https://github.com/Linaom1214/TensorRT-For-YOLO-Series/blob/71d82d9a3f3a280ff2d3e5783b218af82fb24620/utils/utils.py#L318

    print("box",box)
    print("class id ",cls_id)
    print("probablity",score)

& im getting output like

class id  38
probablity 0.443115234375
box [769.5  129.75 817.5  202.5 ]
class id  26
probablity 0.44970703125
box [799.5   137.125 843.5   200.875]
class id  26
probability 0.5942382812

i want to save the frame & there a corresponding text in output folder, how should I get the exact frame number & respective .txt file (inside annotation/detected bbox)

also, put the counter but, don't know whether it will match the correct frame or not image

sorry for this dumb q, just a little help is really appreciated @Linaom1214

akashAD98 avatar Nov 15 '22 16:11 akashAD98