Commit
·
b3673c2
1
Parent(s):
043f3b8
Update represent result
Browse files- app.py +1 -1
- utils/data_processing.py +1 -1
app.py
CHANGED
@@ -18,7 +18,7 @@ with gr.Blocks() as demo:
|
|
18 |
|
19 |
# Advanced parameters for Detailed Analysis
|
20 |
with gr.Row():
|
21 |
-
conf_threshold = gr.Slider(0, 1, value=0.
|
22 |
iou_threshold = gr.Slider(0, 1, value=0.45, label="Overlap Threshold")
|
23 |
label_mode = gr.Dropdown(
|
24 |
["Draw box", "Draw Label", "Draw Confidence", "Censor Predictions"],
|
|
|
18 |
|
19 |
# Advanced parameters for Detailed Analysis
|
20 |
with gr.Row():
|
21 |
+
conf_threshold = gr.Slider(0, 1, value=0.2, label="Confidence Threshold")
|
22 |
iou_threshold = gr.Slider(0, 1, value=0.45, label="Overlap Threshold")
|
23 |
label_mode = gr.Dropdown(
|
24 |
["Draw box", "Draw Label", "Draw Confidence", "Censor Predictions"],
|
utils/data_processing.py
CHANGED
@@ -148,7 +148,7 @@ def detect_nsfw(input_image, conf_threshold=0.3, iou_threshold=0.45, label_mode=
|
|
148 |
)
|
149 |
|
150 |
# Construct detailed result text
|
151 |
-
if "head" in label_counts:
|
152 |
head_count = label_counts["head"]
|
153 |
result_text = (
|
154 |
f"Detected content:\n - head: {head_count} instance(s)\nThis image appears to be safe."
|
|
|
148 |
)
|
149 |
|
150 |
# Construct detailed result text
|
151 |
+
if "head" in label_counts and len(label_counts) == 1:
|
152 |
head_count = label_counts["head"]
|
153 |
result_text = (
|
154 |
f"Detected content:\n - head: {head_count} instance(s)\nThis image appears to be safe."
|