-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 ssd example #156
Conversation
examples/ssd/ssdmobilenet.cpp
Outdated
|
||
ncnn::Mat out; | ||
|
||
for(int i=0;i<1;i++) |
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.
this loop is useless
examples/ssd/ssdmobilenet.cpp
Outdated
Object object; | ||
for(int iw=0;iw<out.w;iw++) | ||
{ | ||
auto value = out.data[iw+ih*out.w]; |
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.
out.w is always six, so it's fine to write const float* values = out.row(ih); and use values[0] values[1] .... instead of the following six conditions
do not use auto keyword
examples/ssd/ssdmobilenet.cpp
Outdated
printf("\n"); | ||
|
||
} | ||
for(auto object : objects) |
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.
always prefer indexed for-loop over c++11 range-based for
examples/ssd/ssdmobilenet.cpp
Outdated
int img_w = raw_img.size().width; | ||
mobilenet.load_param("mobilenet_ssd_voc_ncnn.param"); | ||
mobilenet.load_model("mobilenet_ssd_voc_ncnn.bin"); | ||
auto input_size = 300; |
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.
no c++11 auto here
examples/ssd/ssdmobilenet.cpp
Outdated
{ | ||
Object object = objects.at(i); | ||
if(object.prob > show_threshold) | ||
cv::rectangle(raw_img,object.rec,cv::Scalar(255,0,0)); |
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.
It will be nice to have class-id and score text drawn besides rectangle only
src/layer/interp.cpp
Outdated
@@ -25,13 +25,13 @@ Interp::Interp() | |||
|
|||
Interp::~Interp() | |||
{ | |||
} |
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.
interp.cpp file conflicts, please fix it.
No description provided.