kumar989 commited on
Commit
6e9a95f
·
1 Parent(s): 63c5ba4

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +9 -5
model.py CHANGED
@@ -58,16 +58,20 @@ def brain_net(img):
58
  result = model.predict(np.array([img]))
59
  ans = np.argmax(result)
60
  b = ""
61
- a = st.markdown('#### Precautions to be taken:')
62
  if ans==3:
63
- b = f"Glioma: Can range from low-grade (mild) to high-grade (severe).{a}\n\nAvoid activities that could cause head injury, such as contact sports.\nTake steps to manage seizures, which can be a common symptom of gliomas.\nAvoid exposure to radiation, as this can increase the risk of developing a glioma.\nTake steps to reduce stress, which can exacerbate symptoms and affect overall health.\nWork with a healthcare provider to manage any other underlying medical conditions that could impact treatment."
 
64
  if ans==2:
65
- b=f"Meningioma: Most are low-grade.{a}\n\nAvoid activities that could cause head injury, such as contact sports.\nWork with a healthcare provider to manage any underlying medical conditions, such as high blood pressure, that could impact treatment.\nBe aware of potential symptoms, such as headaches or changes in vision, and seek medical attention promptly if they occur.\nTake steps to reduce stress, which can exacerbate symptoms and affect overall health.\nFollow a healthy lifestyle, including a balanced diet, regular exercise, and adequate sleep."
 
66
  if ans==1:
67
  b = "No tumor: N/A \n\n Enjoy the Life "
 
68
  if ans==0:
69
- b = f"Pituitary: Can be either benign or malignant.{a}\n\n Work with a healthcare provider to manage any underlying medical conditions, such as diabetes, that could impact treatment.\nBe aware of potential symptoms, such as headaches or changes in vision, and seek medical attention promptly if they occur.\nFollow a healthy lifestyle, including a balanced diet, regular exercise, and adequate sleep.\nTake steps to manage any hormonal imbalances that may result from the tumor.\nAvoid exposure to radiation, as this can increase the risk of developing pituitary tumors"
70
- return b
 
71
 
72
  def chest_net(img):
73
  lt = ['PNEUMONIA', 'NORMAL']
 
58
  result = model.predict(np.array([img]))
59
  ans = np.argmax(result)
60
  b = ""
61
+ c = ""
62
  if ans==3:
63
+ b = f"Glioma: Can range from low-grade (mild) to high-grade (severe)."
64
+ c = "\n\nAvoid activities that could cause head injury, such as contact sports.\nTake steps to manage seizures, which can be a common symptom of gliomas.\nAvoid exposure to radiation, as this can increase the risk of developing a glioma.\nTake steps to reduce stress, which can exacerbate symptoms and affect overall health.\nWork with a healthcare provider to manage any other underlying medical conditions that could impact treatment."
65
  if ans==2:
66
+ b=f"Meningioma: Most are low-grade."
67
+ c = "\n\nAvoid activities that could cause head injury, such as contact sports.\nWork with a healthcare provider to manage any underlying medical conditions, such as high blood pressure, that could impact treatment.\nBe aware of potential symptoms, such as headaches or changes in vision, and seek medical attention promptly if they occur.\nTake steps to reduce stress, which can exacerbate symptoms and affect overall health.\nFollow a healthy lifestyle, including a balanced diet, regular exercise, and adequate sleep."
68
  if ans==1:
69
  b = "No tumor: N/A \n\n Enjoy the Life "
70
+ c = ""
71
  if ans==0:
72
+ b = f"Pituitary: Can be either benign or malignant."
73
+ c = "\n\n Work with a healthcare provider to manage any underlying medical conditions, such as diabetes, that could impact treatment.\nBe aware of potential symptoms, such as headaches or changes in vision, and seek medical attention promptly if they occur.\nFollow a healthy lifestyle, including a balanced diet, regular exercise, and adequate sleep.\nTake steps to manage any hormonal imbalances that may result from the tumor.\nAvoid exposure to radiation, as this can increase the risk of developing pituitary tumors"
74
+ return b,c
75
 
76
  def chest_net(img):
77
  lt = ['PNEUMONIA', 'NORMAL']