kumar989 commited on
Commit
7714d4d
·
1 Parent(s): 38e8c1d

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +18 -0
model.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import tensorflow as tf
2
+ import cv2
3
+ import numpy as np
4
+
5
+ def bone_frac(img):
6
+ img = cv2.resize(img,(224,224))
7
+ model = tf.keras.models.load_model(r"C:\Users\kumar\Desktop\ice\best_model.h5")
8
+ result = model.predict(np.array([img]))
9
+ op=""
10
+ if result[0]<0.5:
11
+ op="Fracture"
12
+ else:
13
+ op="Normal"
14
+ return op
15
+
16
+ # img = cv2.imread(r"C:\Users\kumar\Downloads\WhatsApp Image 2023-04-17 at 7.20.40 PM.jpeg")
17
+ # print(bone_frac(img))
18
+ # # bone_frac(img)