| import streamlit as st |
| from PIL import Image |
|
|
| |
| st.set_page_config(page_title="Image Data Augmentation", layout="wide") |
|
|
| |
| st.markdown(""" |
| <style> |
| .title { |
| text-align: center; |
| color: #4CAF50; |
| font-size: 50px; |
| font-weight: bold; |
| } |
| .subtitle { |
| font-size: 22px; |
| color: #555; |
| } |
| .section { |
| background-color: #f9f9f9; |
| padding: 25px; |
| border-radius: 10px; |
| margin-bottom: 20px; |
| } |
| hr { |
| border: 1px solid #ccc; |
| } |
| </style> |
| """, unsafe_allow_html=True) |
|
|
| |
| st.markdown("<div class='title'>๐ผ๏ธ Image Data Augmentation</div>", unsafe_allow_html=True) |
| st.markdown("<hr>", unsafe_allow_html=True) |
|
|
| |
| st.markdown("<div class='section'>", unsafe_allow_html=True) |
| st.subheader("๐ What is Image Data Augmentation?") |
| st.markdown(""" |
| Image Data Augmentation is a technique used to artificially expand your training dataset by generating modified versions of existing images. |
| This allows your model to: |
| - Learn from variations (rotation, lighting, etc.) |
| - Become more robust |
| - Reduce overfitting |
| """) |
| st.markdown("</div>", unsafe_allow_html=True) |
|
|
| |
| st.markdown("<div class='section'>", unsafe_allow_html=True) |
| st.subheader("๐ก Why Do We Use It?") |
| cols = st.columns(2) |
| with cols[0]: |
| st.markdown(""" |
| - ๐ Boost model performance |
| - ๐ง Improve generalization |
| - ๐ Simulate real-world scenarios |
| - ๐พ Reduce need for collecting more data |
| """) |
| with cols[1]: |
| st.image("https://raw.githubusercontent.com/aleju/imgaug-doc/master/images/examples_grid.jpg", |
| caption="Augmentation Examples (imgaug)", use_container_width=True) |
| st.markdown("</div>", unsafe_allow_html=True) |
|
|
| |
| st.markdown("<div class='section'>", unsafe_allow_html=True) |
| st.subheader("๐งฐ Types of Image Augmentations") |
| cols = st.columns(2) |
| with cols[0]: |
| st.markdown(""" |
| - ๐ **Rotation** |
| - ๐ **Flipping** |
| - ๐ **Zooming** |
| - ๐ **Brightness/Contrast** |
| - โ๏ธ **Cropping** |
| """) |
| with cols[1]: |
| st.markdown(""" |
| - ๐ **Translation** |
| - ๐งฎ **Scaling** |
| - ๐ **Shearing** |
| - ๐งฒ **Affine Transformations** |
| """) |
| st.markdown("</div>", unsafe_allow_html=True) |
|
|
| |
| st.markdown("<div class='section'>", unsafe_allow_html=True) |
| st.subheader("๐ What Are Affine Transformations?") |
| st.markdown(""" |
| Affine transformations maintain the shape of objects while changing their **position**, **size**, or **angle**: |
| - ๐ **Translation**: Move image |
| - ๐ **Scaling**: Resize image |
| - ๐ **Rotation**: Turn image |
| - ๐ **Shearing**: Slant/stretch image |
| """) |
| st.success("โ
These help the model recognize patterns under different conditions.") |
| st.markdown("</div>", unsafe_allow_html=True) |
|
|
| |
| st.markdown("<hr>", unsafe_allow_html=True) |
| st.markdown("<p style='text-align: center;'>๐ง Created with โค๏ธ using Streamlit</p>", unsafe_allow_html=True) |
|
|