app updated
Browse files
app.py
CHANGED
@@ -27,12 +27,6 @@ api_key = st.secrets["PALM_API_KEY"]
|
|
27 |
palm.configure(api_key=api_key)
|
28 |
|
29 |
|
30 |
-
# Load YOLO pipeline
|
31 |
-
yolo_pipe = pipeline(
|
32 |
-
"object-detection", model="eagle0504/detr-finetuned-balloon-v2"
|
33 |
-
) # "hustvl/yolos-small"
|
34 |
-
|
35 |
-
|
36 |
# Main function of the Streamlit app
|
37 |
def main():
|
38 |
st.title("Generative AI Demo on Camera Input/Image/PDF 💻")
|
@@ -151,6 +145,23 @@ def main():
|
|
151 |
if image is not None:
|
152 |
st.sidebar.success("Check the following box to run YOLO algorithm if desired!")
|
153 |
use_yolo = st.sidebar.checkbox("Use YOLO!", value=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
if use_yolo:
|
156 |
# Process image with YOLO
|
|
|
27 |
palm.configure(api_key=api_key)
|
28 |
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
# Main function of the Streamlit app
|
31 |
def main():
|
32 |
st.title("Generative AI Demo on Camera Input/Image/PDF 💻")
|
|
|
145 |
if image is not None:
|
146 |
st.sidebar.success("Check the following box to run YOLO algorithm if desired!")
|
147 |
use_yolo = st.sidebar.checkbox("Use YOLO!", value=False)
|
148 |
+
if use_yolo:
|
149 |
+
yolo_option = st.selectbox(
|
150 |
+
"Which YOLO algorithm would you like?",
|
151 |
+
("hustvl/yolos-small", "eagle0504/detr-finetuned-balloon-v2"),
|
152 |
+
)
|
153 |
+
else:
|
154 |
+
yolo_option = None
|
155 |
+
|
156 |
+
# Load YOLO pipeline
|
157 |
+
if yolo_option == "hustvl/yolos-small":
|
158 |
+
yolo_pipe = pipeline("object-detection", model="hustvl/yolos-small")
|
159 |
+
elif yolo_option == "eagle0504/detr-finetuned-balloon-v2":
|
160 |
+
yolo_pipe = pipeline(
|
161 |
+
"object-detection", model="eagle0504/detr-finetuned-balloon-v2"
|
162 |
+
)
|
163 |
+
else:
|
164 |
+
yolo_pipe = pipeline("object-detection", model="hustvl/yolos-small")
|
165 |
|
166 |
if use_yolo:
|
167 |
# Process image with YOLO
|