• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020-2023 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IMAGE_RANDOM_CROP_AND_RESIZE_WITH_BBOX_OP_H_
17 #define MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IMAGE_RANDOM_CROP_AND_RESIZE_WITH_BBOX_OP_H_
18 
19 #include <string>
20 
21 #include "minddata/dataset/kernels/image/random_crop_and_resize_op.h"
22 
23 namespace mindspore {
24 namespace dataset {
25 class RandomCropAndResizeWithBBoxOp : public RandomCropAndResizeOp {
26  public:
27   //  Constructor for RandomCropAndResizeWithBBoxOp, with default value and passing to base class constructor
RandomCropAndResizeWithBBoxOp(int32_t target_height,int32_t target_width,float scale_lb,float scale_ub,float aspect_lb,float aspect_ub,InterpolationMode interpolation,int32_t max_attempts)28   RandomCropAndResizeWithBBoxOp(int32_t target_height, int32_t target_width, float scale_lb, float scale_ub,
29                                 float aspect_lb, float aspect_ub, InterpolationMode interpolation, int32_t max_attempts)
30       : RandomCropAndResizeOp(target_height, target_width, scale_lb, scale_ub, aspect_lb, aspect_ub, interpolation,
31                               max_attempts) {}
32 
33   ~RandomCropAndResizeWithBBoxOp() override = default;
34 
Print(std::ostream & out)35   void Print(std::ostream &out) const override {
36     out << "RandomCropAndResizeWithBBox: " << RandomCropAndResizeOp::target_height_ << " "
37         << RandomCropAndResizeOp::target_width_;
38   }
39 
40   Status Compute(const TensorRow &input, TensorRow *output) override;
41 
Name()42   std::string Name() const override { return kRandomCropAndResizeWithBBoxOp; }
43 };
44 }  // namespace dataset
45 }  // namespace mindspore
46 #endif  // MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IMAGE_RANDOM_CROP_AND_RESIZE_WITH_BBOX_OP_H_
47