-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 image-level feature support #320
Conversation
src/layer/interp.cpp
Outdated
@@ -56,26 +62,42 @@ int Interp::forward(const Mat &bottom_blob, Mat &top_blob) const | |||
if (top_blob.empty()) | |||
return -100; | |||
|
|||
if (resize_type == 1)//nearest | |||
if (resize_type == 1 || bottom_blob.dims == 1)//nearest |
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.
If bottom_blob is a vector, the resize_type is ignored. move this condition out of resize_type path.
if (bottom_blob.dims == 1)
{
// handle this special case, ignore resize_type
return 0;
}
// all the following code shall not be changed
if (resize_type == 1)//nearest
{
}
src/layer/interp.cpp
Outdated
{ | ||
const float *ptr = ((float*)bottom_blob.data+q); | ||
float *output_ptr = top_blob.channel(q); | ||
for (int i = 0; i < top_blob.cstep; ++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 is what the Mat::fill() does
src/layer/interp.cpp
Outdated
@@ -56,26 +62,38 @@ int Interp::forward(const Mat &bottom_blob, Mat &top_blob) const | |||
if (top_blob.empty()) | |||
return -100; | |||
|
|||
if (bottom_blob.dims == 1) | |||
{ | |||
#pragma omp parallel for |
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 use space, not tab
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.
Oh, thanks
src/layer/interp.cpp
Outdated
for (int q = 0; q < c; ++q) | ||
{ | ||
const float *ptr = bottom_blob.channel(q); | ||
float *output_ptr = top_blob.channel(q); |
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.
keep the ident space of this block
* add image-level feature support * move special case out * tab to space
Resize Cx1x1 feature map to CxHxW, use in DeepLabv3 etc.