Spaces:
Sleeping
Sleeping
Commit
·
b756fab
1
Parent(s):
b2d1e49
Update model.py
Browse files
model.py
CHANGED
@@ -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("
|
35 |
result = model.predict(np.array([img]))
|
36 |
op=""
|
37 |
if result[0]<0.5:
|
@@ -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("
|
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("
|
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("
|
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("
|
79 |
result = model.predict(np.array([img]))
|
80 |
ans = np.argmax(result)
|
81 |
return lt[ans]
|
|
|
31 |
|
32 |
def bone_net(img):
|
33 |
img = cv2.resize(img,(224,224))
|
34 |
+
model = tf.keras.models.load_model("Fracture.h5",compile=False)
|
35 |
result = model.predict(np.array([img]))
|
36 |
op=""
|
37 |
if result[0]<0.5:
|
|
|
51 |
def chest_net(img):
|
52 |
lt = ['PNEUMONIA', 'NORMAL']
|
53 |
img = cv2.resize(img,(224,224))
|
54 |
+
model = tf.keras.models.load_model("chest.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.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.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.h5",compile=False)
|
79 |
result = model.predict(np.array([img]))
|
80 |
ans = np.argmax(result)
|
81 |
return lt[ans]
|