The Imagenet-trained models expect inputs that are standardized (to mean=0, std=1 per color over all of imagenet training).
You didn’t show the Python inference code, but that would look like it is missing in the C++ code.
(Generally, I’d recommend to check you’re using the same inputs when you wonder why the outputs are different.)
Best regards
Thomas