Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,6 +101,24 @@ def main():
|
|
| 101 |
<p>Upload an image and get AI-generated captions instantly!</p>
|
| 102 |
</div>
|
| 103 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
# Main content
|
| 105 |
col1, col2 = st.columns([1, 1])
|
| 106 |
|
|
@@ -143,7 +161,7 @@ def main():
|
|
| 143 |
|
| 144 |
# Generate caption
|
| 145 |
caption = generate_caption(
|
| 146 |
-
image, processor, model, device
|
| 147 |
)
|
| 148 |
|
| 149 |
end_time = time.time()
|
|
@@ -176,7 +194,7 @@ def main():
|
|
| 176 |
st.markdown("---")
|
| 177 |
st.markdown("""
|
| 178 |
<div style="text-align: center; color: #666;">
|
| 179 |
-
<p>Built using <strong>Streamlit</strong> and <strong>Hugging Face Transformers</strong></p>
|
| 180 |
<p>Powered by <strong>BLIP-2</strong> - Bootstrapping Language-Image Pre-training</p>
|
| 181 |
</div>
|
| 182 |
""", unsafe_allow_html=True)
|
|
|
|
| 101 |
<p>Upload an image and get AI-generated captions instantly!</p>
|
| 102 |
</div>
|
| 103 |
""", unsafe_allow_html=True)
|
| 104 |
+
|
| 105 |
+
# Sidebar
|
| 106 |
+
with st.sidebar:
|
| 107 |
+
st.header("🔧 Settings")
|
| 108 |
+
st.markdown("### Model Information")
|
| 109 |
+
st.info("Using **BLIP-2** (Salesforce/blip2-opt-2.7b)")
|
| 110 |
+
|
| 111 |
+
st.markdown("### About")
|
| 112 |
+
st.markdown("""
|
| 113 |
+
This app uses the **BLIP-2** model to generate natural language descriptions of images.
|
| 114 |
+
|
| 115 |
+
**Features:**
|
| 116 |
+
- 🖼️ Upload any image format
|
| 117 |
+
- 🤖 AI-powered captioning
|
| 118 |
+
- ⚡ Fast inference
|
| 119 |
+
- 🎯 Optional custom prompts
|
| 120 |
+
""")
|
| 121 |
+
|
| 122 |
# Main content
|
| 123 |
col1, col2 = st.columns([1, 1])
|
| 124 |
|
|
|
|
| 161 |
|
| 162 |
# Generate caption
|
| 163 |
caption = generate_caption(
|
| 164 |
+
image, processor, model, device
|
| 165 |
)
|
| 166 |
|
| 167 |
end_time = time.time()
|
|
|
|
| 194 |
st.markdown("---")
|
| 195 |
st.markdown("""
|
| 196 |
<div style="text-align: center; color: #666;">
|
| 197 |
+
<p>Built with ❤️ using <strong>Streamlit</strong> and <strong>Hugging Face Transformers</strong></p>
|
| 198 |
<p>Powered by <strong>BLIP-2</strong> - Bootstrapping Language-Image Pre-training</p>
|
| 199 |
</div>
|
| 200 |
""", unsafe_allow_html=True)
|