Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ List of Contributors
* [Sina Afrooze](https://github.com/safrooze)
* [Sergey Sokolov](https://github.com/Ishitori)
* [Thomas Delteil](https://github.com/ThomasDelteil)

* [Hang Zhang](http://hangzh.com)
1 change: 1 addition & 0 deletions docs/api/python/ndarray/contrib.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ In the rest of this document, we list routines provided by the `ndarray.contrib`
MultiProposal
PSROIPooling
Proposal
ROIAlign
count_sketch
ctc_loss
dequantize
Expand Down
1 change: 1 addition & 0 deletions docs/api/python/symbol/contrib.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ In the rest of this document, we list routines provided by the `symbol.contrib`
MultiProposal
PSROIPooling
Proposal
ROIAlign
count_sketch
ctc_loss
dequantize
Expand Down
63 changes: 63 additions & 0 deletions src/operator/contrib/roi_align-inl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/*!
* Copyright (c) 2018 by Contributors
* \file roi_align-inl.h
* \brief roi align operator and symbol
* \author Hang Zhang
* modified from Caffe2
*/
#ifndef MXNET_OPERATOR_CONTRIB_ROI_ALIGN_INL_H_
#define MXNET_OPERATOR_CONTRIB_ROI_ALIGN_INL_H_

#include <vector>
#include <utility>
#include "../mshadow_op.h"
#include "../tensor/init_op.h"


namespace mxnet {
namespace op {


// Declare enumeration of input order to make code more intuitive.
// These enums are only visible within this header
namespace roialign {
enum ROIAlignOpInputs {kData, kBox};
enum ROIAlignOpOutputs {kOut};
} // roialign


struct ROIAlignParam : public dmlc::Parameter<ROIAlignParam> {
TShape pooled_size;
float spatial_scale;
DMLC_DECLARE_PARAMETER(ROIAlignParam) {
DMLC_DECLARE_FIELD(pooled_size)
.set_expect_ndim(2).enforce_nonzero()
.describe("ROI Align output roi feature map height and width: (h, w)");
DMLC_DECLARE_FIELD(spatial_scale).set_range(0.0, 1.0)
.describe("Ratio of input feature map height (or w) to raw image height (or w). "
"Equals the reciprocal of total stride in convolutional layers");
}
};

} // namespace op
} // namespace mxnet

#endif // MXNET_OPERATOR_CONTRIB_ROI_ALIGN_INL_H_
Loading