Spaces:
Running
Running
Add search buttons
Browse files
app.py
CHANGED
@@ -27,11 +27,16 @@ st.sidebar.image("./assets/logo.png", width=100)
|
|
27 |
st.sidebar.empty()
|
28 |
st.sidebar.markdown("""Search for medical images with natural language powered by a CLIP model [[Model Card]](https://huggingface.co/flax-community/medclip-roco) finetuned on the
|
29 |
[Radiology Objects in COntext (ROCO) dataset](https://github.com/razorx89/roco-dataset).""")
|
30 |
-
st.sidebar.markdown("
|
31 |
-
* `ultrasound scans`π
|
32 |
-
* `pathology`π
|
33 |
-
* `pancreatic carcinoma`π
|
34 |
-
* `PET scan`π""")
|
|
|
|
|
|
|
|
|
|
|
35 |
k_slider = st.sidebar.slider("Number of images", min_value=1, max_value=10, value=5)
|
36 |
st.sidebar.markdown("Kaushalya Madhawa, 2021")
|
37 |
|
@@ -44,11 +49,21 @@ st.title("MedCLIP π©Ί")
|
|
44 |
# * `pathology`π
|
45 |
# * `pancreatic carcinoma`π
|
46 |
# * `PET scan`π""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
image_list, image_embeddings = load_image_embeddings()
|
49 |
model, processor = load_model()
|
50 |
|
51 |
-
query = st.text_input("Enter your query here:")
|
52 |
dot_prod = None
|
53 |
|
54 |
if st.button("Search") or k_slider:
|
|
|
27 |
st.sidebar.empty()
|
28 |
st.sidebar.markdown("""Search for medical images with natural language powered by a CLIP model [[Model Card]](https://huggingface.co/flax-community/medclip-roco) finetuned on the
|
29 |
[Radiology Objects in COntext (ROCO) dataset](https://github.com/razorx89/roco-dataset).""")
|
30 |
+
st.sidebar.markdown("Example queries:")
|
31 |
+
# * `ultrasound scans`π
|
32 |
+
# * `pathology`π
|
33 |
+
# * `pancreatic carcinoma`π
|
34 |
+
# * `PET scan`π""")
|
35 |
+
ex1_button = st.sidebar.button("π pathology")
|
36 |
+
ex2_button = st.sidebar.button("π ultrasound scans")
|
37 |
+
ex3_button = st.sidebar.button("π pancreatic carcinoma")
|
38 |
+
ex4_button = st.sidebar.button("π PET scan")
|
39 |
+
|
40 |
k_slider = st.sidebar.slider("Number of images", min_value=1, max_value=10, value=5)
|
41 |
st.sidebar.markdown("Kaushalya Madhawa, 2021")
|
42 |
|
|
|
49 |
# * `pathology`π
|
50 |
# * `pancreatic carcinoma`π
|
51 |
# * `PET scan`π""")
|
52 |
+
text_value = ''
|
53 |
+
if ex1_button:
|
54 |
+
text_value = 'pathology'
|
55 |
+
elif ex2_button:
|
56 |
+
text_value = 'ultrasound scans'
|
57 |
+
elif ex3_button:
|
58 |
+
text_value = 'pancreatic carcinoma'
|
59 |
+
elif ex4_button:
|
60 |
+
text_value = 'PET scan'
|
61 |
+
|
62 |
|
63 |
image_list, image_embeddings = load_image_embeddings()
|
64 |
model, processor = load_model()
|
65 |
|
66 |
+
query = st.text_input("Enter your query here:", value=text_value)
|
67 |
dot_prod = None
|
68 |
|
69 |
if st.button("Search") or k_slider:
|