Daniel Cerda Escobar commited on
Commit
6c45483
·
1 Parent(s): bd7c529

Update app file

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -23,11 +23,24 @@ st.title('P&ID Object Detection')
23
  st.subheader(' Identify valves and pumps with deep learning model ', divider='rainbow')
24
  st.caption('Developed by Deep Drawings Co.')
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  if "output_1" not in st.session_state:
27
- st.session_state["output_1"] = sahi.utils.cv.read_image_as_pil(IMAGE_TO_URL['plant_pid.png'])
28
 
29
  if "output_2" not in st.session_state:
30
- st.session_state["output_2"] = sahi.utils.cv.read_image_as_pil(IMAGE_TO_URL['prediction_visual.png'])
31
 
32
  col1, col2, col3 = st.columns(3, gap='medium')
33
  with col1:
 
23
  st.subheader(' Identify valves and pumps with deep learning model ', divider='rainbow')
24
  st.caption('Developed by Deep Drawings Co.')
25
 
26
+ @st.cache_data(show_spinner=False)
27
+ def download_comparison_images():
28
+ sahi.utils.file.download_from_url(
29
+ 'https://d1afc1j4569hs1.cloudfront.net/plant-pid.png',
30
+ 'plant_pid.png',
31
+ )
32
+ sahi.utils.file.download_from_url(
33
+ 'https://d1afc1j4569hs1.cloudfront.net/prediction_visual.png',
34
+ 'prediction_visual.png',
35
+ )
36
+
37
+ download_comparison_images()
38
+
39
  if "output_1" not in st.session_state:
40
+ st.session_state["output_1"] = Image.open('plant_pid.png')
41
 
42
  if "output_2" not in st.session_state:
43
+ st.session_state["output_2"] = Image.open('prediction_visual.png')
44
 
45
  col1, col2, col3 = st.columns(3, gap='medium')
46
  with col1: