Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,54 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
-
from utils import analyze, prepare_examples
|
| 5 |
|
| 6 |
load_dotenv()
|
| 7 |
TOKEN = os.getenv("HF_TOKEN")
|
| 8 |
|
| 9 |
EXAMPLES = prepare_examples()
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
with gr.Blocks(
|
| 12 |
title="Visual Content Moderation",
|
| 13 |
-
css=
|
| 14 |
theme=gr.themes.Default(primary_hue=gr.themes.colors.teal),
|
| 15 |
analytics_enabled=False,
|
| 16 |
) as demo:
|
| 17 |
gr.HTML("""
|
| 18 |
<div class="header">
|
| 19 |
-
<
|
| 20 |
<p>Official demo for the <a href="https://github.com/viddexa/moderators" target="_blank">moderators</a> package</p>
|
| 21 |
<p>
|
| 22 |
<a href="https://huggingface.co/viddexa/nsfw-mini" target="_blank">Model: nsfw-mini</a> |
|
|
@@ -31,12 +63,12 @@ with gr.Blocks(
|
|
| 31 |
with gr.Accordion("📄 BibTeX entry for citation", open=False):
|
| 32 |
gr.Textbox(
|
| 33 |
value="""@article{akyon2023nudity,
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
}""",
|
| 41 |
show_label=False,
|
| 42 |
lines=9,
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
+
from utils import analyze, prepare_examples
|
| 5 |
|
| 6 |
load_dotenv()
|
| 7 |
TOKEN = os.getenv("HF_TOKEN")
|
| 8 |
|
| 9 |
EXAMPLES = prepare_examples()
|
| 10 |
|
| 11 |
+
CSS = """
|
| 12 |
+
.header {
|
| 13 |
+
text-align: center;
|
| 14 |
+
padding: 2rem 1rem;
|
| 15 |
+
background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
|
| 16 |
+
color: white;
|
| 17 |
+
border-radius: 8px;
|
| 18 |
+
margin-bottom: 2rem;
|
| 19 |
+
}
|
| 20 |
+
.header-logo {
|
| 21 |
+
max-width: 400px;
|
| 22 |
+
height: auto;
|
| 23 |
+
margin: 0 auto;
|
| 24 |
+
display: block;
|
| 25 |
+
}
|
| 26 |
+
.header p { margin: 0.5rem 0; opacity: 0.9; }
|
| 27 |
+
.header a { color: white; text-decoration: underline; }
|
| 28 |
+
|
| 29 |
+
/* Hide built-in Gradio footer */
|
| 30 |
+
footer {
|
| 31 |
+
display: none !important;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/* Custom footer styling */
|
| 35 |
+
.custom-footer {
|
| 36 |
+
text-align: center;
|
| 37 |
+
padding: 1rem;
|
| 38 |
+
color: #888;
|
| 39 |
+
margin-top: 2rem;
|
| 40 |
+
}
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
with gr.Blocks(
|
| 44 |
title="Visual Content Moderation",
|
| 45 |
+
css=CSS,
|
| 46 |
theme=gr.themes.Default(primary_hue=gr.themes.colors.teal),
|
| 47 |
analytics_enabled=False,
|
| 48 |
) as demo:
|
| 49 |
gr.HTML("""
|
| 50 |
<div class="header">
|
| 51 |
+
<img src="https://github.com/viddexa/moderators/releases/download/v0.1.1/logo-v2.jpeg" alt="Visual Content Moderation" class="header-logo">
|
| 52 |
<p>Official demo for the <a href="https://github.com/viddexa/moderators" target="_blank">moderators</a> package</p>
|
| 53 |
<p>
|
| 54 |
<a href="https://huggingface.co/viddexa/nsfw-mini" target="_blank">Model: nsfw-mini</a> |
|
|
|
|
| 63 |
with gr.Accordion("📄 BibTeX entry for citation", open=False):
|
| 64 |
gr.Textbox(
|
| 65 |
value="""@article{akyon2023nudity,
|
| 66 |
+
title={State-of-the-art in nudity classification: A comparative analysis},
|
| 67 |
+
author={Akyon, Fatih Cagatay and Temizel, Alptekin},
|
| 68 |
+
booktitle={2023 IEEE International Conference on Acoustics, Speech, and Signal Processing Workshops (ICASSPW)},
|
| 69 |
+
pages={1--5},
|
| 70 |
+
year={2023},
|
| 71 |
+
organization={IEEE}
|
| 72 |
}""",
|
| 73 |
show_label=False,
|
| 74 |
lines=9,
|