텐서플로우:: 작전:: 자르기 및 크기 조정
#include <image_ops.h>입력 이미지 텐서에서 자르기를 추출하고 크기를 조정합니다.
요약
입력 이미지 텐서에서 자르기를 추출하고 쌍선형 샘플링 또는 가장 가까운 이웃 샘플링(종횡비 변경 가능)을 사용하여 crop_size 에 지정된 공통 출력 크기로 크기를 조정합니다. 이는 입력 이미지에서 고정 크기 슬라이스를 추출하고 크기 조정이나 종횡비 변경을 허용하지 않는 crop_to_bounding_box 작업보다 더 일반적입니다.
boxes 의 경계 상자 위치에 정의된 위치에서 입력 image 의 crops 포함하는 텐서를 반환합니다. 잘린 상자는 모두 고정된 size = [crop_height, crop_width] 로 크기가 조정됩니다(이선형 또는 최근접 이웃 보간 사용). 결과는 4차원 텐서 [num_boxes, crop_height, crop_width, depth] 입니다. 크기 조정은 모서리에 맞춰집니다. 특히, boxes = [[0, 0, 1, 1]] 인 경우 이 메소드는 align_corners=True 와 함께 tf.image.resize_bilinear() 또는 tf.image.resize_nearest_neighbor() ( method 인수에 따라 다름)를 사용하는 것과 동일한 결과를 제공합니다. align_corners=True .
인수:
- 범위: 범위 개체
- image:
[batch, image_height, image_width, depth]모양의 4차원 텐서.image_height와image_width모두 양수여야 합니다. - 상자:
[num_boxes, 4]모양의 2차원 텐서. 텐서의i번째 행은box_ind[i]이미지의 상자 좌표를 지정하고 정규화된 좌표[y1, x1, y2, x2]로 지정됩니다.y의 정규화된 좌표 값은y * (image_height - 1)의 이미지 좌표에 매핑되므로 정규화된 이미지 높이의[0, 1]간격은 이미지 높이 좌표에서[0, image_height - 1]에 매핑됩니다.y1>y2허용합니다. 이 경우 샘플링된 자르기는 원본 이미지를 위아래로 뒤집은 버전입니다. 너비 치수도 유사하게 처리됩니다.[0, 1]범위 밖의 정규화된 좌표가 허용되며, 이 경우extrapolation_value사용하여 입력 이미지 값을 추정합니다. - box_ind:
[0, batch)에 int32 값을 갖는[num_boxes]모양의 1차원 텐서.box_ind[i]의 값은i번째 상자가 참조하는 이미지를 지정합니다. - Crop_size: 2개 요소로 구성된 1차원 텐서,
size = [crop_height, crop_width]. 잘린 이미지 패치는 모두 이 크기로 조정됩니다. 이미지 콘텐츠의 종횡비는 유지되지 않습니다.crop_height와crop_width모두 양수여야 합니다.
선택적 속성( Attrs 참조):
- method: 크기 조정을 위한 샘플링 방법을 지정하는 문자열입니다.
"bilinear"또는"nearest"일 수 있으며 기본값은"bilinear"입니다. 현재 Bilinear와 Nearest Neighbor라는 두 가지 샘플링 방법이 지원됩니다. - extrapolation_value: 적용 가능한 경우 외삽에 사용되는 값입니다.
보고:
-
Output:[num_boxes, crop_height, crop_width, depth]모양의 4D 텐서.
생성자와 소멸자 | |
|---|---|
CropAndResize (const :: tensorflow::Scope & scope, :: tensorflow::Input image, :: tensorflow::Input boxes, :: tensorflow::Input box_ind, :: tensorflow::Input crop_size) | |
CropAndResize (const :: tensorflow::Scope & scope, :: tensorflow::Input image, :: tensorflow::Input boxes, :: tensorflow::Input box_ind, :: tensorflow::Input crop_size, const CropAndResize::Attrs & attrs) |
공개 속성 | |
|---|---|
crops | |
operation | |
공공 기능 | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
공개 정적 함수 | |
|---|---|
ExtrapolationValue (float x) | |
Method (StringPiece x) | |
구조체 | |
|---|---|
| 텐서플로우:: ops:: CropAndResize:: 속성 | CropAndResize 에 대한 선택적 속성 설정자입니다. |
공개 속성
작물
::tensorflow::Output crops
작업
Operation operation
공공 기능
자르기 및 크기 조정
CropAndResize( const ::tensorflow::Scope & scope, ::tensorflow::Input image, ::tensorflow::Input boxes, ::tensorflow::Input box_ind, ::tensorflow::Input crop_size )
자르기 및 크기 조정
CropAndResize( const ::tensorflow::Scope & scope, ::tensorflow::Input image, ::tensorflow::Input boxes, ::tensorflow::Input box_ind, ::tensorflow::Input crop_size, const CropAndResize::Attrs & attrs )
마디
::tensorflow::Node * node() const
연산자::텐서플로우::입력
operator::tensorflow::Input() const
연산자::텐서플로우::출력
operator::tensorflow::Output() const
공개 정적 함수
외삽값
Attrs ExtrapolationValue( float x )
방법
Attrs Method( StringPiece x )