Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import numpy as np
|
4 |
-
|
5 |
-
#from tqdm import tqdm
|
6 |
-
#import tensorflow as tf
|
7 |
-
#from tensorflow import keras
|
8 |
-
#from keras.utils import np_utils
|
9 |
-
#from keras.preprocessing import image
|
10 |
-
#from keras.preprocessing.image import ImageDataGenerator
|
11 |
-
#import matplotlib.pyplot as plt
|
12 |
from keras.models import model_from_json
|
13 |
from keras.preprocessing import image
|
14 |
from keras.applications.vgg16 import VGG16, preprocess_input
|
@@ -19,8 +12,7 @@ file.close()
|
|
19 |
loaded_model = model_from_json(model_json2)
|
20 |
loaded_model.load_weights("womanlife.h5")
|
21 |
|
22 |
-
|
23 |
-
objects = ('There is a benign nodule', 'Normal Breast', 'There is a malignant nodule')
|
24 |
y_pos = np.arange(len(objects))
|
25 |
|
26 |
|
@@ -32,13 +24,6 @@ def predict_image(pic):
|
|
32 |
x = np.expand_dims(x, axis=0)
|
33 |
x = preprocess_input(x)
|
34 |
|
35 |
-
#img = image.load_img(pic, grayscale=True, target_size=(48, 48))
|
36 |
-
#x = image.img_to_array(img)
|
37 |
-
|
38 |
-
#x = np.expand_dims(x, axis = 0)
|
39 |
-
|
40 |
-
#x /= 255
|
41 |
-
|
42 |
custom = loaded_model.predict(x)
|
43 |
|
44 |
m=0.000000000000000000001
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import numpy as np
|
4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from keras.models import model_from_json
|
6 |
from keras.preprocessing import image
|
7 |
from keras.applications.vgg16 import VGG16, preprocess_input
|
|
|
12 |
loaded_model = model_from_json(model_json2)
|
13 |
loaded_model.load_weights("womanlife.h5")
|
14 |
|
15 |
+
objects = ('There is a benign nodule', 'There is a malignant nodule', 'Normal Breast')
|
|
|
16 |
y_pos = np.arange(len(objects))
|
17 |
|
18 |
|
|
|
24 |
x = np.expand_dims(x, axis=0)
|
25 |
x = preprocess_input(x)
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
custom = loaded_model.predict(x)
|
28 |
|
29 |
m=0.000000000000000000001
|