diff --git a/include/tim/vx/ops/roi_align.h b/include/tim/vx/ops/roi_align.h index dead1b6..0513f5f 100644 --- a/include/tim/vx/ops/roi_align.h +++ b/include/tim/vx/ops/roi_align.h @@ -30,7 +30,7 @@ namespace vx { namespace ops { /** - * ## ROI_ALIGN + * ## RoiAlign * * Select and scale the feature map of each region of interest to a unified output * size by average pooling sampling points from bilinear interpolation. @@ -47,9 +47,9 @@ namespace ops { * used to compute the output. */ -class ROI_Align : public DirectMapOp { +class RoiAlign : public DirectMapOp { public: - ROI_Align(Graph* graph, int32_t output_height, int32_t output_width, + RoiAlign(Graph* graph, int32_t output_height, int32_t output_width, float height_ratio, float width_ratio, int32_t height_sample_num, int32_t width_sample_num); @@ -65,6 +65,8 @@ class ROI_Align : public DirectMapOp { int32_t width_sample_num_; }; +using ROI_Align = RoiAlign; + } // namespace ops } // namespace vx } // namespace tim diff --git a/include/tim/vx/ops/roi_pool.h b/include/tim/vx/ops/roi_pool.h index 953b3f3..311b652 100644 --- a/include/tim/vx/ops/roi_pool.h +++ b/include/tim/vx/ops/roi_pool.h @@ -33,7 +33,7 @@ namespace vx { namespace ops { /** - * ## ROI_POOL + * ## RoiPool * * Select and scale the feature map of each region of interest to a unified output * size by max-pooling. @@ -44,9 +44,9 @@ namespace ops { * */ -class ROI_Pool : public DirectMapOp { +class RoiPool : public DirectMapOp { public: - ROI_Pool(Graph* graph, PoolType type, float scale, + RoiPool(Graph* graph, PoolType type, float scale, const std::array& size); std::shared_ptr Clone( @@ -58,6 +58,8 @@ class ROI_Pool : public DirectMapOp { std::array size_; }; +using ROI_Pool = RoiPool; + } // namespace ops } // namespace vx } // namespace tim diff --git a/src/tim/vx/ops/roi_align.cc b/src/tim/vx/ops/roi_align.cc index d9ad4d1..c36aac1 100644 --- a/src/tim/vx/ops/roi_align.cc +++ b/src/tim/vx/ops/roi_align.cc @@ -30,7 +30,7 @@ namespace tim { namespace vx { namespace ops { -ROI_Align::ROI_Align(Graph* graph, int32_t output_height, int32_t output_width, +RoiAlign::RoiAlign(Graph* graph, int32_t output_height, int32_t output_width, float height_ratio, float width_ratio, int32_t height_sample_num, int32_t width_sample_num) : DirectMapOp(graph, VSI_NN_OP_ROI_ALIGN), @@ -49,9 +49,9 @@ ROI_Align::ROI_Align(Graph* graph, int32_t output_height, int32_t output_width, this->impl()->node()->nn_param.roi_align.width_sample_num = width_sample_num; } -std::shared_ptr ROI_Align::Clone( +std::shared_ptr RoiAlign::Clone( std::shared_ptr& graph) const { - return graph->CreateOperation( + return graph->CreateOperation( this->output_height_, this->output_width_, this->height_ratio_, this->width_ratio_, this->height_sample_num_, this->width_sample_num_); } diff --git a/src/tim/vx/ops/roi_align_test.cc b/src/tim/vx/ops/roi_align_test.cc index 00fd6d4..bd21542 100644 --- a/src/tim/vx/ops/roi_align_test.cc +++ b/src/tim/vx/ops/roi_align_test.cc @@ -29,7 +29,7 @@ #include "tim/vx/graph.h" #include "tim/vx/types.h" -TEST(ROI_Align, shape_4_2_1_1_float32) { +TEST(RoiAlign, shape_4_2_1_1_float32) { auto ctx = tim::vx::Context::Create(); auto graph = ctx->CreateGraph(); @@ -83,7 +83,7 @@ TEST(ROI_Align, shape_4_2_1_1_float32) { graph->CreateTensor(batch_index_spec, batch_index_data.data()); auto output_tensor = graph->CreateTensor(output_spec); - auto roi_align = graph->CreateOperation( + auto roi_align = graph->CreateOperation( out_height, out_width, height_ratio, width_ratio, height_sample_num, width_sample_num); (*roi_align) diff --git a/src/tim/vx/ops/roi_pool.cc b/src/tim/vx/ops/roi_pool.cc index e0243ce..91a94ea 100644 --- a/src/tim/vx/ops/roi_pool.cc +++ b/src/tim/vx/ops/roi_pool.cc @@ -31,7 +31,7 @@ namespace tim { namespace vx { namespace ops { -ROI_Pool::ROI_Pool(Graph* graph, PoolType type, float scale, +RoiPool::RoiPool(Graph* graph, PoolType type, float scale, const std::array& size) : DirectMapOp(graph, VSI_NN_OP_ROI_POOL), type_(type), @@ -43,9 +43,9 @@ ROI_Pool::ROI_Pool(Graph* graph, PoolType type, float scale, this->impl()->node()->nn_param.roi_pool.size[1] = size[1]; } -std::shared_ptr ROI_Pool::Clone( +std::shared_ptr RoiPool::Clone( std::shared_ptr& graph) const { - return graph->CreateOperation( + return graph->CreateOperation( this->type_, this->scale_, this->size_); } diff --git a/src/tim/vx/ops/roi_pool_test.cc b/src/tim/vx/ops/roi_pool_test.cc index 33e7e46..09729b9 100644 --- a/src/tim/vx/ops/roi_pool_test.cc +++ b/src/tim/vx/ops/roi_pool_test.cc @@ -29,7 +29,7 @@ #include "tim/vx/graph.h" #include "tim/vx/types.h" -TEST(ROI_Pool, shape_4_2_1_1_float32) { +TEST(RoiPool, shape_4_2_1_1_float32) { auto ctx = tim::vx::Context::Create(); auto graph = ctx->CreateGraph(); @@ -81,7 +81,7 @@ TEST(ROI_Pool, shape_4_2_1_1_float32) { std::array size; size[0] = out_height; size[1] = out_width; - auto roi_pool = graph->CreateOperation(tim::vx::PoolType::MAX, scale, size); + auto roi_pool = graph->CreateOperation(tim::vx::PoolType::MAX, scale, size); (*roi_pool) .BindInput(input_tensor) .BindInput(regions_tensor)