awacke1's picture
Update app.py
985be42
raw
history blame
743 Bytes
import streamlit as st
import pandas as pd
from io import StringIO
from PIL import Image
import graphviz as gv
uploaded_files = st.file_uploader("Choose an image file", accept_multiple_files=True, type=["jpg", "jpeg", "png"])
images = []
for uploaded_file in uploaded_files:
# To read file as bytes:
bytes_data = uploaded_file.getvalue()
# To convert to a PIL image:
image = Image.open(uploaded_file)
images.append(image)
# Create the Graphviz model using the uploaded images
dot = gv.Digraph()
for i, image in enumerate(images):
dot.node(str(i), image=image)
for i in range(len(images) - 1):
dot.edge(str(i), str(i+1))
# Render the Graphviz model using the Streamlit framework
st.graphviz_chart(dot.source)