From 06fe9552472f0379ff1a16c339c9784c973b5a04 Mon Sep 17 00:00:00 2001 From: Channingss Date: Wed, 27 May 2020 09:30:43 +0000 Subject: [PATCH] delete redundant code --- .pre-commit-config.yaml | 2 ++ deploy/cpp/include/paddlex/transforms.h | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c88196..377affb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,6 +23,7 @@ files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$ exclude: (?!.*third_party)^.*$ +- repo: local hooks: - id: clang-format-with-version-check name: clang-format @@ -31,6 +32,7 @@ language: system files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$ +- repo: local hooks: - id: cpplint-cpp-source name: cpplint diff --git a/deploy/cpp/include/paddlex/transforms.h b/deploy/cpp/include/paddlex/transforms.h index df8cff5..f8265db 100644 --- a/deploy/cpp/include/paddlex/transforms.h +++ b/deploy/cpp/include/paddlex/transforms.h @@ -83,7 +83,7 @@ class ResizeByShort : public Transform { } else { max_size_ = -1; } - }; + } virtual bool Run(cv::Mat* im, ImageBlob* data); private: @@ -96,7 +96,7 @@ class ResizeByLong : public Transform { public: virtual void Init(const YAML::Node& item) { long_size_ = item["long_size"].as(); - }; + } virtual bool Run(cv::Mat* im, ImageBlob* data); private: @@ -167,9 +167,6 @@ class Padding : public Transform { height_ = item["target_size"].as>()[1]; } } - if (item["im_padding_value"].IsDefined()) { - value_ = item["im_padding_value"].as>(); - } } virtual bool Run(cv::Mat* im, ImageBlob* data); @@ -177,7 +174,6 @@ class Padding : public Transform { int coarsest_stride_ = -1; int width_ = 0; int height_ = 0; - std::vector value_; }; class Transforms { -- GitLab