-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
30 lines (22 loc) · 902 Bytes
/
Main.py
File metadata and controls
30 lines (22 loc) · 902 Bytes
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
import streamlit as st
import Libs as glib
import json
import sys
sys.path.append("../Libs")
import Libs as lib
def main():
st.title("Input your text and image")
st.markdown("Generate Katalon code to test the page")
st.markdown("Count number of pigs in the image")
input_text = st.text_area("Input your question")
image_bytes = ""
st.subheader("Select an Image")
uploaded_file = st.file_uploader("Select an image", type=['png', 'jpeg'], label_visibility="collapsed")
if uploaded_file:
uploaded_image_preview = lib.get_bytesio_from_bytes(uploaded_file.getvalue())
image_bytes = uploaded_file.getvalue()
st.image(uploaded_image_preview)
go_button = st.button("Go", type="primary")
if input_text and go_button:
response = glib.get_response_from_model(input_text, image_bytes)
st.write_stream(response)