Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
тензорный поток:: опс:: ДекодироватьGif
#include <image_ops.h>
Декодируйте кадр(ы) изображения в формате GIF в тензор uint8.
Краткое содержание
Изображения GIF со сжатием рамки или прозрачности не поддерживаются. В системах Linux и MacOS конвертируйте анимированные GIF-файлы из сжатого в несжатое, выполнив:
convert $src.gif -coalesce $dst.gif
Эта операция также поддерживает декодирование JPEG и PNG, хотя проще использовать tf.image.decode_image
.
Аргументы:
- область: объект области.
- содержимое: 0-D. Изображение в формате GIF.
Возврат:
-
Output
: 4-D с формой [num_frames, height, width, 3]
. Порядок каналов RGB.
Публичные атрибуты
Общественные функции
узел
::tensorflow::Node * node() const
operator::tensorflow::Input() const
оператор::tensorflow::Выход
operator::tensorflow::Output() const
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-26 UTC.
[null,null,["Последнее обновление: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::DecodeGif Class Reference\n\ntensorflow::ops::DecodeGif\n==========================\n\n`#include \u003cimage_ops.h\u003e`\n\nDecode the frame(s) of a GIF-encoded image to a uint8 tensor.\n\nSummary\n-------\n\nGIF images with frame or transparency compression are not supported. On Linux and MacOS systems, convert animated GIFs from compressed to uncompressed by running: \n\n```text\nconvert $src.gif -coalesce $dst.gif\n```\n\n\u003cbr /\u003e\n\nThis op also supports decoding JPEGs and PNGs, though it is cleaner to use `tf.image.decode_image`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- contents: 0-D. The GIF-encoded image.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 4-D with shape `[num_frames, height, width, 3]`. RGB channel order.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DecodeGif](#classtensorflow_1_1ops_1_1_decode_gif_1ab8423cf80c3c768f78ee1ef985638c7f)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` contents)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [image](#classtensorflow_1_1ops_1_1_decode_gif_1a93c7d6f69c8b6e611635f88f1cf2bcd2) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_decode_gif_1ad61387b03e35b009466e71ba27fb1e79) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_decode_gif_1a2a2838eff458630e33d4e7f98fdb0a87)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_gif_1a66486826f8ac922a28aa67df6605c508)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_gif_1aeb51deab9ea7005cafb1582da6787efe)`() const ` | ` ` ` ` |\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### DecodeGif\n\n```gdscript\n DecodeGif(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input contents\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```"]]