เทนเซอร์โฟลว์:: ปฏิบัติการ:: ถอดรหัสPng

#include <image_ops.h>

ถอดรหัสภาพที่เข้ารหัส PNG เป็น uint8 หรือ uint16 เทนเซอร์

สรุป

channels attr ระบุจำนวนช่องสีที่ต้องการสำหรับภาพที่ถอดรหัส

ค่าที่ยอมรับคือ:

  • 0: ใช้จำนวนช่องในภาพที่เข้ารหัส PNG
  • 1: ส่งออกภาพระดับสีเทา
  • 3: ส่งออกภาพ RGB
  • 4: ส่งออกภาพ RGBA

หากจำเป็น รูปภาพที่เข้ารหัส PNG จะถูกแปลงให้ตรงกับจำนวนช่องสีที่ร้องขอ

op นี้ยังรองรับการถอดรหัส JPEG และ GIF ที่ไม่ใช่ภาพเคลื่อนไหวเนื่องจากอินเทอร์เฟซเหมือนกัน แม้ว่าการใช้ tf.image.decode_image จะสะอาดกว่าก็ตาม

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • เนื้อหา: 0-D รูปภาพที่เข้ารหัส PNG

แอ็ตทริบิวต์ทางเลือก (ดู Attrs ):

  • ช่อง: จำนวนช่องสีสำหรับภาพที่ถอดรหัส

ผลตอบแทน:

  • Output : 3 มิติพร้อมรูปทรง [height, width, channels]

ตัวสร้างและผู้ทำลาย

DecodePng (const :: tensorflow::Scope & scope, :: tensorflow::Input contents)
DecodePng (const :: tensorflow::Scope & scope, :: tensorflow::Input contents, const DecodePng::Attrs & attrs)

คุณลักษณะสาธารณะ

image
operation

งานสาธารณะ

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

ฟังก์ชันคงที่สาธารณะ

Channels (int64 x)
Dtype (DataType x)

โครงสร้าง

เทนเซอร์โฟลว์ :: ops :: DecodePng :: Attrs

ตัวตั้งค่าแอตทริบิวต์เพิ่มเติมสำหรับ DecodePng

คุณลักษณะสาธารณะ

ภาพ

::tensorflow::Output image

การดำเนินการ

Operation operation

งานสาธารณะ

ถอดรหัสPng

 DecodePng(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input contents
)

ถอดรหัสPng

 DecodePng(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input contents,
  const DecodePng::Attrs & attrs
)

โหนด

::tensorflow::Node * node() const 

ตัวดำเนินการ::tensorflow::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::tensorflow::เอาต์พุต

 operator::tensorflow::Output() const 

ฟังก์ชันคงที่สาธารณะ

ช่อง

Attrs Channels(
  int64 x
)

ประเภทD

Attrs Dtype(
  DataType x
)