Update app.py
Browse files
app.py
CHANGED
|
@@ -114,21 +114,36 @@ def deblur_image(filepath):
|
|
| 114 |
print(f"Error processing image: {e}")
|
| 115 |
return None
|
| 116 |
|
| 117 |
-
# ✅ Custom CSS to hide
|
| 118 |
custom_css = """
|
| 119 |
-
/*
|
| 120 |
-
button[title="Fullscreen"]
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
-
|
| 126 |
/* Styling adjustments */
|
| 127 |
body, .gradio-container {
|
| 128 |
background-color: #000000 !important;
|
| 129 |
color: white !important;
|
| 130 |
}
|
| 131 |
-
|
| 132 |
.gr-button {
|
| 133 |
background: #1e90ff !important;
|
| 134 |
color: white !important;
|
|
@@ -137,11 +152,9 @@ body, .gradio-container {
|
|
| 137 |
font-size: 14px !important;
|
| 138 |
cursor: pointer;
|
| 139 |
}
|
| 140 |
-
|
| 141 |
.gr-button:hover {
|
| 142 |
background: #0056b3 !important;
|
| 143 |
}
|
| 144 |
-
|
| 145 |
.gr-box, .gr-input, .gr-output {
|
| 146 |
background-color: #1c1c1c !important;
|
| 147 |
color: white !important;
|
|
@@ -155,10 +168,10 @@ demo = gr.Interface(
|
|
| 155 |
inputs=gr.File(label="Input", type="filepath"),
|
| 156 |
outputs=gr.Image(type="numpy", label="Deblurred Result"),
|
| 157 |
title="Image Deblurring",
|
| 158 |
-
description="Upload a blurry image
|
| 159 |
css=custom_css
|
| 160 |
)
|
| 161 |
|
| 162 |
# ✅ Launch Gradio app
|
| 163 |
if __name__ == "__main__":
|
| 164 |
-
demo.launch()
|
|
|
|
| 114 |
print(f"Error processing image: {e}")
|
| 115 |
return None
|
| 116 |
|
| 117 |
+
# ✅ Custom CSS to completely hide fullscreen and share icons
|
| 118 |
custom_css = """
|
| 119 |
+
/* Completely hide fullscreen and share buttons */
|
| 120 |
+
button[title="Fullscreen"],
|
| 121 |
+
button[title="Share"],
|
| 122 |
+
.gr-button[title="Fullscreen"],
|
| 123 |
+
.gr-button[title="Share"] {
|
| 124 |
+
display: none !important; /* Remove from the layout */
|
| 125 |
+
opacity: 0 !important; /* Make it invisible */
|
| 126 |
+
visibility: hidden !important; /* Ensure it's hidden */
|
| 127 |
+
width: 0 !important; /* Collapse the button size */
|
| 128 |
+
height: 0 !important; /* Collapse the button size */
|
| 129 |
+
overflow: hidden !important; /* Prevent any content visibility */
|
| 130 |
+
pointer-events: none !important; /* Disable all interactions */
|
| 131 |
+
}
|
| 132 |
+
/* Hide Gradio's footer and header */
|
| 133 |
+
footer, header, .gradio-footer, .gradio-header {
|
| 134 |
+
display: none !important;
|
| 135 |
+
}
|
| 136 |
+
/* Non-draggable images */
|
| 137 |
+
img {
|
| 138 |
+
pointer-events: none !important;
|
| 139 |
+
-webkit-user-drag: none !important;
|
| 140 |
+
user-select: none !important;
|
| 141 |
}
|
|
|
|
| 142 |
/* Styling adjustments */
|
| 143 |
body, .gradio-container {
|
| 144 |
background-color: #000000 !important;
|
| 145 |
color: white !important;
|
| 146 |
}
|
|
|
|
| 147 |
.gr-button {
|
| 148 |
background: #1e90ff !important;
|
| 149 |
color: white !important;
|
|
|
|
| 152 |
font-size: 14px !important;
|
| 153 |
cursor: pointer;
|
| 154 |
}
|
|
|
|
| 155 |
.gr-button:hover {
|
| 156 |
background: #0056b3 !important;
|
| 157 |
}
|
|
|
|
| 158 |
.gr-box, .gr-input, .gr-output {
|
| 159 |
background-color: #1c1c1c !important;
|
| 160 |
color: white !important;
|
|
|
|
| 168 |
inputs=gr.File(label="Input", type="filepath"),
|
| 169 |
outputs=gr.Image(type="numpy", label="Deblurred Result"),
|
| 170 |
title="Image Deblurring",
|
| 171 |
+
description="Upload a blurry image.",
|
| 172 |
css=custom_css
|
| 173 |
)
|
| 174 |
|
| 175 |
# ✅ Launch Gradio app
|
| 176 |
if __name__ == "__main__":
|
| 177 |
+
demo.launch()
|