컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 디코드Jpeg
#include <image_ops.h>
JPEG로 인코딩된 이미지를 uint8 텐서로 디코딩합니다.
요약
attr channels
디코딩된 이미지에 대해 원하는 색상 채널 수를 나타냅니다.
허용되는 값은 다음과 같습니다.
- 0: JPEG 인코딩 이미지의 채널 수를 사용합니다.
- 1: 회색조 이미지를 출력합니다.
- 3: RGB 이미지를 출력합니다.
필요한 경우 JPEG로 인코딩된 이미지는 요청된 색상 채널 수와 일치하도록 변환됩니다.
attr ratio
사용하면 디코딩하는 동안 이미지의 크기를 정수만큼 축소할 수 있습니다. 허용되는 값은 1, 2, 4, 8입니다. 이는 나중에 이미지 크기를 축소하는 것보다 훨씬 빠릅니다.
이 작업은 인터페이스가 동일하기 때문에 PNG 및 애니메이션이 아닌 GIF 디코딩도 지원하지만 tf.io.decode_image
사용하는 것이 더 깔끔합니다.
인수:
- 범위: 범위 개체
- 내용: 0-D. JPEG로 인코딩된 이미지입니다.
선택적 속성( Attrs
참조):
- 채널: 디코딩된 이미지의 색상 채널 수입니다.
- 비율: 축소 비율입니다.
- fancy_upscaling: true인 경우 크로마 평면의 느리지만 더 좋은 업스케일링을 사용합니다(yuv420/422에만 해당).
- try_recover_truncated: true인 경우 잘린 입력에서 이미지를 복구하려고 시도합니다.
- Acceptable_fraction: 잘린 입력이 허용되기 전에 필요한 최소 행 비율입니다.
- dct_method: 압축 해제에 사용되는 알고리즘에 대한 힌트를 지정하는 문자열입니다. 기본값은 시스템별 기본값에 매핑되는 ""입니다. 현재 유효한 값은 ["INTEGER_FAST", "INTEGER_ACCURATE"]입니다. 힌트는 무시될 수 있습니다(예: 내부 jpeg 라이브러리가 해당 특정 옵션이 없는 버전으로 변경됩니다.)
보고:
-
Output
: [height, width, channels]
모양의 3D ..
공개 속성
공공 기능
마디
::tensorflow::Node * node() const
operator::tensorflow::Input() const
연산자::텐서플로우::출력
operator::tensorflow::Output() const
공개 정적 함수
허용 가능한 분수
Attrs AcceptableFraction(
float x
)
채널
Attrs Channels(
int64 x
)
Dct방법
Attrs DctMethod(
StringPiece x
)
팬시업스케일링
Attrs FancyUpscaling(
bool x
)
비율
Attrs Ratio(
int64 x
)
복구 시도잘림됨
Attrs TryRecoverTruncated(
bool x
)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# tensorflow::ops::DecodeJpeg Class Reference\n\ntensorflow::ops::DecodeJpeg\n===========================\n\n`#include \u003cimage_ops.h\u003e`\n\nDecode a JPEG-encoded image to a uint8 tensor.\n\nSummary\n-------\n\nThe attr `channels` indicates the desired number of color channels for the decoded image.\n\nAccepted values are:\n\n\n- 0: Use the number of channels in the JPEG-encoded image.\n- 1: output a grayscale image.\n- 3: output an RGB image.\n\n\u003cbr /\u003e\n\nIf needed, the JPEG-encoded image is transformed to match the requested number of color channels.\n\nThe attr `ratio` allows downscaling the image by an integer factor during decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than downscaling the image later.\n\nThis op also supports decoding PNGs and non-animated GIFs since the interface is the same, though it is cleaner to use `tf.io.decode_image`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- contents: 0-D. The JPEG-encoded image.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)):\n\n- channels: Number of color channels for the decoded image.\n- ratio: Downscaling ratio.\n- fancy_upscaling: If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only).\n- try_recover_truncated: If true try to recover an image from truncated input.\n- acceptable_fraction: The minimum required fraction of lines before a truncated input is accepted.\n- dct_method: string specifying a hint about the algorithm used for decompression. Defaults to \"\" which maps to a system-specific default. Currently valid values are \\[\"INTEGER_FAST\", \"INTEGER_ACCURATE\"\\]. The hint may be ignored (e.g., the internal jpeg library changes to a version that does not have that specific option.)\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 3-D with shape `[height, width, channels]`..\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DecodeJpeg](#classtensorflow_1_1ops_1_1_decode_jpeg_1ac4de6e02218f7ad73fca207fdedcbcad)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` contents)` ||\n| [DecodeJpeg](#classtensorflow_1_1ops_1_1_decode_jpeg_1a3d8ca9fbb0c56f07d1dfc15707345456)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` contents, const `[DecodeJpeg::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [image](#classtensorflow_1_1ops_1_1_decode_jpeg_1ae6c2f8ba16e122ec6fffd95b36d65ead) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_decode_jpeg_1ac493d7d06da539cac7983b2046f8e9d1) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_decode_jpeg_1a62de1d307840ceb881b006cd346264f1)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_jpeg_1a87002e2b5765be434ab912f4ae691605)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_jpeg_1af3a81e6979e68a832cbbc27890b24704)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [AcceptableFraction](#classtensorflow_1_1ops_1_1_decode_jpeg_1a3e5bf8acaa171c786f414da0c3717e15)`(float x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n| [Channels](#classtensorflow_1_1ops_1_1_decode_jpeg_1a4ced6488b8eb52569e4c64cb514ae5af)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n| [DctMethod](#classtensorflow_1_1ops_1_1_decode_jpeg_1a11a129bf8cb32c9b4b80b8f379be1356)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n| [FancyUpscaling](#classtensorflow_1_1ops_1_1_decode_jpeg_1a32505c9ff48d85625d2d574385e580d7)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n| [Ratio](#classtensorflow_1_1ops_1_1_decode_jpeg_1a55a5fb907878bbe1ed6fc08e696f55ce)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n| [TryRecoverTruncated](#classtensorflow_1_1ops_1_1_decode_jpeg_1a0d8254ea2a648d8ad63b90b2e39d9cf5)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::DecodeJpeg::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/decode-jpeg/attrs) | Optional attribute setters for [DecodeJpeg](/versions/r2.3/api_docs/cc/class/tensorflow/ops/decode-jpeg#classtensorflow_1_1ops_1_1_decode_jpeg). |\n\nPublic attributes\n-----------------\n\n### image\n\n```text\n::tensorflow::Output image\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### DecodeJpeg\n\n```gdscript\n DecodeJpeg(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input contents\n)\n``` \n\n### DecodeJpeg\n\n```gdscript\n DecodeJpeg(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input contents,\n const DecodeJpeg::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### AcceptableFraction\n\n```text\nAttrs AcceptableFraction(\n float x\n)\n``` \n\n### Channels\n\n```text\nAttrs Channels(\n int64 x\n)\n``` \n\n### DctMethod\n\n```text\nAttrs DctMethod(\n StringPiece x\n)\n``` \n\n### FancyUpscaling\n\n```text\nAttrs FancyUpscaling(\n bool x\n)\n``` \n\n### Ratio\n\n```text\nAttrs Ratio(\n int64 x\n)\n``` \n\n### TryRecoverTruncated\n\n```text\nAttrs TryRecoverTruncated(\n bool x\n)\n```"]]