Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -61,26 +61,14 @@ def generate(image):
|
|
61 |
class CustomTheme(gr.themes.Base):
|
62 |
def __init__(self):
|
63 |
super().__init__()
|
64 |
-
self.primary_hue = "#
|
65 |
self.background_fill_primary = "#191a1e"
|
66 |
-
self.background_fill_secondary = "#191a1e"
|
67 |
-
self.background_fill_tertiary = "#191a1e"
|
68 |
self.text_color_primary = "#FFFFFF"
|
69 |
-
self.text_color_secondary = "#FFFFFF"
|
70 |
-
self.text_color_tertiary = "#FFFFFF"
|
71 |
self.input_background_fill = "#191a1e"
|
72 |
self.input_text_color = "#FFFFFF"
|
73 |
|
74 |
|
75 |
css = """
|
76 |
-
/* Скрываем нижний колонтитул */
|
77 |
-
footer {
|
78 |
-
visibility: hidden;
|
79 |
-
height: 0;
|
80 |
-
margin: 0;
|
81 |
-
padding: 0;
|
82 |
-
overflow: hidden;
|
83 |
-
}
|
84 |
/* Лоадер */
|
85 |
.loader-container {
|
86 |
position: absolute;
|
@@ -109,6 +97,25 @@ footer {
|
|
109 |
0% { transform: rotate(0deg); }
|
110 |
100% { transform: rotate(360deg); }
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
"""
|
113 |
|
114 |
# Интерфейс
|
@@ -116,22 +123,18 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
|
|
116 |
with gr.Column():
|
117 |
gr.Markdown("<span style='color: white; font-weight: bold;'>Upload and Process Your Image</span>")
|
118 |
with gr.Row():
|
119 |
-
with gr.
|
120 |
input_image = gr.Image(
|
121 |
label="Upload Image",
|
122 |
image_mode="RGBA",
|
123 |
sources="upload",
|
124 |
type="pil",
|
125 |
-
width=400,
|
126 |
-
height=300,
|
127 |
)
|
128 |
gr.HTML("<div class='loader-container' id='loader-dropimage'><div id='loading-bar'></div></div>")
|
129 |
-
with gr.
|
130 |
processed_image = gr.Image(
|
131 |
label="Processed Image",
|
132 |
interactive=False,
|
133 |
-
width=400,
|
134 |
-
height=300,
|
135 |
)
|
136 |
gr.HTML("<div class='loader-container' id='loader-processedimage'><div id='loading-bar'></div></div>")
|
137 |
gr.HTML("<div class='loader-container' id='loader-glb'><div id='loading-bar'></div></div>")
|
|
|
61 |
class CustomTheme(gr.themes.Base):
|
62 |
def __init__(self):
|
63 |
super().__init__()
|
64 |
+
self.primary_hue = "#5271FF"
|
65 |
self.background_fill_primary = "#191a1e"
|
|
|
|
|
66 |
self.text_color_primary = "#FFFFFF"
|
|
|
|
|
67 |
self.input_background_fill = "#191a1e"
|
68 |
self.input_text_color = "#FFFFFF"
|
69 |
|
70 |
|
71 |
css = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
/* Лоадер */
|
73 |
.loader-container {
|
74 |
position: absolute;
|
|
|
97 |
0% { transform: rotate(0deg); }
|
98 |
100% { transform: rotate(360deg); }
|
99 |
}
|
100 |
+
|
101 |
+
/* Кнопка Generate */
|
102 |
+
.generate-button {
|
103 |
+
background-color: #5271FF !important;
|
104 |
+
color: #FFFFFF !important;
|
105 |
+
border: none;
|
106 |
+
font-weight: bold;
|
107 |
+
padding: 10px 20px;
|
108 |
+
border-radius: 5px;
|
109 |
+
}
|
110 |
+
.generate-button:hover {
|
111 |
+
background-color: #405BBF !important;
|
112 |
+
}
|
113 |
+
|
114 |
+
/* Верхние контейнеры */
|
115 |
+
.gr-column .gr-box {
|
116 |
+
position: relative;
|
117 |
+
height: 300px;
|
118 |
+
}
|
119 |
"""
|
120 |
|
121 |
# Интерфейс
|
|
|
123 |
with gr.Column():
|
124 |
gr.Markdown("<span style='color: white; font-weight: bold;'>Upload and Process Your Image</span>")
|
125 |
with gr.Row():
|
126 |
+
with gr.Box():
|
127 |
input_image = gr.Image(
|
128 |
label="Upload Image",
|
129 |
image_mode="RGBA",
|
130 |
sources="upload",
|
131 |
type="pil",
|
|
|
|
|
132 |
)
|
133 |
gr.HTML("<div class='loader-container' id='loader-dropimage'><div id='loading-bar'></div></div>")
|
134 |
+
with gr.Box():
|
135 |
processed_image = gr.Image(
|
136 |
label="Processed Image",
|
137 |
interactive=False,
|
|
|
|
|
138 |
)
|
139 |
gr.HTML("<div class='loader-container' id='loader-processedimage'><div id='loading-bar'></div></div>")
|
140 |
gr.HTML("<div class='loader-container' id='loader-glb'><div id='loading-bar'></div></div>")
|