Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,12 @@ from PIL import Image
|
|
| 4 |
|
| 5 |
pipe_caption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 6 |
|
| 7 |
-
st.title("AI story telling for kids")
|
| 8 |
|
| 9 |
-
uploaded_file = st.file_uploader("
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
pipe_caption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 6 |
|
| 7 |
+
st.title("AI story telling for kids") # Establish title
|
| 8 |
|
| 9 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
| 10 |
+
|
| 11 |
+
if uploaded_file is not None: # Check if a file is uploaded
|
| 12 |
+
image = Image.open(uploaded_file)
|
| 13 |
+
st.image(image, caption="Uploaded Image", use_column_width=True)
|
| 14 |
+
else:
|
| 15 |
+
st.warning("Please upload an image.")
|