You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to benchmark and compare a Python script, using a pretrained classification model from the torchvision library with the C++ API implementation in order to make sure it will work with my application.
I have tried the following script in Python:
Ok after making some tests, regarding reading an image with OpenCV I have identified the issue.
The problem was, reading an image with OpenCV with cv::IMREAD_UNCHANGED gives you BGR channels. The image still needs to be converted to RGB.
Therefore I have removed using the PIL library from Python as you cant use it in C++.
I have tried to benchmark and compare a Python script, using a pretrained classification model from the torchvision library with the C++ API implementation in order to make sure it will work with my application.
I have tried the following script in Python:
And I used the following code in C++:
The results I get in the Python script:
Probability: 0.99, Index: 1, Label: GoldFish
The results I get in C++:
Probability: 0.4839, Index: 584
I used PyTorch 1.3 version in Python 3.7 and the latest corresponding libtorch.
Any ideas?
cc @yf225
The text was updated successfully, but these errors were encountered: