Spaces:
Sleeping
Sleeping
Daniel Cerda Escobar
commited on
Commit
·
9bfa97c
1
Parent(s):
7bf8711
Fix get model cache
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ st.subheader(' Identify valves and pumps with deep learning model ', divider='ra
|
|
24 |
st.caption('Developed by Deep Drawings Co.')
|
25 |
|
26 |
@st.cache_resource(show_spinner=False)
|
27 |
-
def get_model():
|
28 |
yolov8_model_path = download_from_hub('DanielCerda/pid_yolov8')
|
29 |
detection_model = AutoDetectionModel.from_pretrained(
|
30 |
model_type='yolov8',
|
@@ -131,7 +131,7 @@ with col2:
|
|
131 |
if submit:
|
132 |
# perform prediction
|
133 |
with st.spinner(text="Downloading model weights ... "):
|
134 |
-
detection_model = get_model()
|
135 |
|
136 |
image_size = 4960
|
137 |
|
@@ -151,7 +151,7 @@ if submit:
|
|
151 |
|
152 |
st.write('##')
|
153 |
|
154 |
-
col1, col2, col3 = st.columns([3, 1, 1], gap='
|
155 |
with col1:
|
156 |
st.markdown(f"#### Object Detection Result")
|
157 |
with st.container(border = True):
|
|
|
24 |
st.caption('Developed by Deep Drawings Co.')
|
25 |
|
26 |
@st.cache_resource(show_spinner=False)
|
27 |
+
def get_model(postprocess_match_threshold):
|
28 |
yolov8_model_path = download_from_hub('DanielCerda/pid_yolov8')
|
29 |
detection_model = AutoDetectionModel.from_pretrained(
|
30 |
model_type='yolov8',
|
|
|
131 |
if submit:
|
132 |
# perform prediction
|
133 |
with st.spinner(text="Downloading model weights ... "):
|
134 |
+
detection_model = get_model(postprocess_match_threshold)
|
135 |
|
136 |
image_size = 4960
|
137 |
|
|
|
151 |
|
152 |
st.write('##')
|
153 |
|
154 |
+
col1, col2, col3 = st.columns([3, 1, 1], gap='small')
|
155 |
with col1:
|
156 |
st.markdown(f"#### Object Detection Result")
|
157 |
with st.container(border = True):
|