Commit
·
44ed09d
1
Parent(s):
edcf552
Remove image part
Browse files- src/app.py +1 -3
- src/utils/ui_components.py +0 -55
src/app.py
CHANGED
|
@@ -6,7 +6,6 @@ from utils.ui_components import (
|
|
| 6 |
render_header,
|
| 7 |
render_controls,
|
| 8 |
render_image_columns,
|
| 9 |
-
render_example_gallery,
|
| 10 |
render_info_sections
|
| 11 |
)
|
| 12 |
|
|
@@ -44,6 +43,5 @@ render_image_columns(
|
|
| 44 |
enhanced_image=st.session_state.get('enhanced_image')
|
| 45 |
)
|
| 46 |
|
| 47 |
-
# Render
|
| 48 |
-
render_example_gallery()
|
| 49 |
render_info_sections()
|
|
|
|
| 6 |
render_header,
|
| 7 |
render_controls,
|
| 8 |
render_image_columns,
|
|
|
|
| 9 |
render_info_sections
|
| 10 |
)
|
| 11 |
|
|
|
|
| 43 |
enhanced_image=st.session_state.get('enhanced_image')
|
| 44 |
)
|
| 45 |
|
| 46 |
+
# Render information sections
|
|
|
|
| 47 |
render_info_sections()
|
src/utils/ui_components.py
CHANGED
|
@@ -73,61 +73,6 @@ def render_image_columns(base_image=None, enhanced_image=None):
|
|
| 73 |
if enhanced_image:
|
| 74 |
st.image(enhanced_image, use_column_width=True)
|
| 75 |
|
| 76 |
-
def render_example_gallery():
|
| 77 |
-
st.markdown("""
|
| 78 |
-
<div class="dark-theme">
|
| 79 |
-
<h2>🎆 Example Gallery</h2>
|
| 80 |
-
<p>Compare original and enhanced versions for each style:</p>
|
| 81 |
-
</div>
|
| 82 |
-
""", unsafe_allow_html=True)
|
| 83 |
-
|
| 84 |
-
try:
|
| 85 |
-
output_dir = Path("Outputs")
|
| 86 |
-
original_dir = output_dir
|
| 87 |
-
enhanced_dir = output_dir / "Color_Enhanced"
|
| 88 |
-
|
| 89 |
-
if enhanced_dir.exists():
|
| 90 |
-
original_images = {
|
| 91 |
-
Path(f).stem.split('_example')[0]: f
|
| 92 |
-
for f in original_dir.glob("*.webp")
|
| 93 |
-
if '_example' in f.name
|
| 94 |
-
}
|
| 95 |
-
enhanced_images = {
|
| 96 |
-
Path(f).stem.split('_example')[0]: f
|
| 97 |
-
for f in enhanced_dir.glob("*.webp")
|
| 98 |
-
if '_example' in f.name
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
styles = [
|
| 102 |
-
("dhoni", "Dhoni Style"),
|
| 103 |
-
("mickey_mouse", "Mickey Mouse Style"),
|
| 104 |
-
("balloon", "Balloon Style"),
|
| 105 |
-
("lion_king", "Lion King Style"),
|
| 106 |
-
("rose_flower", "Rose Flower Style")
|
| 107 |
-
]
|
| 108 |
-
|
| 109 |
-
for style_key, style_name in styles:
|
| 110 |
-
if style_key in original_images and style_key in enhanced_images:
|
| 111 |
-
st.markdown(f"### {style_name}")
|
| 112 |
-
col1, col2 = st.columns(2)
|
| 113 |
-
|
| 114 |
-
with col1:
|
| 115 |
-
st.image(
|
| 116 |
-
str(original_images[style_key]),
|
| 117 |
-
caption="Original",
|
| 118 |
-
use_column_width=True
|
| 119 |
-
)
|
| 120 |
-
with col2:
|
| 121 |
-
st.image(
|
| 122 |
-
str(enhanced_images[style_key]),
|
| 123 |
-
caption="Color Enhanced",
|
| 124 |
-
use_column_width=True
|
| 125 |
-
)
|
| 126 |
-
st.markdown("<hr>", unsafe_allow_html=True)
|
| 127 |
-
|
| 128 |
-
except Exception as e:
|
| 129 |
-
st.error(f"Error loading example gallery: {str(e)}")
|
| 130 |
-
|
| 131 |
def render_info_sections():
|
| 132 |
col1, col2 = st.columns(2)
|
| 133 |
|
|
|
|
| 73 |
if enhanced_image:
|
| 74 |
st.image(enhanced_image, use_column_width=True)
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
def render_info_sections():
|
| 77 |
col1, col2 = st.columns(2)
|
| 78 |
|