Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1137,6 +1137,7 @@ def detect_ai_image(image):
|
|
1137 |
adjusted_probability, ps_score, beauty_score, ps_signs, ai_signs, beauty_signs, valid_models
|
1138 |
)
|
1139 |
|
|
|
1140 |
# 构建最终结果
|
1141 |
final_result = {
|
1142 |
"ai_probability": adjusted_probability,
|
@@ -1145,7 +1146,7 @@ def detect_ai_image(image):
|
|
1145 |
"beauty_score": beauty_score,
|
1146 |
"ai_feature_score": ai_feature_score,
|
1147 |
"category": category,
|
1148 |
-
"main_category": main_category,
|
1149 |
"description": description,
|
1150 |
"ps_details": ps_details,
|
1151 |
"ai_details": ai_details,
|
@@ -1154,7 +1155,11 @@ def detect_ai_image(image):
|
|
1154 |
"features": image_features
|
1155 |
}
|
1156 |
|
1157 |
-
|
|
|
|
|
|
|
|
|
1158 |
|
1159 |
# 创建Gradio界面
|
1160 |
iface = gr.Interface(
|
|
|
1137 |
adjusted_probability, ps_score, beauty_score, ps_signs, ai_signs, beauty_signs, valid_models
|
1138 |
)
|
1139 |
|
1140 |
+
# 构建最终结果
|
1141 |
# 构建最终结果
|
1142 |
final_result = {
|
1143 |
"ai_probability": adjusted_probability,
|
|
|
1146 |
"beauty_score": beauty_score,
|
1147 |
"ai_feature_score": ai_feature_score,
|
1148 |
"category": category,
|
1149 |
+
"main_category": main_category,
|
1150 |
"description": description,
|
1151 |
"ps_details": ps_details,
|
1152 |
"ai_details": ai_details,
|
|
|
1155 |
"features": image_features
|
1156 |
}
|
1157 |
|
1158 |
+
# 为Label组件准备数据
|
1159 |
+
label_data = {main_category: 1.0}
|
1160 |
+
|
1161 |
+
# 返回两个值:JSON结果和Label数据
|
1162 |
+
return final_result, label_data
|
1163 |
|
1164 |
# 创建Gradio界面
|
1165 |
iface = gr.Interface(
|