NVASAIKUMAR commited on
Commit
b9eabd1
·
1 Parent(s): 1d59b4b

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +4 -6
model.py CHANGED
@@ -31,14 +31,12 @@ def classify(img):
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:
38
- op="Fracture"
39
- else:
40
- op="Normal"
41
- return op
42
 
43
  def brain_net(img):
44
  lt = ['pituitary', 'notumor', 'meningioma', 'glioma']
 
31
 
32
  def bone_net(img):
33
  # img = cv2.resize(img,(224,224))
34
+ lt = ['not fractured', 'fractured']
35
  model = tf.keras.models.load_model("fracture.h5",compile=False)
36
  result = model.predict(np.array([img]))
37
+ result = model.predict(np.array([img]))
38
+ ans = np.argmax(result)
39
+ return lt[ans]
 
 
 
40
 
41
  def brain_net(img):
42
  lt = ['pituitary', 'notumor', 'meningioma', 'glioma']