kumar989 commited on
Commit
832b4a4
·
1 Parent(s): 417adf8

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +22 -1
model.py CHANGED
@@ -16,17 +16,29 @@ def classify(img):
16
  return "Provide the medical Imaging of the mentioned categories"
17
  st.write('________________________________________________')
18
  if a==1:
 
19
  c = bone_net(im)
 
20
  if a==2:
 
21
  c = brain_net(im)
 
22
  if a==3:
 
23
  c = Eye_net(im)
 
24
  if a==4:
 
25
  c = kidney_net(im)
 
26
  if a==5:
 
27
  c = chest_net(im)
 
28
  if a==6:
 
29
  c = skin_net(im)
 
30
  return c
31
 
32
 
@@ -45,7 +57,16 @@ def brain_net(img):
45
  model = tf.keras.models.load_model("brain.h5",compile=False)
46
  result = model.predict(np.array([img]))
47
  ans = np.argmax(result)
48
- return lt[ans]
 
 
 
 
 
 
 
 
 
49
 
50
  def chest_net(img):
51
  lt = ['PNEUMONIA', 'NORMAL']
 
16
  return "Provide the medical Imaging of the mentioned categories"
17
  st.write('________________________________________________')
18
  if a==1:
19
+ st.write('________________________________________________')
20
  c = bone_net(im)
21
+ st.write('________________________________________________')
22
  if a==2:
23
+ st.write('________________________________________________')
24
  c = brain_net(im)
25
+ st.write('________________________________________________')
26
  if a==3:
27
+ st.write('________________________________________________')
28
  c = Eye_net(im)
29
+ st.write('________________________________________________')
30
  if a==4:
31
+ st.write('________________________________________________')
32
  c = kidney_net(im)
33
+ st.write('________________________________________________')
34
  if a==5:
35
+ st.write('________________________________________________')
36
  c = chest_net(im)
37
+ st.write('________________________________________________')
38
  if a==6:
39
+ st.write('________________________________________________')
40
  c = skin_net(im)
41
+ st.write('________________________________________________')
42
  return c
43
 
44
 
 
57
  model = tf.keras.models.load_model("brain.h5",compile=False)
58
  result = model.predict(np.array([img]))
59
  ans = np.argmax(result)
60
+ b = ""
61
+ if ans==3:
62
+ b = "Glioma: Can range from low-grade (mild) to high-grade (severe).\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."
63
+ if ans==2:
64
+ b="Meningioma: Most are low-grade.\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."
65
+ if ans==1:
66
+ b = "No tumor: N/A \n\n Enjoy the Life "
67
+ if ans==0:
68
+ b = "Pituitary: Can be either benign or malignant.\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"
69
+ return b
70
 
71
  def chest_net(img):
72
  lt = ['PNEUMONIA', 'NORMAL']