Spaces:
Runtime error
Runtime error
Ibrahim Animashaun
commited on
Commit
•
4b37e48
1
Parent(s):
434690d
Add new examples
Browse files- .DS_Store +0 -0
- app.py +4 -4
- data/.DS_Store +0 -0
- data/benign/benign_4.jpg +0 -0
- data/benign/benign_5.jpg +0 -0
- data/benign/benign_6.jpg +0 -0
- data/malignant/malignant_4.jpg +0 -0
- data/malignant/malignant_5.jpg +0 -0
- data/malignant/malignant_6.jpg +0 -0
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -6,7 +6,7 @@ current_dir = pathlib.Path(__file__).parent
|
|
6 |
|
7 |
# images = [str(current_dir / "cheetah1.jpeg"), str(current_dir / "cheetah1.jpg"), str(current_dir / "lion.jpg")]
|
8 |
|
9 |
-
images = [str(current_dir / "data/benign/
|
10 |
|
11 |
|
12 |
# img_classifier = gr.Interface.load(
|
@@ -62,11 +62,11 @@ from skimage.transform import resize
|
|
62 |
# oc_resnet50_model1 = keras.models.load_model('./models/oc_model.h5')
|
63 |
print("current_dir", current_dir)
|
64 |
oc_resnet50_model2 = keras.models.load_model(f"{current_dir}/models/mendeley_oc_model_v2.h5")
|
65 |
-
labels = ['
|
66 |
|
67 |
def classify_image(inp):
|
68 |
|
69 |
-
inp =resize(inp, (300, 300, 3))
|
70 |
inp = inp.reshape((-1, 300, 300, 3))
|
71 |
# inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
72 |
inp = tf.keras.applications.resnet50.preprocess_input(inp)
|
@@ -78,5 +78,5 @@ gr.Interface(fn=classify_image,
|
|
78 |
inputs=gr.Image(shape=(300, 300)),
|
79 |
outputs=gr.Label(num_top_classes=2),
|
80 |
examples=images, cache_examples=False,
|
81 |
-
|
82 |
).launch()
|
|
|
6 |
|
7 |
# images = [str(current_dir / "cheetah1.jpeg"), str(current_dir / "cheetah1.jpg"), str(current_dir / "lion.jpg")]
|
8 |
|
9 |
+
images = [str(current_dir / "data/benign/benign_4.jpg"), str(current_dir / "data/benign/benign_5.jpg"), str(current_dir / "data/benign/benign_6.jpg"), str(current_dir / "data/malignant/malignant_4.jpg"), str(current_dir / "data/malignant/malignant_5.jpg"), str(current_dir / "data/malignant/malignant_6.jpg")]
|
10 |
|
11 |
|
12 |
# img_classifier = gr.Interface.load(
|
|
|
62 |
# oc_resnet50_model1 = keras.models.load_model('./models/oc_model.h5')
|
63 |
print("current_dir", current_dir)
|
64 |
oc_resnet50_model2 = keras.models.load_model(f"{current_dir}/models/mendeley_oc_model_v2.h5")
|
65 |
+
labels = ['Benign Lesion', 'Malignant Lesion']
|
66 |
|
67 |
def classify_image(inp):
|
68 |
|
69 |
+
# inp =resize(inp, (300, 300, 3))
|
70 |
inp = inp.reshape((-1, 300, 300, 3))
|
71 |
# inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
72 |
inp = tf.keras.applications.resnet50.preprocess_input(inp)
|
|
|
78 |
inputs=gr.Image(shape=(300, 300)),
|
79 |
outputs=gr.Label(num_top_classes=2),
|
80 |
examples=images, cache_examples=False,
|
81 |
+
# interpretation="shap", num_shap=5
|
82 |
).launch()
|
data/.DS_Store
CHANGED
Binary files a/data/.DS_Store and b/data/.DS_Store differ
|
|
data/benign/benign_4.jpg
ADDED
![]() |
data/benign/benign_5.jpg
ADDED
![]() |
data/benign/benign_6.jpg
ADDED
![]() |
data/malignant/malignant_4.jpg
ADDED
![]() |
data/malignant/malignant_5.jpg
ADDED
![]() |
data/malignant/malignant_6.jpg
ADDED
![]() |