Spaces:
Sleeping
Sleeping
File size: 982 Bytes
1e1a418 96072ff f99ea1d 96072ff 37bed6c 1e1a418 6d07f80 37bed6c f99ea1d 37bed6c f99ea1d |
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 |
import torch
import re
import langchain
from PIL import Image
import requests
import streamlit as st
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
from PIL import Image
import requests
from langchain.indexes import VectorstoreIndexCreator
from langchain.document_loaders import ImageCaptionLoader
st.set_page_config(page_title="Captionize")
st.title("🤖 Captionize")
st.subheader("Generate Captions for your Image...")
st.sidebar.image('./csv_analysis.png',width=300, use_column_width=True)
# Applying Styling
st.markdown("""
<style>
div.stButton > button:first-child {
background-color: #0099ff;
color:#ffffff;
}
div.stButton > button:hover {
background-color: #00ff00;
color:#FFFFFF;
}
</style>""", unsafe_allow_html=True)
image = st.file_uploader("Upload an image", type="jpg")
caption = langchain.generate_caption(image)
button = st.button("Generate Caption")
if button:
st.write("Caption:", caption) |