Buckets:
出力
すべてのモデルの出力は、モデルが返すすべての情報を含むデータ構造であるBaseOutputのサブクラスです。出力は、タプルや辞書としても使用できます。
例えば:
from diffusers import DDIMPipeline
pipeline = DDIMPipeline.from_pretrained("google/ddpm-cifar10-32")
outputs = pipeline()
outputs オブジェクトは ImagePipelineOutput であり、image 属性を持つことを意味します。
各属性は、通常の方法やキーワード検索によってアクセスできます。モデルによって返されない属性の場合、Noneが返されます。
outputs.images
outputs["images"]
outputsオブジェクトをタプルとして扱う場合、Noneの値を持たない属性のみが対象となります。例えば、インデックスで画像を取得すると、タプル(outputs.images)が返されます。
outputs[:1]
特定のpipelineまたはモデルの出力を確認するには、それぞれのAPIドキュメントを参照してください。
BaseOutput[[diffusers.utils.BaseOutput]]
diffusers.utils.BaseOutput[[diffusers.utils.BaseOutput]]
すべてのモデル出力の基底クラスであり、dataclass として実装されています。__getitem__ を備えており、整数やスライス(タプルと同様)または文字列(辞書と同様)によるインデックス指定が可能です。この際、None 属性は無視されます。それ以外の動作は、通常の Python 辞書と同様です。
>
BaseOutputを直接アンパックすることはできません。to_tuple() メソッドを使用して変換してください it をタプル > 最初に。
to_tuple[[diffusers.utils.BaseOutput.to_tuple]]
to_tuple()
None 以外のすべての属性/キーを含むタプルに self を変換します。
ImagePipelineOutput[[diffusers.ImagePipelineOutput]]
diffusers.ImagePipelineOutput[[diffusers.ImagePipelineOutput]]
diffusers.ImagePipelineOutput(images: list[PIL.Image.Image] | numpy.ndarray)
パラメータ:
images (List[PIL.Image.Image] または np.ndarray) : 長さ batch_size のデノイズ済み PIL 画像のリスト、または形状 (batch_size, height, width, num_channels) の NumPy 配列。
画像パイプライン用の出力クラス。
AudioPipelineOutput[[diffusers.AudioPipelineOutput]]
diffusers.AudioPipelineOutput[[diffusers.AudioPipelineOutput]]
diffusers.AudioPipelineOutput(audios: ndarray)
パラメータ:
audios (np.ndarray) : 形状が (batch_size, num_channels, sample_rate) の NumPy 配列のデノイズ済みオーディオサンプルのリスト。
音声パイプライン用の出力クラス。
ImageTextPipelineOutput[[diffusers.ImageTextPipelineOutput]]
diffusers.ImageTextPipelineOutput[[diffusers.ImageTextPipelineOutput]]
diffusers.ImageTextPipelineOutput(images: list[PIL.Image.Image] | numpy.ndarray | None, text: list[str] | list[list[str]] | None)
パラメータ:
images (list[PIL.Image.Image] または np.ndarray) : 長さ batch_size のノイズ除去済み PIL 画像のリスト、または形状 (batch_size, height, width, num_channels) の NumPy 配列。
text (list[str] または list[list[str]]) : 長さ batch_size の生成テキスト文字列のリスト、または外側のリストの長さが batch_size である文字列のリストのリスト。
画像とテキストのジョイントパイプライン用の出力クラス。
Xet Storage Details
- Size:
- 4.49 kB
- Xet hash:
- aea53be21ea93faeebc1ec1a813961ef2569c3c8803637853bf9654f8bfe42d7
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.