Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,33 @@ def predict(input_img):
|
|
12 |
predictions = pipe(input_img)
|
13 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# Gradio ไป้ข่จญๅฎ๏ผ้่ช็๏ผ
|
16 |
gradio_app = gr.Interface(
|
17 |
fn=predict,
|
@@ -23,7 +50,8 @@ gradio_app = gr.Interface(
|
|
23 |
title="FaceAIorNot ๏ฝ ็ไบบ่๏ผ้ๆฏ AI ็ๆ่๏ผ",
|
24 |
description=(
|
25 |
"๐ค Upload or take a face photo to see if it's AI-generated or real.\n"
|
26 |
-
"๐ง ไธๅณๆๆๆไธๅผต่้จ็
ง็๏ผๅคๆทๆฏ็ไบบ้ๆฏ AI
|
|
|
27 |
),
|
28 |
allow_flagging="never"
|
29 |
)
|
|
|
12 |
predictions = pipe(input_img)
|
13 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
14 |
|
15 |
+
# ๆจกๅ่ชชๆ่ๅ
่ฒฌ่ฒๆ
|
16 |
+
model_card = """
|
17 |
+
## ๐ง Model Description / ๆจกๅ็ฐกไป
|
18 |
+
|
19 |
+
This model is a fine-tuned version of `microsoft/swin-tiny-patch4-window7-224` on the imagefolder dataset.
|
20 |
+
It classifies face images into two categories: **AI-generated** and **Not AI-generated**.
|
21 |
+
|
22 |
+
ๆฌๆจกๅๆฏไปฅ `microsoft/swin-tiny-patch4-window7-224` ๅพฎ่ชฟ่จ็ทด่ๆ๏ผๅฏๅฐ่้จๅ็ๅ้ก็บใAI็ๆใๆใ้AI็ๆใใ
|
23 |
+
|
24 |
+
### ๐ Evaluation Results / ๆจกๅ่ฉไผฐ
|
25 |
+
|
26 |
+
- Accuracy ๆบ็ขบ็: **99.35%**
|
27 |
+
- Precision ็ฒพ็ขบ็: **99.25%**
|
28 |
+
- Recall ๅฌๅ็: **99.47%**
|
29 |
+
- F1-score: **99.36%**
|
30 |
+
- Loss: **0.0233**
|
31 |
+
|
32 |
+
่จ็ทด่ณๆๅ
ๅซ 105,330 ๅผต่้จๅ็๏ผ50% ็บ็ๅฏฆ่้จ๏ผ50% ็บ AI ๅๆ่๏ผ๏ผไพ่ช 17 ๅ่ณๆ้ใ14 ็จฎ AI ็ๆๆ่ก๏ผ90% ไฝ็บ่จ็ทด้ใ10% ็บๆธฌ่ฉฆ้ใ
|
33 |
+
|
34 |
+
### โ ๏ธ Disclaimer / ๅ
่ฒฌ่ฒๆ
|
35 |
+
|
36 |
+
This model is for research and educational use.
|
37 |
+
It may not be 100% accurate, and **should not be used for critical decisions, such as identity verification, legal judgement, or public shaming**.
|
38 |
+
|
39 |
+
ๆฌๆจกๅๅ
ไพ็ ็ฉถ่ๆ่ฒ็จ้ๅ่๏ผ**็ตๆ้็พๅไน็พๆบ็ขบ๏ผ่ซๅฟ็จๆผ่บซๅ้ฉ่ญใๆณๅพๅคๆทใๅ
ฌ้ๆญ้ฒ็ญ้่ฆ็จ้**ใ
|
40 |
+
"""
|
41 |
+
|
42 |
# Gradio ไป้ข่จญๅฎ๏ผ้่ช็๏ผ
|
43 |
gradio_app = gr.Interface(
|
44 |
fn=predict,
|
|
|
50 |
title="FaceAIorNot ๏ฝ ็ไบบ่๏ผ้ๆฏ AI ็ๆ่๏ผ",
|
51 |
description=(
|
52 |
"๐ค Upload or take a face photo to see if it's AI-generated or real.\n"
|
53 |
+
"๐ง ไธๅณๆๆๆไธๅผต่้จ็
ง็๏ผๅคๆทๆฏ็ไบบ้ๆฏ AI ๅๆๅใ\n\n"
|
54 |
+
+ model_card
|
55 |
),
|
56 |
allow_flagging="never"
|
57 |
)
|