dron3flyv3r commited on
Commit
12bc61f
·
1 Parent(s): 8c92bed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -13,20 +13,21 @@ classes = checkpoint['classes']
13
  tran = checkpoint['transform']
14
 
15
  # upload image
16
- uploaded_file = st.file_uploader("Choose an image...", type="jpg")
17
- taking_picture = st.camera_input("Take a picture...")
18
-
19
- if uploaded_file is not None:
20
- img = Image.open(uploaded_file)
21
- st.image(img, caption='Uploaded Image.', use_column_width=True)
22
- label = classify(model, img, tran, classes, device)
23
- st.write(label)
24
 
25
- elif taking_picture is not None:
26
- img = Image.open(taking_picture)
27
- st.image(img, caption='Uploaded Image.', use_column_width=True)
28
- label = classify(model, img, tran, classes, device)
29
- st.write(label)
30
-
31
- else:
32
- pass
 
 
 
 
 
 
 
13
  tran = checkpoint['transform']
14
 
15
  # upload image
16
+ while True:
17
+ uploaded_file = st.file_uploader("Choose an image...", type="jpg")
18
+ taking_picture = st.camera_input("Take a picture...")
 
 
 
 
 
19
 
20
+ if uploaded_file is not None:
21
+ img = Image.open(uploaded_file)
22
+ st.image(img, caption='Uploaded Image.', use_column_width=True)
23
+ label = classify(model, img, tran, classes, device)
24
+ st.write(label)
25
+
26
+ elif taking_picture is not None:
27
+ img = Image.open(taking_picture)
28
+ st.image(img, caption='Uploaded Image.', use_column_width=True)
29
+ label = classify(model, img, tran, classes, device)
30
+ st.write(label)
31
+
32
+ else:
33
+ pass