You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/02/05 20:01:04 UTC

[GitHub] vandanavk commented on a change in pull request #13858: implement random resize crop as operator

vandanavk commented on a change in pull request #13858: implement random resize crop as operator
URL: https://github.com/apache/incubator-mxnet/pull/13858#discussion_r254023576
 
 

 ##########
 File path: src/operator/image/random_resize_crop-inl.h
 ##########
 @@ -0,0 +1,163 @@
+/*
+* 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 random_resize_crop-inl.h
+ * \brief the image random_resize_crop operator implementation
+ */
+
+#ifndef MXNET_OPERATOR_IMAGE_RANDOM_RESIZE_CROP_INL_H_
+#define MXNET_OPERATOR_IMAGE_RANDOM_RESIZE_CROP_INL_H_
+
+
+#include <algorithm>
+#include <utility>
+#include <vector>
+#include <math.h>
+
+#include "mxnet/base.h"
+#include "dmlc/optional.h"
+
+#include "../mxnet_op.h"
+#include "../operator_common.h"
+#include "image_utils.h"
+
+namespace mxnet {
+namespace op {
+namespace image {
+
+struct RandomResizeCropParam : public dmlc::Parameter<RandomResizeCropParam> {
+  nnvm::Tuple<int> size;
+  nnvm::Tuple<float> scale;
+  nnvm::Tuple<float> ratio;
+  int interp;
+  DMLC_DECLARE_PARAMETER(RandomResizeCropParam) {
+    DMLC_DECLARE_FIELD(size)
+    .set_default(nnvm::Tuple<int>())
+    .describe("Size of the final output.");
+    DMLC_DECLARE_FIELD(scale)
+    .set_default(nnvm::Tuple<float>())
+    .describe("If scale is `(min_area, max_area)`, the cropped image's area will"
+        "range from min_area to max_area of the original image's area");
+    DMLC_DECLARE_FIELD(ratio)
+    .set_default(nnvm::Tuple<float>())
+    .describe("Range of aspect ratio of the cropped image before resizing.");
+    DMLC_DECLARE_FIELD(interp)
+    .describe("Interpolation method for resizing. By default uses bilinear"
+        "interpolation. See OpenCV's resize function for available choices.");
 
 Review comment:
   Can you add the choices here too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services