Skip to content

Commit 75d14ad

Browse files
hyeygittensorflower-gardener
authored andcommitted
Add missing dtype and shape specifications for tf.image API functions.
PiperOrigin-RevId: 348693895 Change-Id: Iff26cad4e37dcb3a261af79f8b1d3aab2b68da9a
1 parent 13329f5 commit 75d14ad

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

tensorflow/python/ops/image_ops_impl.py

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,16 +3091,17 @@ def decode_image(contents,
30913091
frame to fill the unoccupied areas.
30923092
30933093
Args:
3094-
contents: 0-D `string`. The encoded image bytes.
3094+
contents: A `Tensor` of type `string`. 0-D. The encoded image bytes.
30953095
channels: An optional `int`. Defaults to `0`. Number of color channels for
30963096
the decoded image.
30973097
dtype: The desired DType of the returned `Tensor`.
30983098
name: A name for the operation (optional)
3099-
expand_animations: Controls the shape of the returned op's output. If
3100-
`True`, the returned op will produce a 3-D tensor for PNG, JPEG, and BMP
3101-
files; and a 4-D tensor for all GIFs, whether animated or not. If,
3102-
`False`, the returned op will produce a 3-D tensor for all file types and
3103-
will truncate animated GIFs to the first frame.
3099+
expand_animations: An optional `bool`. Defaults to `True`. Controls the
3100+
shape of the returned op's output. If `True`, the returned op will produce
3101+
a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all GIFs,
3102+
whether animated or not. If, `False`, the returned op will produce a 3-D
3103+
tensor for all file types and will truncate animated GIFs to the first
3104+
frame.
31043105
31053106
Returns:
31063107
`Tensor` with type `dtype` and a 3- or 4-dimensional shape, depending on
@@ -3663,10 +3664,10 @@ def non_max_suppression(boxes,
36633664
score corresponding to each box (each row of boxes).
36643665
max_output_size: A scalar integer `Tensor` representing the maximum number
36653666
of boxes to be selected by non-max suppression.
3666-
iou_threshold: A float representing the threshold for deciding whether boxes
3667-
overlap too much with respect to IOU.
3668-
score_threshold: A float representing the threshold for deciding when to
3669-
remove boxes based on score.
3667+
iou_threshold: A 0-D float tensor representing the threshold for deciding
3668+
whether boxes overlap too much with respect to IOU.
3669+
score_threshold: A 0-D float tensor representing the threshold for deciding
3670+
when to remove boxes based on score.
36703671
name: A name for the operation (optional).
36713672
36723673
Returns:
@@ -3732,14 +3733,14 @@ def non_max_suppression_with_scores(boxes,
37323733
score corresponding to each box (each row of boxes).
37333734
max_output_size: A scalar integer `Tensor` representing the maximum number
37343735
of boxes to be selected by non-max suppression.
3735-
iou_threshold: A float representing the threshold for deciding whether boxes
3736-
overlap too much with respect to IOU.
3737-
score_threshold: A float representing the threshold for deciding when to
3738-
remove boxes based on score.
3739-
soft_nms_sigma: A scalar float representing the Soft NMS sigma parameter;
3740-
See Bodla et al, https://arxiv.org/abs/1704.04503). When
3741-
`soft_nms_sigma=0.0` (which is default), we fall back to standard (hard)
3742-
NMS.
3736+
iou_threshold: A 0-D float tensor representing the threshold for deciding
3737+
whether boxes overlap too much with respect to IOU.
3738+
score_threshold: A 0-D float tensor representing the threshold for deciding
3739+
when to remove boxes based on score.
3740+
soft_nms_sigma: A 0-D float tensor representing the sigma parameter for Soft
3741+
NMS; see Bodla et al (c.f. https://arxiv.org/abs/1704.04503). When
3742+
`soft_nms_sigma=0.0` (which is default), we fall back to standard (hard)
3743+
NMS.
37433744
name: A name for the operation (optional).
37443745
37453746
Returns:
@@ -3791,15 +3792,17 @@ def non_max_suppression_with_overlaps(overlaps,
37913792
```
37923793
37933794
Args:
3794-
overlaps: A 2-D float `Tensor` of shape `[num_boxes, num_boxes]`.
3795+
overlaps: A 2-D float `Tensor` of shape `[num_boxes, num_boxes]`
3796+
representing the n-by-n box overlap values.
37953797
scores: A 1-D float `Tensor` of shape `[num_boxes]` representing a single
37963798
score corresponding to each box (each row of boxes).
37973799
max_output_size: A scalar integer `Tensor` representing the maximum number
37983800
of boxes to be selected by non-max suppression.
3799-
overlap_threshold: A float representing the threshold for deciding whether
3800-
boxes overlap too much with respect to the provided overlap values.
3801-
score_threshold: A float representing the threshold for deciding when to
3802-
remove boxes based on score.
3801+
overlap_threshold: A 0-D float tensor representing the threshold for
3802+
deciding whether boxes overlap too much with respect to the provided
3803+
overlap values.
3804+
score_threshold: A 0-D float tensor representing the threshold for deciding
3805+
when to remove boxes based on score.
38033806
name: A name for the operation (optional).
38043807
38053808
Returns:

0 commit comments

Comments
 (0)