Update README.md
Browse files
README.md
CHANGED
@@ -6,163 +6,35 @@ pipeline_tag: image-to-text
|
|
6 |
|
7 |
# Blip Image Captioning Base BF16
|
8 |
|
9 |
-
This model is a
|
10 |
-
|
11 |
-
## Model Details
|
12 |
-
|
13 |
-
### Model Description
|
14 |
-
|
15 |
-
<!-- Provide a longer summary of what this model is. -->
|
16 |
-
|
17 |
-
- **Developed by:** Grantley Cullar
|
18 |
-
- **Funded by [optional]:** [More Information Needed]
|
19 |
-
- **Shared by [optional]:** [More Information Needed]
|
20 |
-
- **Model type:** Image-to-Text
|
21 |
-
- **Language(s) (NLP):** English
|
22 |
-
- **License:** MIT License
|
23 |
-
|
24 |
-
### Model Sources [optional]
|
25 |
-
|
26 |
-
<!-- Provide the basic links for the model. -->
|
27 |
-
|
28 |
-
- **Repository:** [More Information Needed]
|
29 |
-
- **Paper [optional]:** [More Information Needed]
|
30 |
-
- **Demo [optional]:** [More Information Needed]
|
31 |
-
|
32 |
-
## Uses
|
33 |
-
|
34 |
-
You can use this model for conditional and un-conditional image captioning
|
35 |
-
|
36 |
-
### Direct Use
|
37 |
-
|
38 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
39 |
-
|
40 |
-
[More Information Needed]
|
41 |
-
|
42 |
-
### Downstream Use [optional]
|
43 |
-
|
44 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
45 |
-
|
46 |
-
[More Information Needed]
|
47 |
-
|
48 |
-
### Out-of-Scope Use
|
49 |
-
|
50 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
51 |
-
|
52 |
-
[More Information Needed]
|
53 |
-
|
54 |
-
## Bias, Risks, and Limitations
|
55 |
-
|
56 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
57 |
-
|
58 |
-
[More Information Needed]
|
59 |
-
|
60 |
-
### Recommendations
|
61 |
-
|
62 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
63 |
-
|
64 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
65 |
|
66 |
## How to Get Started with the Model
|
67 |
|
68 |
Use the code below to get started with the model.
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
75 |
-
|
76 |
-
### Testing Data, Factors & Metrics
|
77 |
-
|
78 |
-
#### Testing Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card if possible. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
#### Factors
|
85 |
-
|
86 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
87 |
-
|
88 |
-
[More Information Needed]
|
89 |
|
90 |
-
|
|
|
91 |
|
92 |
-
|
|
|
93 |
|
94 |
-
|
|
|
|
|
|
|
95 |
|
96 |
-
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
#### Summary
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
## Model Examination [optional]
|
105 |
-
|
106 |
-
<!-- Relevant interpretability work for the model goes here -->
|
107 |
-
|
108 |
-
[More Information Needed]
|
109 |
-
|
110 |
-
## Environmental Impact
|
111 |
-
|
112 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
113 |
-
|
114 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
115 |
-
|
116 |
-
- **Hardware Type:** [More Information Needed]
|
117 |
-
- **Hours used:** [More Information Needed]
|
118 |
-
- **Cloud Provider:** [More Information Needed]
|
119 |
-
- **Compute Region:** [More Information Needed]
|
120 |
-
- **Carbon Emitted:** [More Information Needed]
|
121 |
-
|
122 |
-
## Technical Specifications [optional]
|
123 |
-
|
124 |
-
### Model Architecture and Objective
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
### Compute Infrastructure
|
129 |
-
|
130 |
-
[More Information Needed]
|
131 |
-
|
132 |
-
#### Hardware
|
133 |
-
|
134 |
-
[More Information Needed]
|
135 |
-
|
136 |
-
#### Software
|
137 |
-
|
138 |
-
[More Information Needed]
|
139 |
-
|
140 |
-
## Citation [optional]
|
141 |
-
|
142 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
143 |
-
|
144 |
-
**BibTeX:**
|
145 |
-
|
146 |
-
[More Information Needed]
|
147 |
-
|
148 |
-
**APA:**
|
149 |
-
|
150 |
-
[More Information Needed]
|
151 |
-
|
152 |
-
## Glossary [optional]
|
153 |
-
|
154 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
155 |
-
|
156 |
-
[More Information Needed]
|
157 |
-
|
158 |
-
## More Information [optional]
|
159 |
-
|
160 |
-
[More Information Needed]
|
161 |
-
|
162 |
-
## Model Card Authors [optional]
|
163 |
-
|
164 |
-
[More Information Needed]
|
165 |
-
|
166 |
-
## Model Card Contact
|
167 |
|
168 |
-
|
|
|
|
|
|
|
|
6 |
|
7 |
# Blip Image Captioning Base BF16
|
8 |
|
9 |
+
This model is a quantized version of the [Salesforce/blip-image-captioning-base](https://huggingface.co/Salesforce/blip-image-captioning-base), an image-to-text model.
|
10 |
+
From its original size of 989 MBs -> 494 MBs by quantizing the percision of float32 to bfloat 16, reducing the model's memory size by 50 percent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
## How to Get Started with the Model
|
13 |
|
14 |
Use the code below to get started with the model.
|
15 |
|
16 |
+
```python
|
17 |
+
from transformers import BlipForConditionalGeneration, BlipProcessor
|
18 |
+
import requests
|
19 |
+
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
model = BlipForConditionalGeneration.from_pretrained("gospacedev/blip-image-captioning-base-bf16")
|
22 |
+
processor = BlipProcessor.from_pretrained("gospacedev/blip-image-captioning-base-bf16")
|
23 |
|
24 |
+
# Load sample image
|
25 |
+
image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')
|
26 |
|
27 |
+
# Generate output
|
28 |
+
inputs = processor(image, return_tensors="pt")
|
29 |
+
output = model.generate(**inputs)
|
30 |
+
result = processor.decode(out[0], skip_special_tokens=True)
|
31 |
|
32 |
+
print(results)
|
33 |
+
```
|
34 |
|
35 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
- **Developed by:** Grantley Cullar
|
38 |
+
- **Model type:** Image-to-Text
|
39 |
+
- **Language(s) (NLP):** English
|
40 |
+
- **License:** MIT License
|