AFCMEgypt commited on
Commit
9ed13bc
1 Parent(s): 45a9741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -107,13 +107,16 @@ def quant(imageinput):
107
  thresho = 20
108
  sig=final[0][0]
109
  #signal=plt.plot(sig,figure=plt.figure())
110
-
111
-
112
  if ratio >= thresho:
113
- xx=str("The test band signal [" + str(ratio) + "mg/dl] shows a " + target +"-POSITIVE test.")
 
 
 
 
 
 
114
  else:
115
- xx=str("The test band signal[" + str(ratio) + "mg/dl] shows a " + target +"-NEGATIVE test.")
116
-
117
  return xx,figplota(sig),cv2.resize(image, (20,60), interpolation = cv2.INTER_AREA) #cv2.resize(signal, (20,40), interpolation = cv2.INTER_AREA)#,cv2.resize(signal, (20,40), interpolation = cv2.INTER_AREA)
118
- iface = gr.Interface(quant, gr.Image(type="filepath"), outputs=["text","plot","image"],debug=True)
119
  iface.launch()
 
107
  thresho = 20
108
  sig=final[0][0]
109
  #signal=plt.plot(sig,figure=plt.figure())
 
 
110
  if ratio >= thresho:
111
+ xx=str("The test band signal [" + str(ratio) + "mg/dl] shows a " + target +"-POSITIVE test." +" " + "Classic PKU, needs urgent medical treatment")
112
+ elif ratio >= 2 and ratio <6:
113
+ xx=str("The test band signal [" + str(ratio) + "mg/dl] shows a " + target +"-POSITIVE test." +" " + "Likely PKU phenotype.")
114
+ elif ratio >= 6 and ratio <12:
115
+ xx=str("The test band signal [" + str(ratio) + "mg/dl] shows a " + target +"-POSITIVE test." +" " + "PKU and dietary restriction is recommended")
116
+ elif ratio >=12 and ratio <20:
117
+ xx=str("The test band signal [" + str(ratio) + "mg/dl] shows a " + target +"-POSITIVE test." +" " + "PKU and need medical attention for risk of intellectuall impairment")
118
  else:
119
+ xx=str("The test band signal[" + str(ratio) + "mg/dl] shows a " + target +"-NEGATIVE test.")
 
120
  return xx,figplota(sig),cv2.resize(image, (20,60), interpolation = cv2.INTER_AREA) #cv2.resize(signal, (20,40), interpolation = cv2.INTER_AREA)#,cv2.resize(signal, (20,40), interpolation = cv2.INTER_AREA)
121
+ iface = gr.Interface(quant, gr.Image(type="filepath"), outputs=["text","plot","image"],debug=True)
122
  iface.launch()