SSD Detection results not accurate using jpg file

Hello, The SSD in the tensorrt/samples directory is not providing good detection results when using the jpg image format. The default program uses the ppm format which is the uncompressed image format to load the image and i know opencv is a compressed format.
I have checked bus.ppm image as reference to check the detection. I have bus.jpg image of the corresponding ppm image. With ppm image the detection is 87 % truck but with jpg is 63%. And sometimes jpg images are completely wrong.

I want to use the gstreamer pipeline with opencv to do the detection but jpg format doesnt give proper results. I know I could use the Qt to load the image as shown in the jetson inference (https://github.com/dusty-nv/jetson-inference) but i want to try to uncompress the opencv format and use it directly from opencv but can find any usable source. Can someone please share some info or source that could explain how to do that.

Thank you !

Hi,

OpenCV color format is BGR.
Would you mind to convert it into RGB and try it one more time?

image = cv2.cvtColor(ori, cv2.COLOR_BGR2RGB)

Thanks.

Hello AastaLLL,
So before the conversion the detection was:
Detected truck in the image 1 (0) with confidence 63.054596% and coordinates (2.046034,125.008163),(252.021210,249.116791).

and after the conversion:
Detected truck in the image 1 (0) with confidence 62.837116% and coordinates (1.145634,122.028084),(250.011093,245.622421).

So it is decreasing slightly.