Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,10 @@ def yolov8_func(image,
|
|
27 |
print(f"Number of bounding boxes: {num_boxes}")
|
28 |
|
29 |
# Categorize based on number of boxes (detections) and provide recommendations
|
30 |
-
if num_boxes >
|
31 |
severity = "Worse"
|
32 |
recommendation = "It is recommended to see a dermatologist and start stronger acne treatment."
|
33 |
-
elif
|
34 |
severity = "Medium"
|
35 |
recommendation = "You should follow a consistent skincare routine with proper cleansing and moisturizing."
|
36 |
else:
|
@@ -55,7 +55,7 @@ inputs = [
|
|
55 |
gr.Image(type="filepath", label="Input Image"),
|
56 |
gr.Slider(minimum=320, maximum=1280, step=32, value=640, label="Image Size"),
|
57 |
gr.Slider(minimum=0, maximum=1, step=0.05, value=0.15, label="Confidence Threshold"),
|
58 |
-
gr.Slider(minimum=0, maximum=1, step=0.05, value=0.
|
59 |
]
|
60 |
|
61 |
# Define the output for the Gradio app (image + text for severity and recommendation)
|
|
|
27 |
print(f"Number of bounding boxes: {num_boxes}")
|
28 |
|
29 |
# Categorize based on number of boxes (detections) and provide recommendations
|
30 |
+
if num_boxes > 10:
|
31 |
severity = "Worse"
|
32 |
recommendation = "It is recommended to see a dermatologist and start stronger acne treatment."
|
33 |
+
elif 5 <= num_boxes <= 10:
|
34 |
severity = "Medium"
|
35 |
recommendation = "You should follow a consistent skincare routine with proper cleansing and moisturizing."
|
36 |
else:
|
|
|
55 |
gr.Image(type="filepath", label="Input Image"),
|
56 |
gr.Slider(minimum=320, maximum=1280, step=32, value=640, label="Image Size"),
|
57 |
gr.Slider(minimum=0, maximum=1, step=0.05, value=0.15, label="Confidence Threshold"),
|
58 |
+
gr.Slider(minimum=0, maximum=1, step=0.05, value=0.15, label="IOU Threshold")
|
59 |
]
|
60 |
|
61 |
# Define the output for the Gradio app (image + text for severity and recommendation)
|