Spaces:
Running
Running
Commit
·
57ab548
1
Parent(s):
46c5397
init
Browse files
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -194,9 +194,10 @@ def edit_image_interface(input_image, prompt, request: gr.Request, progress=gr.P
|
|
194 |
try:
|
195 |
# 直接使用PIL Image对象进行检测,避免文件路径问题
|
196 |
nsfw_result = nsfw_detector.predict_pil_label_only(input_image)
|
197 |
-
|
198 |
|
199 |
if nsfw_result.lower() == "nsfw":
|
|
|
200 |
# 检查NSFW频率限制
|
201 |
is_rate_limited, wait_time = check_nsfw_rate_limit(client_ip)
|
202 |
|
@@ -216,6 +217,8 @@ def edit_image_interface(input_image, prompt, request: gr.Request, progress=gr.P
|
|
216 |
# print(f" 时间窗口: {window_info['window_start']} - {window_info['window_end']}")
|
217 |
# print(f" 当前计数: {window_info['current_count']}/{NSFW_LIMIT}, 允许继续处理")
|
218 |
# 不return,允许继续处理图片编辑
|
|
|
|
|
219 |
|
220 |
except Exception as e:
|
221 |
print(f"⚠️ NSFW检测失败: {e}")
|
|
|
194 |
try:
|
195 |
# 直接使用PIL Image对象进行检测,避免文件路径问题
|
196 |
nsfw_result = nsfw_detector.predict_pil_label_only(input_image)
|
197 |
+
|
198 |
|
199 |
if nsfw_result.lower() == "nsfw":
|
200 |
+
print(f"🔍 NSFW检测结果: ❌❌❌ {nsfw_result} - IP: {client_ip}({country_info})")
|
201 |
# 检查NSFW频率限制
|
202 |
is_rate_limited, wait_time = check_nsfw_rate_limit(client_ip)
|
203 |
|
|
|
217 |
# print(f" 时间窗口: {window_info['window_start']} - {window_info['window_end']}")
|
218 |
# print(f" 当前计数: {window_info['current_count']}/{NSFW_LIMIT}, 允许继续处理")
|
219 |
# 不return,允许继续处理图片编辑
|
220 |
+
else:
|
221 |
+
print(f"🔍 NSFW检测结果: ✅✅✅ {nsfw_result} - IP: {client_ip}({country_info})")
|
222 |
|
223 |
except Exception as e:
|
224 |
print(f"⚠️ NSFW检测失败: {e}")
|