File size: 5,302 Bytes
17c6d62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!--Copyright 2023 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.

-->

# BLIP[[blip]]

## κ°œμš”[[overview]]

BLIP λͺ¨λΈμ€ Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi의 [BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation](https://arxiv.org/abs/2201.12086) λ…Όλ¬Έμ—μ„œ μ œμ•ˆλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

BLIP은 μ—¬λŸ¬ λ©€ν‹°λͺ¨λ‹¬ μž‘μ—…μ„ μˆ˜ν–‰ν•  수 μžˆλŠ” λͺ¨λΈμž…λ‹ˆλ‹€:

- μ‹œκ° 질문 응닡 (Visual Question Answering, VQA)
- 이미지-ν…μŠ€νŠΈ 검색 (이미지-ν…μŠ€νŠΈ λ§€μΉ­)
- 이미지 캑셔닝

λ…Όλ¬Έμ˜ μ΄ˆλ‘μ€ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:

*λΉ„μ „-μ–Έμ–΄ 사전 ν•™μŠ΅(Vision-Language Pre-training, VLP)은 λ‹€μ–‘ν•œ λΉ„μ „-μ–Έμ–΄ μž‘μ—…μ˜ μ„±λŠ₯을 크게 ν–₯μƒμ‹œμΌ°μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ, λŒ€λΆ€λΆ„μ˜ κΈ°μ‘΄ 사전 ν•™μŠ΅ λͺ¨λΈλ“€μ€ 이해 기반 μž‘μ—…μ΄λ‚˜ 생성 기반 μž‘μ—… 쀑 ν•˜λ‚˜μ—μ„œλ§Œ λ›°μ–΄λ‚œ μ„±λŠ₯을 λ°œνœ˜ν•©λ‹ˆλ‹€. λ˜ν•œ μ„±λŠ₯ ν–₯상은 주둜 μ›Ήμ—μ„œ μˆ˜μ§‘ν•œ λ…Έμ΄μ¦ˆκ°€ λ§Žμ€ 이미지-ν…μŠ€νŠΈ 쌍으둜 λ°μ΄ν„°μ…‹μ˜ 규λͺ¨λ₯Ό ν‚€μš°λŠ” λ°©μ‹μœΌλ‘œ μ΄λ£¨μ–΄μ‘ŒλŠ”λ°, μ΄λŠ” 졜적의 지도 ν•™μŠ΅ 방식이라고 보기 μ–΄λ ΅μŠ΅λ‹ˆλ‹€. λ³Έ λ…Όλ¬Έμ—μ„œλŠ” BLIPμ΄λΌλŠ” μƒˆλ‘œμš΄ VLP ν”„λ ˆμž„μ›Œν¬λ₯Ό μ œμ•ˆν•©λ‹ˆλ‹€. 이 ν”„λ ˆμž„μ›Œν¬λŠ” λΉ„μ „-μ–Έμ–΄ 이해 및 생성 μž‘μ—… λͺ¨λ‘μ— μœ μ—°ν•˜κ²Œ 적용될 수 μžˆμŠ΅λ‹ˆλ‹€. BLIPλŠ” μΊ‘μ…”λ„ˆκ°€ ν•©μ„± μΊ‘μ…˜μ„ μƒμ„±ν•˜κ³  ν•„ν„°κ°€ λ…Έμ΄μ¦ˆ μΊ‘μ…˜μ„ μ œκ±°ν•˜λŠ” λΆ€νŠΈμŠ€νŠΈλž˜ν•‘ 방법을 톡해 μ›Ή λ°μ΄ν„°μ˜ λ…Έμ΄μ¦ˆλ₯Ό 효과적으둜 ν™œμš©ν•©λ‹ˆλ‹€. μš°λ¦¬λŠ” 이미지-ν…μŠ€νŠΈ 검색(Recall@1μ—μ„œ +2.7%), 이미지 캑셔닝(CIDErμ—μ„œ +2.8%), 그리고 VQA(VQA μ μˆ˜μ—μ„œ +1.6%)와 같은 λ‹€μ–‘ν•œ λΉ„μ „-μ–Έμ–΄ μž‘μ—…μ—μ„œ μ΅œμ‹  μ„±κ³Όλ₯Ό λ‹¬μ„±ν–ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ BLIP은 μ œλ‘œμƒ· λ°©μ‹μœΌλ‘œ λΉ„λ””μ˜€-μ–Έμ–΄ μž‘μ—…μ— 직접 전이될 λ•Œλ„ κ°•λ ₯ν•œ μΌλ°˜ν™” λŠ₯λ ₯을 λ³΄μ—¬μ€λ‹ˆλ‹€. 이 λ…Όλ¬Έμ˜ μ½”λ“œ, λͺ¨λΈ, 데이터셋은 κ³΅κ°œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.*

![BLIP.gif](https://cdn-uploads.huggingface.co/production/uploads/1670928184033-62441d1d9fdefb55a0b7d12c.gif)

이 λͺ¨λΈμ€ [ybelkada](https://huggingface.co/ybelkada)κ°€ κΈ°μ—¬ν–ˆμŠ΅λ‹ˆλ‹€.
원본 μ½”λ“œλŠ” [μ—¬κΈ°](https://github.com/salesforce/BLIP)μ—μ„œ 찾을 수 μžˆμŠ΅λ‹ˆλ‹€.

## 자료[[resources]]

- [Jupyter notebook](https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb): μ‚¬μš©μž μ •μ˜ λ°μ΄ν„°μ…‹μ—μ„œ BLIPλ₯Ό 이미지 μΊ‘μ…”λ‹μœΌλ‘œ λ―Έμ„Έ μ‘°μ •ν•˜λŠ” 방법

## BlipConfig[[transformers.BlipConfig]]

[[autodoc]] BlipConfig
    - from_text_vision_configs

## BlipTextConfig[[transformers.BlipTextConfig]]

[[autodoc]] BlipTextConfig

## BlipVisionConfig[[transformers.BlipVisionConfig]]

[[autodoc]] BlipVisionConfig

## BlipProcessor[[transformers.BlipProcessor]]

[[autodoc]] BlipProcessor

## BlipImageProcessor[[transformers.BlipImageProcessor]]

[[autodoc]] BlipImageProcessor
    - preprocess

<frameworkcontent>
<pt>

## BlipModel[[transformers.BlipModel]]

`BlipModel`은 ν–₯ν›„ λ²„μ „μ—μ„œ 더 이상 μ§€μ›λ˜μ§€ μ•Šμ„ μ˜ˆμ •μž…λ‹ˆλ‹€. λͺ©μ μ— 따라 `BlipForConditionalGeneration`, `BlipForImageTextRetrieval` λ˜λŠ” `BlipForQuestionAnswering`을 μ‚¬μš©ν•˜μ‹­μ‹œμ˜€.

[[autodoc]] BlipModel
    - forward
    - get_text_features
    - get_image_features

## BlipTextModel[[transformers.BlipTextModel]]

[[autodoc]] BlipTextModel
    - forward

## BlipVisionModel[[transformers.BlipVisionModel]]

[[autodoc]] BlipVisionModel
    - forward

## BlipForConditionalGeneration[[transformers.BlipForConditionalGeneration]]

[[autodoc]] BlipForConditionalGeneration
    - forward

## BlipForImageTextRetrieval[[transformers.BlipForImageTextRetrieval]]

[[autodoc]] BlipForImageTextRetrieval
    - forward

## BlipForQuestionAnswering[[transformers.BlipForQuestionAnswering]]

[[autodoc]] BlipForQuestionAnswering
    - forward

</pt>
<tf>

## TFBlipModel[[transformers.TFBlipModel]]

[[autodoc]] TFBlipModel
    - call
    - get_text_features
    - get_image_features

## TFBlipTextModel[[transformers.TFBlipTextModel]]

[[autodoc]] TFBlipTextModel
    - call

## TFBlipVisionModel[[transformers.TFBlipVisionModel]]

[[autodoc]] TFBlipVisionModel
    - call

## TFBlipForConditionalGeneration[[transformers.TFBlipForConditionalGeneration]]

[[autodoc]] TFBlipForConditionalGeneration
    - call

## TFBlipForImageTextRetrieval[[transformers.TFBlipForImageTextRetrieval]]

[[autodoc]] TFBlipForImageTextRetrieval
    - call

## TFBlipForQuestionAnswering[[transformers.TFBlipForQuestionAnswering]]

[[autodoc]] TFBlipForQuestionAnswering
    - call
</tf>
</frameworkcontent>