ChandraP12330 commited on
Commit
11c68ac
1 Parent(s): aef0260

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ from PIL import Image
4
+ import torch
5
+
6
+ ##BLIP
7
+ # Create the caption pipeline
8
+ initial_caption_pipe = pipeline('image-to-text', model="Salesforce/blip-image-captioning-large")
9
+
10
+ # Display the image using Streamlit
11
+ uploaded_image = st.file_uploader("Upload an image", type=["png", "jpg", "jpeg"])
12
+ if uploaded_image is not None:
13
+ image= Image.open(uploaded_image)
14
+ st.image(image, caption="Uploaded Image", use_column_width=True)