Skip to content

Commit 0ea42ef

Browse files
rajveer43stevhliu
andauthored
Translate model_doc files from clip to cpm to JP (#27774)
* Add models * Add more models * Update docs/source/ja/model_doc/convnextv2.md Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> * Update docs/source/ja/model_doc/convbert.md Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> * Update docs/source/ja/model_doc/codegen.md Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> * Update translation errors and author names * link update --------- Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
1 parent 79b79ae commit 0ea42ef

File tree

11 files changed

+1118
-0
lines changed

11 files changed

+1118
-0
lines changed

docs/source/ja/_toctree.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,27 @@
284284
title: CamemBERT
285285
- local: model_doc/canine
286286
title: CANINE
287+
- local: model_doc/codegen
288+
title: CodeGen
289+
- local: model_doc/code_llama
290+
title: CodeLlama
291+
- local: model_doc/convbert
292+
title: ConvBERT
293+
- local: model_doc/cpm
294+
title: CPM
287295
title: 文章モデル
288296
- isExpanded: false
289297
sections:
290298
- local: model_doc/beit
291299
title: BEiT
292300
- local: model_doc/bit
293301
title: BiT
302+
- local: model_doc/conditional_detr
303+
title: Conditional DETR
304+
- local: model_doc/convnext
305+
title: ConvNeXT
306+
- local: model_doc/convnextv2
307+
title: ConvNeXTV2
294308
title: ビジョンモデル
295309
- isExpanded: false
296310
sections:
@@ -317,6 +331,12 @@
317331
title: BROS
318332
- local: model_doc/chinese_clip
319333
title: Chinese-CLIP
334+
- local: model_doc/clip
335+
title: CLIP
336+
- local: model_doc/clipseg
337+
title: CLIPSeg
338+
- local: model_doc/clvp
339+
title: CLVP
320340
title: マルチモーダルモデル
321341
- isExpanded: false
322342
sections:

docs/source/ja/model_doc/clip.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
12+
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
13+
rendered properly in your Markdown viewer.
14+
15+
-->
16+
17+
# CLIP
18+
19+
## Overview
20+
21+
CLIP モデルは、Alec Radford、Jong Wook Kim、Chris Hallacy、Aditya Ramesh、Gabriel Goh Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever [Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/abs/2103.00020) で提案されました。
22+
サンディニ・アガルワル、ギリッシュ・サストリー、アマンダ・アスケル、パメラ・ミシュキン、ジャック・クラーク、グレッチェン・クルーガー、イリヤ・サツケヴァー。クリップ
23+
(Contrastive Language-Image Pre-Training) は、さまざまな (画像、テキスト) ペアでトレーニングされたニューラル ネットワークです。かもね
24+
直接最適化することなく、与えられた画像から最も関連性の高いテキスト スニペットを予測するように自然言語で指示されます。
25+
GPT-2 および 3 のゼロショット機能と同様に、タスクに対して。
26+
27+
論文の要約は次のとおりです。
28+
29+
*最先端のコンピューター ビジョン システムは、あらかじめ定められたオブジェクト カテゴリの固定セットを予測するようにトレーニングされています。これ
30+
制限された形式の監視では、指定するために追加のラベル付きデータが必要となるため、一般性と使いやすさが制限されます。
31+
その他の視覚的なコンセプト。画像に関する生のテキストから直接学習することは、
32+
より広範な監督源。どのキャプションが表示されるかを予測するという単純な事前トレーニング タスクが有効であることを示します。
33+
400 のデータセットで SOTA 画像表現を最初から学習するための効率的かつスケーラブルな方法はどの画像ですか
34+
インターネットから収集された数百万の(画像、テキスト)ペア。事前トレーニング後、自然言語を使用して参照します。
35+
視覚的な概念を学習し(または新しい概念を説明し)、下流のタスクへのモデルのゼロショット転送を可能にします。私たちは勉強します
36+
30 を超えるさまざまな既存のコンピューター ビジョン データセットでタスクをまたがってベンチマークを行うことにより、このアプローチのパフォーマンスを評価します。
37+
OCR、ビデオ内のアクション認識、地理的位置特定、およびさまざまな種類のきめ細かいオブジェクト分類など。の
38+
モデルはほとんどのタスクに簡単に移行でき、多くの場合、必要がなくても完全に監視されたベースラインと競合します。
39+
データセット固有のトレーニングに適しています。たとえば、ImageNet ゼロショットではオリジナルの ResNet-50 の精度と一致します。
40+
トレーニングに使用された 128 万のトレーニング サンプルを使用する必要はありません。コードをリリースし、事前トレーニング済み
41+
モデルの重みはこの https URL で確認できます。*
42+
43+
このモデルは [valhalla](https://huggingface.co/valhalla) によって提供されました。元のコードは [ここ](https://github.com/openai/CLIP) にあります。
44+
45+
## Usage tips and example
46+
47+
CLIP は、マルチモーダルなビジョンおよび言語モデルです。画像とテキストの類似性やゼロショット画像に使用できます。
48+
分類。 CLIP は、ViT のようなトランスフォーマーを使用して視覚的特徴を取得し、因果言語モデルを使用してテキストを取得します
49+
特徴。次に、テキストと視覚の両方の特徴が、同じ次元の潜在空間に投影されます。ドット
50+
投影された画像とテキストの特徴間の積が同様のスコアとして使用されます。
51+
52+
画像を Transformer エンコーダに供給するために、各画像は固定サイズの重複しないパッチのシーケンスに分割されます。
53+
これらは線形に埋め込まれます。 [CLS] トークンは、イメージ全体の表現として機能するために追加されます。作家たち
54+
また、絶対位置埋め込みを追加し、結果として得られるベクトルのシーケンスを標準の Transformer エンコーダに供給します。
55+
[`CLIPImageProcessor`] を使用して、モデルの画像のサイズ変更 (または再スケール) および正規化を行うことができます。
56+
57+
[`CLIPTokenizer`] はテキストのエンコードに使用されます。 [`CLIPProcessor`] はラップします
58+
[`CLIPImageProcessor`][`CLIPTokenizer`] を両方の単一インスタンスに統合
59+
テキストをエンコードして画像を準備します。次の例は、次のメソッドを使用して画像とテキストの類似性スコアを取得する方法を示しています。
60+
[`CLIPProcessor`][`CLIPModel`]
61+
62+
```python
63+
>>> from PIL import Image
64+
>>> import requests
65+
66+
>>> from transformers import CLIPProcessor, CLIPModel
67+
68+
>>> model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
69+
>>> processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
70+
71+
>>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
72+
>>> image = Image.open(requests.get(url, stream=True).raw)
73+
74+
>>> inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)
75+
76+
>>> outputs = model(**inputs)
77+
>>> logits_per_image = outputs.logits_per_image # this is the image-text similarity score
78+
>>> probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
79+
```
80+
81+
## Resources
82+
83+
CLIP を使い始めるのに役立つ公式 Hugging Face およびコミュニティ (🌎 で示されている) リソースのリスト。
84+
85+
- [リモート センシング (衛星) 画像とキャプションを使用した CLIP の微調整](https://huggingface.co/blog/fine-tune-clip-rsicd)[RSICD データセット] を使用して CLIP を微調整する方法に関するブログ投稿(https://github.com/201528014227051/RSICD_optimal) と、データ拡張によるパフォーマンスの変化の比較。
86+
- この [サンプル スクリプト](https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text) は、プレ- [COCO データセット](https://cocodataset.org/#home) を使用してトレーニングされたビジョンおよびテキスト エンコーダー。
87+
88+
<PipelineTag pipeline="image-to-text"/>
89+
90+
- 画像キャプションのビーム検索による推論に事前トレーニング済み CLIP を使用する方法に関する [ノートブック](https://colab.research.google.com/drive/1tuoAC5F4sC7qid56Z0ap-stR3rwdk0ZV?usp=sharing)。 🌎
91+
92+
**画像検索**
93+
94+
- 事前トレーニングされた CLIP を使用した画像検索と MRR (平均相互ランク) スコアの計算に関する [ノートブック](https://colab.research.google.com/drive/1bLVwVKpAndpEDHqjzxVPr_9nGrSbuOQd?usp=sharing)。 🌎
95+
- 画像の取得と類似性スコアの表示に関する [ノートブック](https://colab.research.google.com/github/deep-diver/image_search_with_natural_language/blob/main/notebooks/Image_Search_CLIP.ipynb)。 🌎
96+
- 多言語 CLIP を使用して画像とテキストを同じベクトル空間にマッピングする方法に関する [ノートブック](https://colab.research.google.com/drive/1xO-wC_m_GNzgjIBQ4a4znvQkvDoZJvH4?usp=sharing)。 🌎
97+
- を使用してセマンティック イメージ検索で CLIP を実行する方法に関する [ノートブック](https://colab.research.google.com/github/vivien000/clip-demo/blob/master/clip.ipynb#scrollTo=uzdFhRGqiWkR) [Unsplash](https://unsplash.com) および [TMBD](https://www.themoviedb.org/) データセット。 🌎
98+
99+
**説明可能性**
100+
101+
- 入力トークンと画像セグメントの類似性を視覚化する方法に関する [ノートブック](https://colab.research.google.com/github/hila-chefer/Transformer-MM-Explainability/blob/main/CLIP_explainability.ipynb)。 🌎
102+
103+
ここに含めるリソースの送信に興味がある場合は、お気軽にプル リクエストを開いてください。審査させていただきます。
104+
リソースは、既存のリソースを複製するのではなく、何か新しいものを示すことが理想的です。
105+
106+
## CLIPConfig
107+
108+
[[autodoc]] CLIPConfig
109+
- from_text_vision_configs
110+
111+
## CLIPTextConfig
112+
113+
[[autodoc]] CLIPTextConfig
114+
115+
## CLIPVisionConfig
116+
117+
[[autodoc]] CLIPVisionConfig
118+
119+
## CLIPTokenizer
120+
121+
[[autodoc]] CLIPTokenizer
122+
- build_inputs_with_special_tokens
123+
- get_special_tokens_mask
124+
- create_token_type_ids_from_sequences
125+
- save_vocabulary
126+
127+
## CLIPTokenizerFast
128+
129+
[[autodoc]] CLIPTokenizerFast
130+
131+
## CLIPImageProcessor
132+
133+
[[autodoc]] CLIPImageProcessor
134+
- preprocess
135+
136+
## CLIPFeatureExtractor
137+
138+
[[autodoc]] CLIPFeatureExtractor
139+
140+
## CLIPProcessor
141+
142+
[[autodoc]] CLIPProcessor
143+
144+
<frameworkcontent>
145+
<pt>
146+
147+
## CLIPModel
148+
149+
[[autodoc]] CLIPModel
150+
- forward
151+
- get_text_features
152+
- get_image_features
153+
154+
## CLIPTextModel
155+
156+
[[autodoc]] CLIPTextModel
157+
- forward
158+
159+
## CLIPTextModelWithProjection
160+
161+
[[autodoc]] CLIPTextModelWithProjection
162+
- forward
163+
164+
## CLIPVisionModelWithProjection
165+
166+
[[autodoc]] CLIPVisionModelWithProjection
167+
- forward
168+
169+
## CLIPVisionModel
170+
171+
[[autodoc]] CLIPVisionModel
172+
- forward
173+
174+
</pt>
175+
<tf>
176+
177+
## TFCLIPModel
178+
179+
[[autodoc]] TFCLIPModel
180+
- call
181+
- get_text_features
182+
- get_image_features
183+
184+
## TFCLIPTextModel
185+
186+
[[autodoc]] TFCLIPTextModel
187+
- call
188+
189+
## TFCLIPVisionModel
190+
191+
[[autodoc]] TFCLIPVisionModel
192+
- call
193+
194+
</tf>
195+
<jax>
196+
197+
## FlaxCLIPModel
198+
199+
[[autodoc]] FlaxCLIPModel
200+
- __call__
201+
- get_text_features
202+
- get_image_features
203+
204+
## FlaxCLIPTextModel
205+
206+
[[autodoc]] FlaxCLIPTextModel
207+
- __call__
208+
209+
## FlaxCLIPTextModelWithProjection
210+
211+
[[autodoc]] FlaxCLIPTextModelWithProjection
212+
- __call__
213+
214+
## FlaxCLIPVisionModel
215+
216+
[[autodoc]] FlaxCLIPVisionModel
217+
- __call__
218+
219+
</jax>
220+
</frameworkcontent>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
12+
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
13+
rendered properly in your Markdown viewer.
14+
15+
-->
16+
17+
# CLIPSeg
18+
19+
## Overview
20+
21+
CLIPSeg モデルは、Timo Lüddecke, Alexander Ecker によって [Image Segmentation using Text and Image Prompts](https://arxiv.org/abs/2112.10003) で提案されました。
22+
そしてアレクサンダー・エッカー。 CLIPSeg は、ゼロショットおよびワンショット画像セグメンテーションのために、凍結された [CLIP](clip) モデルの上に最小限のデコーダを追加します。
23+
24+
論文の要約は次のとおりです。
25+
26+
*画像のセグメンテーションは通常、トレーニングによって解決されます。
27+
オブジェクト クラスの固定セットのモデル。後で追加のクラスやより複雑なクエリを組み込むとコストがかかります
28+
これらの式を含むデータセットでモデルを再トレーニングする必要があるためです。ここでシステムを提案します
29+
任意の情報に基づいて画像セグメンテーションを生成できます。
30+
テスト時にプロンプ​​トが表示されます。プロンプトはテキストまたは
31+
画像。このアプローチにより、統一されたモデルを作成できます。
32+
3 つの一般的なセグメンテーション タスクについて (1 回トレーニング済み)
33+
参照式のセグメンテーション、ゼロショット セグメンテーション、ワンショット セグメンテーションという明確な課題が伴います。
34+
CLIP モデルをバックボーンとして構築し、これをトランスベースのデコーダで拡張して、高密度なデータ通信を可能にします。
35+
予測。の拡張バージョンでトレーニングした後、
36+
PhraseCut データセット、私たちのシステムは、フリーテキスト プロンプトまたは
37+
クエリを表す追加の画像。後者の画像ベースのプロンプトのさまざまなバリエーションを詳細に分析します。
38+
この新しいハイブリッド入力により、動的適応が可能になります。
39+
前述の 3 つのセグメンテーション タスクのみですが、
40+
テキストまたは画像をクエリするバイナリ セグメンテーション タスクに
41+
定式化することができる。最後に、システムがうまく適応していることがわかりました
42+
アフォーダンスまたはプロパティを含む一般化されたクエリ*
43+
44+
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/clipseg_architecture.png"
45+
alt="描画" width="600"/>
46+
47+
<small> CLIPSeg の概要。 <a href="https://arxiv.org/abs/2112.10003">元の論文から抜粋。</a> </small>
48+
49+
このモデルは、[nielsr](https://huggingface.co/nielsr) によって提供されました。
50+
元のコードは [ここ](https://github.com/timojl/clipseg) にあります。
51+
52+
## Usage tips
53+
54+
- [`CLIPSegForImageSegmentation`] は、[`CLIPSegModel`] の上にデコーダを追加します。後者は [`CLIPModel`] と同じです。
55+
- [`CLIPSegForImageSegmentation`] は、テスト時に任意のプロンプトに基づいて画像セグメンテーションを生成できます。プロンプトはテキストのいずれかです
56+
(`input_ids` としてモデルに提供される) または画像 (`conditional_pixel_values` としてモデルに提供される)。カスタムを提供することもできます
57+
条件付き埋め込み (`conditional_embeddings`としてモデルに提供されます)。
58+
59+
## Resources
60+
61+
CLIPSeg の使用を開始するのに役立つ、公式 Hugging Face およびコミュニティ (🌎 で示されている) リソースのリスト。ここに含めるリソースの送信に興味がある場合は、お気軽にプル リクエストを開いてください。審査させていただきます。リソースは、既存のリソースを複製するのではなく、何か新しいものを示すことが理想的です。
62+
63+
<PipelineTag pipeline="image-segmentation"/>
64+
65+
- [CLIPSeg を使用したゼロショット画像セグメンテーション](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/CLIPSeg/Zero_shot_image_segmentation_with_CLIPSeg.ipynb) を説明するノートブック。
66+
67+
## CLIPSegConfig
68+
69+
[[autodoc]] CLIPSegConfig
70+
- from_text_vision_configs
71+
72+
## CLIPSegTextConfig
73+
74+
[[autodoc]] CLIPSegTextConfig
75+
76+
## CLIPSegVisionConfig
77+
78+
[[autodoc]] CLIPSegVisionConfig
79+
80+
## CLIPSegProcessor
81+
82+
[[autodoc]] CLIPSegProcessor
83+
84+
## CLIPSegModel
85+
86+
[[autodoc]] CLIPSegModel
87+
- forward
88+
- get_text_features
89+
- get_image_features
90+
91+
## CLIPSegTextModel
92+
93+
[[autodoc]] CLIPSegTextModel
94+
- forward
95+
96+
## CLIPSegVisionModel
97+
98+
[[autodoc]] CLIPSegVisionModel
99+
- forward
100+
101+
## CLIPSegForImageSegmentation
102+
103+
[[autodoc]] CLIPSegForImageSegmentation
104+
- forward

0 commit comments

Comments
 (0)