|
|
|
@ -23,7 +23,22 @@ REGISTER_LAYER(bilinear_interp, BilinearInterpLayer);
|
|
|
|
|
size_t BilinearInterpLayer::getSize() {
|
|
|
|
|
inImgH_ = inputLayers_[0]->getOutput().getFrameHeight();
|
|
|
|
|
inImgW_ = inputLayers_[0]->getOutput().getFrameWidth();
|
|
|
|
|
|
|
|
|
|
const BilinearInterpConfig& conf = config_.inputs(0).bilinear_interp_conf();
|
|
|
|
|
if (inImgH_ == 0) {
|
|
|
|
|
inImgH_ = conf.img_size_y();
|
|
|
|
|
}
|
|
|
|
|
if (inImgW_ == 0) {
|
|
|
|
|
inImgW_ = conf.img_size_x();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
outImgH_ = conf.out_size_y();
|
|
|
|
|
outImgW_ = conf.out_size_x();
|
|
|
|
|
numChannels_ = conf.num_channels();
|
|
|
|
|
|
|
|
|
|
CHECK(outImgH_ > 0 && outImgW_ > 0);
|
|
|
|
|
CHECK(inImgH_ > 0 && inImgW_ > 0);
|
|
|
|
|
CHECK(numChannels_);
|
|
|
|
|
|
|
|
|
|
getOutput().setFrameHeight(outImgH_);
|
|
|
|
|
getOutput().setFrameWidth(outImgW_);
|
|
|
|
@ -37,15 +52,6 @@ bool BilinearInterpLayer::init(const LayerMap& layerMap,
|
|
|
|
|
|
|
|
|
|
CHECK_EQ(1, config_.inputs_size());
|
|
|
|
|
|
|
|
|
|
const BilinearInterpConfig& conf = config_.inputs(0).bilinear_interp_conf();
|
|
|
|
|
|
|
|
|
|
outImgH_ = conf.out_size_y();
|
|
|
|
|
outImgW_ = conf.out_size_x();
|
|
|
|
|
numChannels_ = conf.num_channels();
|
|
|
|
|
|
|
|
|
|
CHECK(outImgH_ > 0 && outImgW_ > 0);
|
|
|
|
|
CHECK(numChannels_);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|