Add all
Browse files- app.py +19 -4
- model/all_results.json +13 -0
- model/checkpoint-9730/config.json +93 -0
- model/checkpoint-9730/optimizer.pt +3 -0
- model/checkpoint-9730/preprocessor_config.json +22 -0
- model/checkpoint-9730/pytorch_model.bin +3 -0
- model/checkpoint-9730/rng_state.pth +3 -0
- model/checkpoint-9730/scheduler.pt +3 -0
- model/checkpoint-9730/trainer_state.json +0 -0
- model/checkpoint-9730/training_args.bin +3 -0
- model/config.json +93 -0
- model/eval_results.json +8 -0
- model/preprocessor_config.json +22 -0
- model/pytorch_model.bin +3 -0
- model/train_results.json +8 -0
- model/trainer_state.json +0 -0
- model/training_args.bin +3 -0
- requirements.txt +2 -0
app.py
CHANGED
@@ -1,7 +1,22 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline, AutoConfig, AutoModelForImageClassification, AutoImageProcessor
|
3 |
|
|
|
|
|
4 |
|
5 |
+
config = AutoConfig.from_pretrained("./model/checkpoint-9730/config.json")
|
6 |
+
model = AutoModelForImageClassification.from_pretrained(
|
7 |
+
"./model/checkpoint-9730/", config=config
|
8 |
+
)
|
9 |
+
image_processor = AutoImageProcessor.from_pretrained("./model/checkpoint-9730/")
|
10 |
+
|
11 |
+
|
12 |
+
pipe = pipeline("image-classification", model=model, feature_extractor=image_processor)
|
13 |
+
def predict(image):
|
14 |
+
predictions = pipeline(image)
|
15 |
+
return {p["label"]: p["score"] for p in predictions}
|
16 |
+
|
17 |
+
gr.Interface(
|
18 |
+
predict,
|
19 |
+
inputs=gr.inputs.Image(label="Upload Skin Disease Image", type="filepath"),
|
20 |
+
outputs=gr.outputs.Label(num_top_classes=3),
|
21 |
+
title="Detect your skin disease",
|
22 |
+
).launch()
|
model/all_results.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 10.0,
|
3 |
+
"eval_accuracy": 0.7673663168415792,
|
4 |
+
"eval_loss": 0.8717091679573059,
|
5 |
+
"eval_runtime": 78.6297,
|
6 |
+
"eval_samples_per_second": 50.897,
|
7 |
+
"eval_steps_per_second": 3.192,
|
8 |
+
"total_flos": 1.232466345637632e+19,
|
9 |
+
"train_loss": 0.6940609043573182,
|
10 |
+
"train_runtime": 7099.3654,
|
11 |
+
"train_samples_per_second": 21.913,
|
12 |
+
"train_steps_per_second": 1.371
|
13 |
+
}
|
model/checkpoint-9730/config.json
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "facebook/convnextv2-base-22k-224",
|
3 |
+
"architectures": [
|
4 |
+
"ConvNextV2ForImageClassification"
|
5 |
+
],
|
6 |
+
"depths": [
|
7 |
+
3,
|
8 |
+
3,
|
9 |
+
27,
|
10 |
+
3
|
11 |
+
],
|
12 |
+
"drop_path_rate": 0.0,
|
13 |
+
"hidden_act": "gelu",
|
14 |
+
"hidden_sizes": [
|
15 |
+
128,
|
16 |
+
256,
|
17 |
+
512,
|
18 |
+
1024
|
19 |
+
],
|
20 |
+
"id2label": {
|
21 |
+
"0": "Acne and Rosacea Photos",
|
22 |
+
"1": "Actinic Keratosis Basal Cell Carcinoma and other Malignant Lesions",
|
23 |
+
"2": "Atopic Dermatitis Photos",
|
24 |
+
"3": "Bullous Disease Photos",
|
25 |
+
"4": "Cellulitis Impetigo and other Bacterial Infections",
|
26 |
+
"5": "Eczema Photos",
|
27 |
+
"6": "Exanthems and Drug Eruptions",
|
28 |
+
"7": "Hair Loss Photos Alopecia and other Hair Diseases",
|
29 |
+
"8": "Herpes HPV and other STDs Photos",
|
30 |
+
"9": "Light Diseases and Disorders of Pigmentation",
|
31 |
+
"10": "Lupus and other Connective Tissue diseases",
|
32 |
+
"11": "Melanoma Skin Cancer Nevi and Moles",
|
33 |
+
"12": "Nail Fungus and other Nail Disease",
|
34 |
+
"13": "Poison Ivy Photos and other Contact Dermatitis",
|
35 |
+
"14": "Psoriasis pictures Lichen Planus and related diseases",
|
36 |
+
"15": "Scabies Lyme Disease and other Infestations and Bites",
|
37 |
+
"16": "Seborrheic Keratoses and other Benign Tumors",
|
38 |
+
"17": "Systemic Disease",
|
39 |
+
"18": "Tinea Ringworm Candidiasis and other Fungal Infections",
|
40 |
+
"19": "Urticaria Hives",
|
41 |
+
"20": "Vascular Tumors",
|
42 |
+
"21": "Vasculitis Photos",
|
43 |
+
"22": "Warts Molluscum and other Viral Infections"
|
44 |
+
},
|
45 |
+
"image_size": 224,
|
46 |
+
"initializer_range": 0.02,
|
47 |
+
"label2id": {
|
48 |
+
"Acne and Rosacea Photos": 0,
|
49 |
+
"Actinic Keratosis Basal Cell Carcinoma and other Malignant Lesions": 1,
|
50 |
+
"Atopic Dermatitis Photos": 2,
|
51 |
+
"Bullous Disease Photos": 3,
|
52 |
+
"Cellulitis Impetigo and other Bacterial Infections": 4,
|
53 |
+
"Eczema Photos": 5,
|
54 |
+
"Exanthems and Drug Eruptions": 6,
|
55 |
+
"Hair Loss Photos Alopecia and other Hair Diseases": 7,
|
56 |
+
"Herpes HPV and other STDs Photos": 8,
|
57 |
+
"Light Diseases and Disorders of Pigmentation": 9,
|
58 |
+
"Lupus and other Connective Tissue diseases": 10,
|
59 |
+
"Melanoma Skin Cancer Nevi and Moles": 11,
|
60 |
+
"Nail Fungus and other Nail Disease": 12,
|
61 |
+
"Poison Ivy Photos and other Contact Dermatitis": 13,
|
62 |
+
"Psoriasis pictures Lichen Planus and related diseases": 14,
|
63 |
+
"Scabies Lyme Disease and other Infestations and Bites": 15,
|
64 |
+
"Seborrheic Keratoses and other Benign Tumors": 16,
|
65 |
+
"Systemic Disease": 17,
|
66 |
+
"Tinea Ringworm Candidiasis and other Fungal Infections": 18,
|
67 |
+
"Urticaria Hives": 19,
|
68 |
+
"Vascular Tumors": 20,
|
69 |
+
"Vasculitis Photos": 21,
|
70 |
+
"Warts Molluscum and other Viral Infections": 22
|
71 |
+
},
|
72 |
+
"layer_norm_eps": 1e-12,
|
73 |
+
"model_type": "convnextv2",
|
74 |
+
"num_channels": 3,
|
75 |
+
"num_stages": 4,
|
76 |
+
"out_features": [
|
77 |
+
"stage4"
|
78 |
+
],
|
79 |
+
"out_indices": [
|
80 |
+
4
|
81 |
+
],
|
82 |
+
"patch_size": 4,
|
83 |
+
"problem_type": "single_label_classification",
|
84 |
+
"stage_names": [
|
85 |
+
"stem",
|
86 |
+
"stage1",
|
87 |
+
"stage2",
|
88 |
+
"stage3",
|
89 |
+
"stage4"
|
90 |
+
],
|
91 |
+
"torch_dtype": "float32",
|
92 |
+
"transformers_version": "4.33.0"
|
93 |
+
}
|
model/checkpoint-9730/optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e474a1ee1b411009667be8fb79189354a903e4d45ef5753e5086923c88df28de
|
3 |
+
size 702050833
|
model/checkpoint-9730/preprocessor_config.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_pct": 0.875,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_rescale": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"image_mean": [
|
7 |
+
0.485,
|
8 |
+
0.456,
|
9 |
+
0.406
|
10 |
+
],
|
11 |
+
"image_processor_type": "ConvNextImageProcessor",
|
12 |
+
"image_std": [
|
13 |
+
0.229,
|
14 |
+
0.224,
|
15 |
+
0.225
|
16 |
+
],
|
17 |
+
"resample": 3,
|
18 |
+
"rescale_factor": 0.00392156862745098,
|
19 |
+
"size": {
|
20 |
+
"shortest_edge": 224
|
21 |
+
}
|
22 |
+
}
|
model/checkpoint-9730/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:632b02968465fa5b7524d9a6767a331f7f9d981a2c11fe76cadea328902d0fd8
|
3 |
+
size 350997885
|
model/checkpoint-9730/rng_state.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3b151dded233d2167bdb9f41be5b38a3fd977b4b14c2ca6afe74c470604852a3
|
3 |
+
size 14575
|
model/checkpoint-9730/scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4cb982265f18fe8fdc47cdc13497ebb80614b1e71f9dcd6ae9e6ed8d56cd862
|
3 |
+
size 627
|
model/checkpoint-9730/trainer_state.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model/checkpoint-9730/training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:97eb522bcc64bc386948440a99b0b6a8fe561b48f3f9986a1caf0bc9c9e29f67
|
3 |
+
size 4091
|
model/config.json
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "facebook/convnextv2-base-22k-224",
|
3 |
+
"architectures": [
|
4 |
+
"ConvNextV2ForImageClassification"
|
5 |
+
],
|
6 |
+
"depths": [
|
7 |
+
3,
|
8 |
+
3,
|
9 |
+
27,
|
10 |
+
3
|
11 |
+
],
|
12 |
+
"drop_path_rate": 0.0,
|
13 |
+
"hidden_act": "gelu",
|
14 |
+
"hidden_sizes": [
|
15 |
+
128,
|
16 |
+
256,
|
17 |
+
512,
|
18 |
+
1024
|
19 |
+
],
|
20 |
+
"id2label": {
|
21 |
+
"0": "Acne and Rosacea Photos",
|
22 |
+
"1": "Actinic Keratosis Basal Cell Carcinoma and other Malignant Lesions",
|
23 |
+
"2": "Atopic Dermatitis Photos",
|
24 |
+
"3": "Bullous Disease Photos",
|
25 |
+
"4": "Cellulitis Impetigo and other Bacterial Infections",
|
26 |
+
"5": "Eczema Photos",
|
27 |
+
"6": "Exanthems and Drug Eruptions",
|
28 |
+
"7": "Hair Loss Photos Alopecia and other Hair Diseases",
|
29 |
+
"8": "Herpes HPV and other STDs Photos",
|
30 |
+
"9": "Light Diseases and Disorders of Pigmentation",
|
31 |
+
"10": "Lupus and other Connective Tissue diseases",
|
32 |
+
"11": "Melanoma Skin Cancer Nevi and Moles",
|
33 |
+
"12": "Nail Fungus and other Nail Disease",
|
34 |
+
"13": "Poison Ivy Photos and other Contact Dermatitis",
|
35 |
+
"14": "Psoriasis pictures Lichen Planus and related diseases",
|
36 |
+
"15": "Scabies Lyme Disease and other Infestations and Bites",
|
37 |
+
"16": "Seborrheic Keratoses and other Benign Tumors",
|
38 |
+
"17": "Systemic Disease",
|
39 |
+
"18": "Tinea Ringworm Candidiasis and other Fungal Infections",
|
40 |
+
"19": "Urticaria Hives",
|
41 |
+
"20": "Vascular Tumors",
|
42 |
+
"21": "Vasculitis Photos",
|
43 |
+
"22": "Warts Molluscum and other Viral Infections"
|
44 |
+
},
|
45 |
+
"image_size": 224,
|
46 |
+
"initializer_range": 0.02,
|
47 |
+
"label2id": {
|
48 |
+
"Acne and Rosacea Photos": 0,
|
49 |
+
"Actinic Keratosis Basal Cell Carcinoma and other Malignant Lesions": 1,
|
50 |
+
"Atopic Dermatitis Photos": 2,
|
51 |
+
"Bullous Disease Photos": 3,
|
52 |
+
"Cellulitis Impetigo and other Bacterial Infections": 4,
|
53 |
+
"Eczema Photos": 5,
|
54 |
+
"Exanthems and Drug Eruptions": 6,
|
55 |
+
"Hair Loss Photos Alopecia and other Hair Diseases": 7,
|
56 |
+
"Herpes HPV and other STDs Photos": 8,
|
57 |
+
"Light Diseases and Disorders of Pigmentation": 9,
|
58 |
+
"Lupus and other Connective Tissue diseases": 10,
|
59 |
+
"Melanoma Skin Cancer Nevi and Moles": 11,
|
60 |
+
"Nail Fungus and other Nail Disease": 12,
|
61 |
+
"Poison Ivy Photos and other Contact Dermatitis": 13,
|
62 |
+
"Psoriasis pictures Lichen Planus and related diseases": 14,
|
63 |
+
"Scabies Lyme Disease and other Infestations and Bites": 15,
|
64 |
+
"Seborrheic Keratoses and other Benign Tumors": 16,
|
65 |
+
"Systemic Disease": 17,
|
66 |
+
"Tinea Ringworm Candidiasis and other Fungal Infections": 18,
|
67 |
+
"Urticaria Hives": 19,
|
68 |
+
"Vascular Tumors": 20,
|
69 |
+
"Vasculitis Photos": 21,
|
70 |
+
"Warts Molluscum and other Viral Infections": 22
|
71 |
+
},
|
72 |
+
"layer_norm_eps": 1e-12,
|
73 |
+
"model_type": "convnextv2",
|
74 |
+
"num_channels": 3,
|
75 |
+
"num_stages": 4,
|
76 |
+
"out_features": [
|
77 |
+
"stage4"
|
78 |
+
],
|
79 |
+
"out_indices": [
|
80 |
+
4
|
81 |
+
],
|
82 |
+
"patch_size": 4,
|
83 |
+
"problem_type": "single_label_classification",
|
84 |
+
"stage_names": [
|
85 |
+
"stem",
|
86 |
+
"stage1",
|
87 |
+
"stage2",
|
88 |
+
"stage3",
|
89 |
+
"stage4"
|
90 |
+
],
|
91 |
+
"torch_dtype": "float32",
|
92 |
+
"transformers_version": "4.33.0"
|
93 |
+
}
|
model/eval_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 10.0,
|
3 |
+
"eval_accuracy": 0.7673663168415792,
|
4 |
+
"eval_loss": 0.8717091679573059,
|
5 |
+
"eval_runtime": 78.6297,
|
6 |
+
"eval_samples_per_second": 50.897,
|
7 |
+
"eval_steps_per_second": 3.192
|
8 |
+
}
|
model/preprocessor_config.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_pct": 0.875,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_rescale": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"image_mean": [
|
7 |
+
0.485,
|
8 |
+
0.456,
|
9 |
+
0.406
|
10 |
+
],
|
11 |
+
"image_processor_type": "ConvNextImageProcessor",
|
12 |
+
"image_std": [
|
13 |
+
0.229,
|
14 |
+
0.224,
|
15 |
+
0.225
|
16 |
+
],
|
17 |
+
"resample": 3,
|
18 |
+
"rescale_factor": 0.00392156862745098,
|
19 |
+
"size": {
|
20 |
+
"shortest_edge": 224
|
21 |
+
}
|
22 |
+
}
|
model/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:632b02968465fa5b7524d9a6767a331f7f9d981a2c11fe76cadea328902d0fd8
|
3 |
+
size 350997885
|
model/train_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 10.0,
|
3 |
+
"total_flos": 1.232466345637632e+19,
|
4 |
+
"train_loss": 0.6940609043573182,
|
5 |
+
"train_runtime": 7099.3654,
|
6 |
+
"train_samples_per_second": 21.913,
|
7 |
+
"train_steps_per_second": 1.371
|
8 |
+
}
|
model/trainer_state.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model/training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:97eb522bcc64bc386948440a99b0b6a8fe561b48f3f9986a1caf0bc9c9e29f67
|
3 |
+
size 4091
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|