NVASAIKUMAR commited on
Commit
c1169cd
·
1 Parent(s): 04e7d25

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +7 -7
model.py CHANGED
@@ -7,7 +7,7 @@ def classify(img):
7
  im = img
8
  lt = ["other","Bone","Brain","eye","kidney","chest","skin"]
9
  im = cv2.resize(im,(52,52))
10
- model = tf.keras.models.load_model("all-in-one.h5")
11
  result = model.predict(np.array([im]))
12
  a = np.argmax(result)
13
  c=""
@@ -31,7 +31,7 @@ def classify(img):
31
 
32
  def bone_net(img):
33
  img = cv2.resize(img,(224,224))
34
- model = tf.keras.models.load_model("Fracture_detection.h5")
35
  result = model.predict(np.array([img]))
36
  op=""
37
  if result[0]<0.5:
@@ -43,7 +43,7 @@ def bone_net(img):
43
  def brain_net(img):
44
  lt = ['pituitary', 'notumor', 'meningioma', 'glioma']
45
  img = cv2.resize(img,(224,224))
46
- model = tf.keras.models.load_model("model_brain_tumur.h5")
47
  result = model.predict(np.array([img]))
48
  ans = np.argmax(result)
49
  return lt[ans]
@@ -51,7 +51,7 @@ def brain_net(img):
51
  def chest_net(img):
52
  lt = ['PNEUMONIA', 'NORMAL']
53
  img = cv2.resize(img,(224,224))
54
- model = tf.keras.models.load_model("chest_cls_model.h5")
55
  result = model.predict(np.array([img]))
56
  ans = np.argmax(result)
57
  return lt[ans]
@@ -59,7 +59,7 @@ def chest_net(img):
59
  def Eye_net(img):
60
  lt = ['glaucoma', 'normal', 'diabetic_retinopathy', 'cataract']
61
  img = cv2.resize(img,(224,224))
62
- model = tf.keras.models.load_model("Eye_diseases.h5")
63
  result = model.predict(np.array([img]))
64
  ans = np.argmax(result)
65
  return lt[ans]
@@ -67,7 +67,7 @@ def Eye_net(img):
67
  def kidney_net(img):
68
  lt = ['Cyst', 'Tumor', 'Stone', 'Normal']
69
  img = cv2.resize(img,(224,224))
70
- model = tf.keras.models.load_model("kidney_stone.h5")
71
  result = model.predict(np.array([img]))
72
  ans = np.argmax(result)
73
  return lt[ans]
@@ -75,7 +75,7 @@ def kidney_net(img):
75
  def skin_net(img):
76
  lt = ['pigmented benign keratosis', 'melanoma', 'vascular lesion', 'actinic keratosis', 'squamous cell carcinoma', 'basal cell carcinoma', 'seborrheic keratosis', 'dermatofibroma', 'nevus']
77
  img = cv2.resize(img,(224,224))
78
- model = tf.keras.models.load_model("skin_cancer.h5")
79
  result = model.predict(np.array([img]))
80
  ans = np.argmax(result)
81
  return lt[ans]
 
7
  im = img
8
  lt = ["other","Bone","Brain","eye","kidney","chest","skin"]
9
  im = cv2.resize(im,(52,52))
10
+ model = tf.keras.models.load_model("all-in-one.h5",compile=False)
11
  result = model.predict(np.array([im]))
12
  a = np.argmax(result)
13
  c=""
 
31
 
32
  def bone_net(img):
33
  img = cv2.resize(img,(224,224))
34
+ model = tf.keras.models.load_model("Fracture_detection.h5",compile=False)
35
  result = model.predict(np.array([img]))
36
  op=""
37
  if result[0]<0.5:
 
43
  def brain_net(img):
44
  lt = ['pituitary', 'notumor', 'meningioma', 'glioma']
45
  img = cv2.resize(img,(224,224))
46
+ model = tf.keras.models.load_model("model_brain_tumur.h5",compile=False)
47
  result = model.predict(np.array([img]))
48
  ans = np.argmax(result)
49
  return lt[ans]
 
51
  def chest_net(img):
52
  lt = ['PNEUMONIA', 'NORMAL']
53
  img = cv2.resize(img,(224,224))
54
+ model = tf.keras.models.load_model("chest_cls_model.h5",compile=False)
55
  result = model.predict(np.array([img]))
56
  ans = np.argmax(result)
57
  return lt[ans]
 
59
  def Eye_net(img):
60
  lt = ['glaucoma', 'normal', 'diabetic_retinopathy', 'cataract']
61
  img = cv2.resize(img,(224,224))
62
+ model = tf.keras.models.load_model("Eye_diseases.h5",compile=False)
63
  result = model.predict(np.array([img]))
64
  ans = np.argmax(result)
65
  return lt[ans]
 
67
  def kidney_net(img):
68
  lt = ['Cyst', 'Tumor', 'Stone', 'Normal']
69
  img = cv2.resize(img,(224,224))
70
+ model = tf.keras.models.load_model("kidney_stone.h5",compile=False)
71
  result = model.predict(np.array([img]))
72
  ans = np.argmax(result)
73
  return lt[ans]
 
75
  def skin_net(img):
76
  lt = ['pigmented benign keratosis', 'melanoma', 'vascular lesion', 'actinic keratosis', 'squamous cell carcinoma', 'basal cell carcinoma', 'seborrheic keratosis', 'dermatofibroma', 'nevus']
77
  img = cv2.resize(img,(224,224))
78
+ model = tf.keras.models.load_model("skin_cancer.h5",compile=False)
79
  result = model.predict(np.array([img]))
80
  ans = np.argmax(result)
81
  return lt[ans]