preprocessor.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "ultra_infer/function/functions.h"
  16. #include "ultra_infer/vision/common/processors/transform.h"
  17. namespace ultra_infer {
  18. namespace vision {
  19. namespace generation {
  20. /*! @brief Preprocessor object for AnimeGAN serials model.
  21. */
  22. class ULTRAINFER_DECL AnimeGANPreprocessor {
  23. public:
  24. /** \brief Create a preprocessor instance for AnimeGAN serials model
  25. */
  26. AnimeGANPreprocessor() {}
  27. /** \brief Process the input image and prepare input tensors for runtime
  28. *
  29. * \param[in] images The input image data list, all the elements are returned
  30. * wrapped by FDMat. \param[in] output The output tensors which will feed in
  31. * runtime \return true if the preprocess succeeded, otherwise false
  32. */
  33. bool Run(std::vector<Mat> &images, std::vector<FDTensor> *output);
  34. };
  35. } // namespace generation
  36. } // namespace vision
  37. } // namespace ultra_infer