sergioska commited on
Commit
77e9de4
·
1 Parent(s): 4954064

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -22,6 +22,7 @@ clearEphimeral()
22
 
23
  if 'wip' not in st.session_state:
24
  st.session_state['wip'] = False
 
25
 
26
  detector = pipeline("object-detection", model="sergioska/yolo-finetuned-flyers")
27
 
@@ -35,8 +36,12 @@ with col1:
35
 
36
  st.header('flyer')
37
  uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
38
-
39
- imageLocation = st.empty()
 
 
 
 
40
 
41
  if uploaded_image_zero_file is not None:
42
  image = Image.open(uploaded_image_zero_file)
@@ -72,6 +77,7 @@ with col1:
72
  totalGibs = i
73
  gibsOk = True
74
  imageLocation.image(image)
 
75
  st.write(predictions)
76
 
77
  with col2:
 
22
 
23
  if 'wip' not in st.session_state:
24
  st.session_state['wip'] = False
25
+ st.session_state['image'] = None
26
 
27
  detector = pipeline("object-detection", model="sergioska/yolo-finetuned-flyers")
28
 
 
36
 
37
  st.header('flyer')
38
  uploaded_image_zero_file = st.file_uploader("Choose an image file (zero)")
39
+
40
+ if not st.session_state['wip']:
41
+ imageLocation = st.empty()
42
+ else:
43
+ image = st.session_state['image']
44
+ imageLocation.image(image)
45
 
46
  if uploaded_image_zero_file is not None:
47
  image = Image.open(uploaded_image_zero_file)
 
77
  totalGibs = i
78
  gibsOk = True
79
  imageLocation.image(image)
80
+ st.session_state['image'] = image
81
  st.write(predictions)
82
 
83
  with col2: