FranklinMoses
commited on
Commit
•
6000a14
1
Parent(s):
e31d1dc
textembed
Browse files
app.py
CHANGED
@@ -29,13 +29,19 @@ st.title('DeGirum CLIP model Demo')
|
|
29 |
|
30 |
with st.sidebar:
|
31 |
st.header('Specify Model Options Below')
|
|
|
32 |
prompts = st.text_area("Enter text prompts (comma-separated):", value="People Running, People Talking, People Fighting, People Laughing, People Dancing")
|
33 |
prompts = [prompt.strip() for prompt in prompts.split(',')]
|
|
|
|
|
|
|
|
|
|
|
34 |
st.text('Upload an image. Then click on the submit button')
|
35 |
with st.form("model_form"):
|
36 |
uploaded_file=st.file_uploader('input image')
|
37 |
submitted = st.form_submit_button("Submit")
|
38 |
-
embeddings = compute_text_embeddings(prompts)
|
39 |
if submitted:
|
40 |
model=zoo.load_model('clip--224x224_float_openvino_cpu_4',
|
41 |
input_image_format = "RAW"
|
|
|
29 |
|
30 |
with st.sidebar:
|
31 |
st.header('Specify Model Options Below')
|
32 |
+
|
33 |
prompts = st.text_area("Enter text prompts (comma-separated):", value="People Running, People Talking, People Fighting, People Laughing, People Dancing")
|
34 |
prompts = [prompt.strip() for prompt in prompts.split(',')]
|
35 |
+
if st.button("Generate Text Embedding"):
|
36 |
+
# Call the compute_text_embeddings function when the button is clicked
|
37 |
+
embeddings = compute_text_embeddings(prompts)
|
38 |
+
st.success("Text embeddings generated successfully!")
|
39 |
+
|
40 |
st.text('Upload an image. Then click on the submit button')
|
41 |
with st.form("model_form"):
|
42 |
uploaded_file=st.file_uploader('input image')
|
43 |
submitted = st.form_submit_button("Submit")
|
44 |
+
# embeddings = compute_text_embeddings(prompts)
|
45 |
if submitted:
|
46 |
model=zoo.load_model('clip--224x224_float_openvino_cpu_4',
|
47 |
input_image_format = "RAW"
|