crazyscientist1 commited on
Commit
4ffb8de
1 Parent(s): 1a2994d

Update appTest.py

Browse files
Files changed (1) hide show
  1. appTest.py +13 -13
appTest.py CHANGED
@@ -20,14 +20,14 @@ st.markdown("")
20
 
21
  showImg = Image.open('3dots.jpg')
22
  ogInp = Image.open('3dots.jpg')
23
- showImg = showImg.resize((200, 200))
24
- ogInp = ogInp.resize((200, 200))
25
  cellImgs = []
26
 
27
  st.title('MicroScan In Action!')
28
  st.subheader("Enter an image of a thin blood smear. Preview the image and run the application. This program was developed by Anish Pallod =)")
29
 
30
- input, outputIm, col1, col2, col3, col4, col5, col6, col7 = st.columns((9,9,1,1,1,1,1,1,1))
31
 
32
  def load_model():
33
  NUM_CLASSES = 2
@@ -81,14 +81,7 @@ CNN, model = load_model()
81
  with input:
82
  st.header("Input")
83
  imageInput = st.file_uploader("Enter an image of a thin blood smear.")
84
- if st.button("Run"):
85
- if imageInput is not None:
86
- image = Image.open(imageInput)
87
- ogInp = image
88
- img_array = np.array(image)
89
- output, cellImgs = main(CNN, model, img_array)
90
- showImg = Image.fromarray(output)
91
- if st.button("Preview"):
92
  if imageInput is not None:
93
  image = Image.open(imageInput)
94
  ogInp = image
@@ -99,6 +92,15 @@ with input:
99
  st.write("-" * 34)
100
  st.header("How it looks:")
101
  st.image(ogInp)
 
 
 
 
 
 
 
 
 
102
 
103
  with outputIm:
104
  st.header("General Output")
@@ -119,8 +121,6 @@ for k in range(leftOver):
119
 
120
  print(barrier)
121
 
122
-
123
- st.header("Segmented Cell Output")
124
  st.markdown("""
125
  <style>
126
  [data-testid=column] [data-testid=stVerticalBlock]{
 
20
 
21
  showImg = Image.open('3dots.jpg')
22
  ogInp = Image.open('3dots.jpg')
23
+ showImg = showImg.resize((100, 100))
24
+ ogInp = ogInp.resize((100, 100))
25
  cellImgs = []
26
 
27
  st.title('MicroScan In Action!')
28
  st.subheader("Enter an image of a thin blood smear. Preview the image and run the application. This program was developed by Anish Pallod =)")
29
 
30
+ input, outputIm, col, col1, col2, col3, col4, col5, col6, col7 = st.columns((5,5,1,1,1,1,1,1,1,1))
31
 
32
  def load_model():
33
  NUM_CLASSES = 2
 
81
  with input:
82
  st.header("Input")
83
  imageInput = st.file_uploader("Enter an image of a thin blood smear.")
84
+ if st.button("Preview"):
 
 
 
 
 
 
 
85
  if imageInput is not None:
86
  image = Image.open(imageInput)
87
  ogInp = image
 
92
  st.write("-" * 34)
93
  st.header("How it looks:")
94
  st.image(ogInp)
95
+
96
+ if st.button("Run"):
97
+ if imageInput is not None:
98
+ image = Image.open(imageInput)
99
+ ogInp = image
100
+ img_array = np.array(image)
101
+ output, cellImgs = main(CNN, model, img_array)
102
+ showImg = Image.fromarray(output)
103
+
104
 
105
  with outputIm:
106
  st.header("General Output")
 
121
 
122
  print(barrier)
123
 
 
 
124
  st.markdown("""
125
  <style>
126
  [data-testid=column] [data-testid=stVerticalBlock]{