CropAndResizeGradBoxes
tensorflow C++ API
tensorflow::ops::CropAndResizeGradBoxes
Computes the gradient of the crop_and_resize op wrt the input boxes tensor.
Summary
Arguments:
- scope: A Scope object
- grads: A 4-D tensor of shape [num_boxes, crop_height, crop_width, depth].
- image: A 4-D tensor of shape
[batch, image_height, image_width, depth]
. Bothimage_height
andimage_width
need to be positive. - boxes: A 2-D tensor of shape
[num_boxes, 4]
. Thei
-th row of the tensor specifies the coordinates of a box in thebox_ind[i]
image and is specified in normalized coordinates[y1, x1, y2, x2]
. A normalized coordinate value ofy
is mapped to the image coordinate aty * (image_height - 1)
, so as the[0, 1]
interval of normalized image height is mapped to[0, image_height - 1]
in image height coordinates. We do allowy1
>y2
, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the[0, 1]
range are allowed. - box_ind: A 1-D tensor of shap
[num_boxes]
with int32 values in[0, batch)
. The value ofbox_ind[i]
specifies the image that thei
-th box refers to.crop_size: A 1-D tensor of 2 elements,size = [crop_height, crop_width]
.All cropped image patches are resized to this size. The aspect ratio of the image content is not preserved. Bothcrop_height
andcrop_width
need to be positive.
Optional attributes (seeAttrs
):
- method: A string specifying the interpolation method. Only 'bilinear' is supported for now.
Returns:
Output
: A 2-D tensor of shape[num_boxes, 4]
.
Constructor
- CropAndResizeGradBoxes(const ::tensorflow::Scope & scope, ::tensorflow::Input grads, ::tensorflow::Input image, ::tensorflow::Input boxes, ::tensorflow::Input box_ind, const CropAndResizeGradBoxes::Attrs & attrs) .
Public attributes
- tensorflow::Output output.
CropAndResizeGradBoxes block
Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_image_ops.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
- grads : connect Input node.
- image : connect Input node.
- boxes : connect Input node or input float value.
- box_ind : connect Input node or input int32 value.
- CropAndResizeGradBoxes::Attrs attrs : input attrs. ex) method_ = "bilinear";
Return:
- Output output: Output object of CropAndResizeGradBoxesclass object.
Result:
- std::vector(Tensor) product_result : Returned object of executed result by calling session.