Spaces:
Runtime error
Runtime error
cybernatedArt
commited on
Commit
•
a3598bd
1
Parent(s):
9dc5723
Update app.py
Browse files
app.py
CHANGED
@@ -10,11 +10,18 @@ model = tf.keras.models.load_model('model_2.h5')
|
|
10 |
|
11 |
#function
|
12 |
def example(image):
|
13 |
-
|
14 |
-
|
15 |
#return {class_names[i]: float(prediction[i]) for i in range(4)}
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
# initializing the input component
|
@@ -37,7 +44,8 @@ examples = [
|
|
37 |
]
|
38 |
|
39 |
# launching the interface
|
40 |
-
gr.Interface(
|
41 |
title=title,
|
42 |
description= description,
|
43 |
-
examples = examples
|
|
|
|
10 |
|
11 |
#function
|
12 |
def example(image):
|
13 |
+
image = image.reshape(-1, 256, 256, 3)
|
14 |
+
prediction = model.predict(image).flatten()
|
15 |
#return {class_names[i]: float(prediction[i]) for i in range(4)}
|
16 |
+
class_names = ['Acne and Rosacea Photos', 'Actinic Keratosis Basal Cell Carcinoma and other Malignant Lesions', 'Atopic Dermatitis Photos',
|
17 |
+
'Bullous Disease Photos', 'Cellulitis Impetigo and other Bacterial Infections', 'Eczema Photos', 'Exanthems and Drug Eruptions',
|
18 |
+
'Hair Loss Photos Alopecia and other Hair Diseases', 'Herpes HPV and other STDs Photos', 'Light Diseases and Disorders of Pigmentation',
|
19 |
+
'Lupus and other Connective Tissue diseases', 'Melanoma Skin Cancer Nevi and Moles', 'Nail Fungus and other Nail Disease',
|
20 |
+
'Poison Ivy Photos and other Contact Dermatitis', 'Psoriasis pictures Lichen Planus and related diseases',
|
21 |
+
'Scabies Lyme Disease and other Infestations and Bites', 'Seborrheic Keratoses and other Benign Tumors', 'Systemic Disease',
|
22 |
+
'Tinea Ringworm Candidiasis and other Fungal Infections', 'Urticaria Hives', 'Vascular Tumors', 'Vasculitis Photos',
|
23 |
+
'Warts Molluscum and other Viral Infections']
|
24 |
+
return {class_names[i]: float(prediction[i]) for i in range(23)}
|
25 |
|
26 |
|
27 |
# initializing the input component
|
|
|
44 |
]
|
45 |
|
46 |
# launching the interface
|
47 |
+
gr.Interface( example,inputs = image,outputs = label,capture_session = True,
|
48 |
title=title,
|
49 |
description= description,
|
50 |
+
examples = examples
|
51 |
+
).launch(share=True)
|