Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/main-checkpoint.py +4 -2
- main.py +4 -2
.ipynb_checkpoints/main-checkpoint.py
CHANGED
|
@@ -4,8 +4,10 @@ from transformers import pipeline
|
|
| 4 |
pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
|
| 5 |
|
| 6 |
def predict(input_img):
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
|
| 10 |
gradio_app = gr.Interface(
|
| 11 |
predict,
|
|
|
|
| 4 |
pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
|
| 5 |
|
| 6 |
def predict(input_img):
|
| 7 |
+
pred = pipeline(input_img)
|
| 8 |
+
label = ['Benign','Indeterminate','Malignant']
|
| 9 |
+
answer = f'We predict that you have {label[pred['label']]} type of skin cancer,\n with confidence score of: {pred['score']*100:.2f}%'
|
| 10 |
+
return answer
|
| 11 |
|
| 12 |
gradio_app = gr.Interface(
|
| 13 |
predict,
|
main.py
CHANGED
|
@@ -4,8 +4,10 @@ from transformers import pipeline
|
|
| 4 |
pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
|
| 5 |
|
| 6 |
def predict(input_img):
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
|
| 10 |
gradio_app = gr.Interface(
|
| 11 |
predict,
|
|
|
|
| 4 |
pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
|
| 5 |
|
| 6 |
def predict(input_img):
|
| 7 |
+
pred = pipeline(input_img)
|
| 8 |
+
label = ['Benign','Indeterminate','Malignant']
|
| 9 |
+
answer = f'We predict that you have {label[pred['label']]} type of skin cancer,\n with confidence score of: {pred['score']*100:.2f}%'
|
| 10 |
+
return answer
|
| 11 |
|
| 12 |
gradio_app = gr.Interface(
|
| 13 |
predict,
|