Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,40 @@ import numpy as np
|
|
| 4 |
from datetime import datetime
|
| 5 |
import random
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
def basic_filter(image, filter_type):
|
| 8 |
"""Apply basic image filters"""
|
| 9 |
if filter_type == "Gray Toning":
|
|
@@ -235,7 +269,7 @@ def image_processing(image, filter_type):
|
|
| 235 |
return cv2.cvtColor(output, cv2.COLOR_BGR2RGB) if len(output.shape) == 3 else output
|
| 236 |
|
| 237 |
# Gradio interface
|
| 238 |
-
with gr.Blocks(theme=
|
| 239 |
gr.Markdown("Image Filtering Studio")
|
| 240 |
|
| 241 |
with gr.Row():
|
|
|
|
| 4 |
from datetime import datetime
|
| 5 |
import random
|
| 6 |
|
| 7 |
+
#----------Start of theme----------
|
| 8 |
+
theme = gr.themes.Soft(
|
| 9 |
+
primary_hue="zinc",
|
| 10 |
+
secondary_hue="stone",
|
| 11 |
+
font=[gr.themes.GoogleFont('Kavivanar'), gr.themes.GoogleFont('Kavivanar'), 'system-ui', 'sans-serif'],
|
| 12 |
+
font_mono=[gr.themes.GoogleFont('Source Code Pro'), gr.themes.GoogleFont('Inconsolata'), gr.themes.GoogleFont('Inconsolata'), 'monospace'],
|
| 13 |
+
).set(
|
| 14 |
+
body_background_fill='*primary_100',
|
| 15 |
+
body_text_color='secondary_600',
|
| 16 |
+
body_text_color_subdued='*primary_500',
|
| 17 |
+
body_text_weight='500',
|
| 18 |
+
background_fill_primary='*primary_100',
|
| 19 |
+
background_fill_secondary='*secondary_200',
|
| 20 |
+
color_accent='*primary_300',
|
| 21 |
+
border_color_accent_subdued='*primary_400',
|
| 22 |
+
border_color_primary='*primary_400',
|
| 23 |
+
block_background_fill='*primary_300',
|
| 24 |
+
block_border_width='*panel_border_width',
|
| 25 |
+
block_info_text_color='*primary_700',
|
| 26 |
+
block_info_text_size='*text_md',
|
| 27 |
+
panel_background_fill='*primary_200',
|
| 28 |
+
accordion_text_color='*primary_600',
|
| 29 |
+
table_text_color='*primary_600',
|
| 30 |
+
input_background_fill='*primary_50',
|
| 31 |
+
input_background_fill_focus='*primary_100',
|
| 32 |
+
button_primary_background_fill='*primary_500',
|
| 33 |
+
button_primary_background_fill_hover='*primary_400',
|
| 34 |
+
button_primary_text_color='*primary_50',
|
| 35 |
+
button_primary_text_color_hover='*primary_100',
|
| 36 |
+
button_cancel_background_fill='*primary_500',
|
| 37 |
+
button_cancel_background_fill_hover='*primary_400'
|
| 38 |
+
)
|
| 39 |
+
#----------End of theme----------
|
| 40 |
+
|
| 41 |
def basic_filter(image, filter_type):
|
| 42 |
"""Apply basic image filters"""
|
| 43 |
if filter_type == "Gray Toning":
|
|
|
|
| 269 |
return cv2.cvtColor(output, cv2.COLOR_BGR2RGB) if len(output.shape) == 3 else output
|
| 270 |
|
| 271 |
# Gradio interface
|
| 272 |
+
with gr.Blocks(theme=theme()) as app:
|
| 273 |
gr.Markdown("Image Filtering Studio")
|
| 274 |
|
| 275 |
with gr.Row():
|