Spaces:
Sleeping
Sleeping
Fix Gradio compatibility issues - pin version and remove examples
Browse files- README.md +1 -1
- app.py +5 -5
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🔬
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.16.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
import torch.nn as nn
|
|
@@ -68,8 +69,8 @@ def predict_skin_type(image):
|
|
| 68 |
Confidence: {confidence:.1%}
|
| 69 |
|
| 70 |
Detailed Probabilities:
|
| 71 |
-
|
| 72 |
-
|
| 73 |
|
| 74 |
Note: This is an AI prediction for educational purposes only."""
|
| 75 |
|
|
@@ -89,10 +90,9 @@ iface = gr.Interface(
|
|
| 89 |
inputs=gr.Image(type="pil", label="Upload facial skin image"),
|
| 90 |
outputs=gr.Textbox(label="Prediction Results", lines=8),
|
| 91 |
title="AI Skin Type Classifier",
|
| 92 |
-
description="Upload a clear facial image to classify skin type as dry or oily."
|
| 93 |
-
examples=["face_sample1.jpg"] if os.path.exists("face_sample1.jpg") else None
|
| 94 |
)
|
| 95 |
|
| 96 |
# Launch
|
| 97 |
if __name__ == "__main__":
|
| 98 |
-
iface.launch()
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
import torch.nn as nn
|
|
|
|
| 69 |
Confidence: {confidence:.1%}
|
| 70 |
|
| 71 |
Detailed Probabilities:
|
| 72 |
+
- Dry Skin: {dry_prob:.1%}
|
| 73 |
+
- Oily Skin: {oily_prob:.1%}
|
| 74 |
|
| 75 |
Note: This is an AI prediction for educational purposes only."""
|
| 76 |
|
|
|
|
| 90 |
inputs=gr.Image(type="pil", label="Upload facial skin image"),
|
| 91 |
outputs=gr.Textbox(label="Prediction Results", lines=8),
|
| 92 |
title="AI Skin Type Classifier",
|
| 93 |
+
description="Upload a clear facial image to classify skin type as dry or oily."
|
|
|
|
| 94 |
)
|
| 95 |
|
| 96 |
# Launch
|
| 97 |
if __name__ == "__main__":
|
| 98 |
+
iface.launch(share=False)
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
torch
|
| 2 |
torchvision
|
| 3 |
Pillow
|
| 4 |
-
gradio
|
|
|
|
| 1 |
torch
|
| 2 |
torchvision
|
| 3 |
Pillow
|
| 4 |
+
gradio==4.16.0
|