-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mobilenet c++ sample #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contribution! Please take a look at my comments below.
int rszHeight = parser.get<int>("initial_height"); | ||
bool swapRB = parser.get<bool>("rgb"); | ||
bool crop = parser.get<bool>("crop"); | ||
String model = samples::findFile(parser.get<String>("model")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use samples::findFile
. People may build OpenCV without samples. Just do String model = parser.get<String>("model")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand findfiles is in Core functionality » Utility and system functions and macros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, samples::findfiles
is only used in $opencv/samples
. We should avoid using it outside of its scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not agree because
demo --input=opencv-logo.png is easyer than demo --input=/opencv/samples/data/opencv-logo.png
and you can call findFiles from python too
but I remove it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly speaking, I thought samples::findFile
was from $opencv/samples
but it was defined and declared in the core module. Then I tried to search it in opencv source code, found that this API is only used in $opencv/samples
.
Now my thought is these kinds of demos are meant to show beginers how to use models with opencv in the most simple way. In most of the cases, they would not even know OPENCV_SAMPLES_DATA_PATH
but would find and input an absolute path of an image. I have to say it can be convenient for people who know it, but for other people it may cause confusion. We can use it if we want to promote it.
Could you also add a section in readme about how to build and use the c++ demo just like https://github.com/opencv/opencv_zoo/tree/main/models/face_detection_yunet#c does? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍LGTM!
I use this sample https://github.com/opencv/opencv/blob/4.x/samples/dnn/classification.cpp
For Cmakelist https://github.com/opencv/opencv/blob/4.x/samples/cpp/example_cmake/CMakeLists.txt