Spaces:
Sleeping
Sleeping
Jeysshon
commited on
Commit
•
19a5591
1
Parent(s):
bcc02aa
Upload 14 files
Browse files- 123.jpg +0 -0
- README.md +7 -5
- acne-closed-comedo-2.jpg +0 -0
- app.py +62 -0
- cherry-angioma-16.jpg +0 -0
- congenital-nevus-35.jpg +0 -0
- distal-subungual-onychomycosis-86.jpg +0 -0
- gitattributes.txt +28 -0
- malignant-melanoma-16.jpg +0 -0
- model_2.h5 +3 -0
- requirements.txt +2 -0
- skin_model_23_75.18.h5 +3 -0
- tinea-body-137.jpg +0 -0
- tinea-primary-lesion-15.jpg +0 -0
123.jpg
ADDED
README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
|
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: Skin Disease Detection
|
3 |
+
emoji: 💻
|
4 |
+
colorFrom: purple
|
5 |
+
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.0.19
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
python_version: 3.7.10
|
11 |
+
duplicated_from: cybernatedArt/Skin_disease_detection
|
12 |
---
|
13 |
|
14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
acne-closed-comedo-2.jpg
ADDED
app.py
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import tensorflow as tf
|
3 |
+
|
4 |
+
path_to_model = "./skin_model_23_75.18.h5"
|
5 |
+
|
6 |
+
model = tf.keras.models.load_model(path_to_model)
|
7 |
+
|
8 |
+
labels = ['Acne / Rosacea',
|
9 |
+
'Actinic Keratosis / Basal Cell Carcinoma',
|
10 |
+
'Atopic Dermatitis', 'Bullous Disease',
|
11 |
+
'Cellulitis Impetigo (Bacterial Infections)',
|
12 |
+
'Eczema', 'Exanthems (Drug Eruptions)', 'Hair Loss (Alopecia)',
|
13 |
+
'Herpes HPV', 'Disorders of Pigmentation',
|
14 |
+
'Lupus ',
|
15 |
+
'Melanoma (Skin Cancer)', 'Nail Fungus',
|
16 |
+
'Poison Ivy',
|
17 |
+
'Psoriasis (Lichen Planus)', 'Scabies Lyme',
|
18 |
+
'Seborrheic Keratoses', 'Systemic Disease',
|
19 |
+
'Tinea Ringworm (Fungal Infections)',
|
20 |
+
'Urticaria Hives', 'Vascular Tumors', 'Vasculitis', 'Warts Molluscum']
|
21 |
+
|
22 |
+
def classify_image(photos):
|
23 |
+
photos = photos.reshape((-1, 224, 224, 3))
|
24 |
+
prediction = model.predict(photos).flatten()
|
25 |
+
confidences = {labels[i]: float(prediction[i]) for i in range(23)}
|
26 |
+
return confidences
|
27 |
+
|
28 |
+
|
29 |
+
title="SKIN DISEASE DETECTION"
|
30 |
+
|
31 |
+
description = "An automated system is proposed for the diagnosis of #23 common skin diseases by using data from clinical images and patient information using deep learning pre-trained EfficientNetB7 model with 75% accuracy. we will implement a simple image classification model using Gradio and Tensorflow. The image classification model will classify images of various skin disease problems into labeled classes."
|
32 |
+
|
33 |
+
|
34 |
+
article = "We used the generated Gradio UI to input an image for the trained convolutional neural network to make image classifications. The convolutional neural network was able to accurately classify the input image. Sometimes you would like to resize the image from the gradio UI for better performance"
|
35 |
+
|
36 |
+
|
37 |
+
examples = [
|
38 |
+
['./123.jpg'],
|
39 |
+
['./acne-closed-comedo-2.jpg'],
|
40 |
+
['./distal-subungual-onychomycosis-86.jpg'],
|
41 |
+
['./cherry-angioma-16.jpg'],
|
42 |
+
['./malignant-melanoma-16.jpg'],
|
43 |
+
['./tinea-primary-lesion-15.jpg'],
|
44 |
+
['./congenital-nevus-35.jpg'],
|
45 |
+
['./tinea-body-137.jpg']
|
46 |
+
]
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
gr.Interface(fn=classify_image,
|
53 |
+
title = title,
|
54 |
+
article = article,
|
55 |
+
description = description,
|
56 |
+
inputs=gr.inputs.Image(shape=(224, 224)),
|
57 |
+
outputs=gr.outputs.Label(num_top_classes=4),
|
58 |
+
examples=examples).launch()
|
59 |
+
|
60 |
+
|
61 |
+
|
62 |
+
|
cherry-angioma-16.jpg
ADDED
congenital-nevus-35.jpg
ADDED
distal-subungual-onychomycosis-86.jpg
ADDED
gitattributes.txt
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
19 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
Pickle_SD_Model.pkl filter=lfs diff=lfs merge=lfs -text
|
malignant-melanoma-16.jpg
ADDED
model_2.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd012a7b3aa68fc20c7db93c1e1ec3c88422dff6299d5f97983ea7d2e4a2f397
|
3 |
+
size 263944548
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
tensorflow
|
2 |
+
|
skin_model_23_75.18.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:763da0a6f62d33655511cd7b286c31d7eeb623f4ee6ff6825a12a50ef339dd89
|
3 |
+
size 778621424
|
tinea-body-137.jpg
ADDED
tinea-primary-lesion-15.jpg
ADDED