# tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs Struct Reference

# tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs

`#include <image_ops.h>`

Optional attribute setters for [SampleDistortedBoundingBoxV2](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sample-distorted-bounding-box-v2#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a69ae593a1a5a7780e524e2356d2faff8 = Default_area_range()` | `gtl::ArraySlice< float >` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a0c4e44eabfe7afab174ee2f85df1726d = Default_aspect_ratio_range()` | `gtl::ArraySlice< float >` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a730472cdd7975ef9d970e1f8b5023364 = 100` | `int64` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a7c9b9d92bf0a822f1545d6ca832b0422 = 0` | `int64` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1acff1116d6929f772cb713fe9a3d32eeb = 0` | `int64` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1ad86cffc54629ac12206d2c500e0779cb = false` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a8df62937b62cff944feb1b8fa311ded7(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` The cropped area of the image must contain a fraction of the supplied image within this range. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3cbee228822ba7b22c16480f4b924bf0(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` The cropped area of the image must have an aspect ratio = width / height within this range. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3d45be2446f3ad2895375dc1dad9cc0b(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` Number of attempts at generating a cropped region of the image of the specified constraints. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1adc049c4ba5c6fdd2d276098deeb8c992(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a676c3cc02479e14a7f557fe7d469cb93(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` A second seed to avoid seed collision. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3179a059c42359549522461cb227d6c3(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs` Controls behavior if no bounding boxes supplied. |

## Public attributes

### area_range_

```
gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::area_range_ = Default_area_range()
```

### aspect_ratio_range_

```
gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::aspect_ratio_range_ = Default_aspect_ratio_range()
```

### max_attempts_

```
int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::max_attempts_ = 100
```

### seed2_

```
int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::seed2_ = 0
```

### seed_

```
int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::seed_ = 0
```

### use_image_if_no_bounding_boxes_

```
bool tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::use_image_if_no_bounding_boxes_ = false
```

## Public functions

### AreaRange

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::AreaRange(
  const gtl::ArraySlice< float > & x
)
```
The cropped area of the image must contain a fraction of the supplied image within this range.

Defaults to \[0.05, 1\]

### AspectRatioRange

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::AspectRatioRange(
  const gtl::ArraySlice< float > & x
)
```
The cropped area of the image must have an aspect ratio = width / height within this range.

Defaults to \[0.75, 1.33\]

### MaxAttempts

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::MaxAttempts(
  int64 x
)
```
Number of attempts at generating a cropped region of the image of the specified constraints.

After `max_attempts` failures, return the entire image.

Defaults to 100

### Seed

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::Seed(
  int64 x
)
```
If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`.

Otherwise, it is seeded by a random seed.

Defaults to 0

### Seed2

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::Seed2(
  int64 x
)
```
A second seed to avoid seed collision.

Defaults to 0

### UseImageIfNoBoundingBoxes

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::UseImageIfNoBoundingBoxes(
  bool x
)
```
Controls behavior if no bounding boxes supplied.

If true, assume an implicit bounding box covering the whole input. If false, raise an error.

Defaults to false