yash-gupta-01 commited on
Commit
4639788
·
1 Parent(s): 4d58c74

Deleted Files

Browse files
home.py CHANGED
@@ -1,137 +0,0 @@
1
- import streamlit as st
2
- from streamlit_lottie import st_lottie
3
- import requests
4
-
5
- # Function to load Lottie animation from a URL
6
- def load_lottieurl(url: str):
7
- """Fetch Lottie animation JSON from a URL."""
8
- try:
9
- response = requests.get(url)
10
- if response.status_code == 200:
11
- return response.json()
12
- except requests.exceptions.RequestException:
13
- return None
14
-
15
- # CSS Styling for light and dark modes
16
- st.markdown("""
17
- <style>
18
- body {
19
- margin: 0;
20
- padding: 0;
21
- font-family: 'Roboto', sans-serif;
22
- background-color: var(--background-color, #f8f9fa);
23
- color: var(--text-color, #212529);
24
- }
25
- h1 {
26
- font-size: 3rem;
27
- color: var(--primary-color, #007acc);
28
- text-align: center;
29
- margin-bottom: 15px;
30
- }
31
- h2, h3 {
32
- font-size: 1.5rem;
33
- color: var(--secondary-color, #005b96);
34
- text-align: center;
35
- margin-top: 20px;
36
- }
37
- p {
38
- font-family: 'Georgia', serif;
39
- color: var(--text-color, #212529);
40
- line-height: 1.6;
41
- text-align: justify;
42
- }
43
- .about-author {
44
- background-color: var(--card-bg, #ffffff);
45
- border-radius: 10px;
46
- padding: 25px;
47
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
48
- margin: 20px auto;
49
- max-width: 700px;
50
- text-align: center;
51
- color: var(--text-color, #212529);
52
- }
53
- .social-icons {
54
- display: flex;
55
- justify-content: center;
56
- gap: 20px;
57
- margin-top: 15px;
58
- }
59
- .social-icons a img {
60
- width: 40px;
61
- height: 40px;
62
- transition: transform 0.3s ease-in-out;
63
- }
64
- .social-icons a img:hover {
65
- transform: scale(1.2);
66
- }
67
- footer {
68
- margin-top: 50px;
69
- text-align: center;
70
- font-family: 'Georgia', serif;
71
- color: var(--text-muted, #6c757d);
72
- }
73
- </style>
74
- """, unsafe_allow_html=True)
75
-
76
- # Title and Tagline
77
- st.title("Mastering Machine Learning: From Basics To Brilliance 🚀🤖")
78
- st.markdown("## Your Gateway To Become Master In Data Science")
79
-
80
- # Display Lottie animation
81
- animation_url = "https://lottie.host/a45f4739-ef78-4193-b3f9-2ea435a190d5/PsTVRgXekn.json"
82
- lottie_animation = load_lottieurl(animation_url)
83
- if lottie_animation:
84
- st_lottie(lottie_animation, height=200, key="animation")
85
-
86
- # About the App Section
87
- st.subheader("About This Application")
88
- st.markdown("""
89
- This platform serves as a **comprehensive guide to Machine Learning and Data Science**.
90
- From grasping the fundamentals to deploying models, it offers insights into the entire lifecycle:
91
- - **Problem Definition**: Understand the business context and set clear objectives.
92
- - **Data Handling**: Collect, clean, and explore datasets to uncover insights.
93
- - **Model Development**: Build and optimize machine learning models.
94
- - **Model Deployment**: Deliver real-world solutions and monitor performance.
95
-
96
- Designed for both beginners and those looking to refine their skills, this app provides a structured learning path enriched with practical examples.
97
- """)
98
-
99
- # Key Takeaways Section
100
- st.subheader("What You'll Learn Here")
101
- st.markdown("""
102
- 1. **Step-by-Step Roadmaps**: Detailed guidance to help you navigate through data science challenges.
103
- 2. **Hands-on Projects**: Real-world examples and code snippets for applied learning.
104
- 3. **Visualizations**: Clear, intuitive graphs and plots to simplify complex concepts.
105
- 4. **Insights from Experience**: Lessons from my personal journey to help you avoid common pitfalls.
106
- """)
107
-
108
- # Author Section
109
- st.markdown("""
110
- <div class="about-author">
111
- <h2>About the Author</h2>
112
- <p>
113
- Hello! I'm <strong>Yash Harish Gupta</strong>, an aspiring data scientist deeply passionate about machine learning.
114
- My journey began with curiosity about how data drives decisions and has evolved into a mission to create impactful solutions.
115
- Currently, I am learning and preparing to embark on my professional career in this exciting field.
116
- </p>
117
- </div>
118
- """, unsafe_allow_html=True)
119
-
120
- # Social Links Section
121
- st.markdown("""
122
- <div class="social-icons">
123
- <a href="https://www.linkedin.com/in/yash-harish-gupta-71b011189/" target="_blank">
124
- <img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png" alt="LinkedIn">
125
- </a>
126
- <a href="https://github.com/YashGupta018" target="_blank">
127
- <img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub">
128
- </a>
129
- </div>
130
- """, unsafe_allow_html=True)
131
-
132
- # Footer Section
133
- st.markdown("""
134
- <footer>
135
- <p>Made with ❤️ by <strong>Yash Harish Gupta</strong> | © 2024</p>
136
- </footer>
137
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/01_home.py DELETED
@@ -1,154 +0,0 @@
1
- import streamlit as st
2
- from streamlit_lottie import st_lottie
3
- import requests
4
-
5
- # Function to load Lottie animations
6
- def load_lottie_url(url: str):
7
- r = requests.get(url)
8
- if r.status_code == 200:
9
- return r.json()
10
- else:
11
- return None
12
-
13
- # Function to display the content of each page
14
- def show_content(topic):
15
- if topic == "Introduction":
16
- st.title("Understanding Data Science and Artificial Intelligence 🌟")
17
- st.subheader("Overview of AI and Data Science")
18
- st.write("""
19
- Artificial Intelligence (AI) and Data Science have become buzzwords in today's tech-driven world.
20
- But what do they really mean, and why are they so significant? Let’s explore these fascinating concepts step by step!
21
- """)
22
-
23
- # Load the Lottie animation
24
- lottie_url = "https://assets4.lottiefiles.com/packages/lf20_tcbkqj.json"
25
- animation_data = load_lottie_url(lottie_url)
26
- if animation_data:
27
- st_lottie(animation_data, speed=1, width=600, height=400)
28
- else:
29
- st.write("Unable to load animation.")
30
-
31
- elif topic == "Understanding Intelligence":
32
- st.title("Understanding Intelligence")
33
- st.subheader("What is Natural Intelligence? 🐾")
34
- st.write("""
35
- **Definition**: NI refers to the intelligence naturally present in living beings.
36
- **Examples**:
37
- - A dog learning a trick. 🐕
38
- - Humans solving puzzles or making everyday decisions. 🧠
39
- """)
40
- st.subheader("What is Artificial Intelligence? 🤖")
41
- st.write("""
42
- **Definition**: Artificial intelligence (AI) is man-made intelligence where machines mimic human intelligence to perform tasks.
43
- **Real-Life Examples**:
44
- - Netflix recommending shows you’d love. 🎬
45
- - Google Maps finding the fastest route. 🗺️
46
- - Alexa answering your questions. 🎙️
47
- """)
48
-
49
- elif topic == "AI Tools: ML, DL, and Gen-AI":
50
- st.title("AI Tools: ML, DL, and Gen-AI")
51
- st.subheader("Machine Learning (ML) 🖥️")
52
- st.write("""
53
- - **What It Does**: ML enables machines to learn from patterns in data and make decisions.
54
- - **How It Works**: Similar to teaching a toddler to recognize fruits, ML algorithms process large datasets to "learn" and predict outcomes.
55
- - **Real-Life Applications**: Spam email detection 📧, Predicting stock prices 📈.
56
- """)
57
- st.subheader("Deep Learning (DL) 🤿")
58
- st.write("""
59
- - **What It Does**: DL uses neural networks to process and analyze complex data.
60
- - **How It Works**: DL processes data in layers, enabling machines to perform sophisticated tasks like facial recognition and medical imaging.
61
- - **Real-Life Applications**: Self-driving cars 🚗, Virtual assistants like Siri and Alexa. 🎙️
62
- """)
63
- st.subheader("Generative AI (Gen-AI) 🎨")
64
- st.write("""
65
- - **What It Does**: Gen-AI enables machines to generate new content like text, images, and music.
66
- - **How It Works**: By learning patterns from data, Gen-AI creates outputs that feel original and human-like.
67
- - **Real-Life Applications**: ChatGPT (text generation), DALL·E (image creation).
68
- """)
69
-
70
- elif topic == "Real-Life Analogies and Examples":
71
- st.title("Real-Life Analogies and Examples")
72
- st.subheader("Analogy: Tools Are Like Pens and Pencils")
73
- st.write("""
74
- - ML: Learns patterns (like sketching with a pencil).
75
- - DL: Adds depth and detail (like using a pen).
76
- - Gen-AI: Creates entirely new outputs (like turning sketches into colorful artwork).
77
- """)
78
- st.subheader("Learning vs. Generating: The Art Example 👩‍🎨")
79
- st.write("""
80
- Think of a child learning to draw:
81
- - First, they learn the basics of drawing.
82
- - Then they generate their own unique artwork.
83
-
84
- AI follows the same process:
85
- - Learning: ML and DL handle this part.
86
- - Generating: Gen-AI takes over to create new outputs.
87
- """)
88
-
89
- elif topic == "What is Data Science?":
90
- st.title("What is Data Science? 📊")
91
- st.write("""
92
- Data Science is the art of extracting meaningful insights from raw data. It combines AI with statistics, computer science, and domain expertise to solve real-world problems.
93
- **Key Components of Data Science**:
94
- - **Data Collection**: Gathering information from various sources.
95
- - **Data Analysis**: Using tools to find patterns and trends.
96
- - **Data Visualization**: Presenting findings through charts and graphs.
97
- """)
98
-
99
- elif topic == "The Role of a Data Scientist":
100
- st.title("The Role of a Data Scientist")
101
- st.write("""
102
- A Data Scientist plays a crucial role in:
103
- - Building predictive models.
104
- - Analyzing customer behavior.
105
- - Designing solutions for business challenges.
106
-
107
- **Tools Used**: Python, R, SQL, Tableau, etc.
108
- """)
109
-
110
- elif topic == "Why AI and Data Science Matter":
111
- st.title("Why AI and Data Science Matter")
112
- st.write("""
113
- AI and Data Science are transforming industries by:
114
- - Automating tasks.
115
- - Enhancing decision-making.
116
- - Unlocking creative possibilities.
117
-
118
- **Fun Fact**: By 2030, AI is expected to add $15.7 trillion to the global economy. 🚀
119
- """)
120
-
121
- elif topic == "Did You Know?":
122
- st.title("Did You Know?")
123
- st.write("""
124
- **AI is already being used to**:
125
- - Detect diseases in medical imaging.
126
- - Automate farming for higher crop yields.
127
- - Generate movie scripts and music albums.
128
- """)
129
-
130
- # Set up sidebar navigation
131
- topics = [
132
- "Introduction",
133
- "Understanding Intelligence",
134
- "AI Tools: ML, DL, and Gen-AI",
135
- "Real-Life Analogies and Examples",
136
- "What is Data Science?",
137
- "The Role of a Data Scientist",
138
- "Why AI and Data Science Matter",
139
- "Did You Know?"
140
- ]
141
-
142
- st.sidebar.title("Topics")
143
- selection = st.sidebar.radio("Go to", topics)
144
-
145
- # Initialize session state if not already done
146
- if "page" not in st.session_state:
147
- st.session_state.page = selection
148
-
149
- # Update session state if sidebar selection is changed
150
- if st.sidebar.button("Navigate"):
151
- st.session_state.page = selection
152
-
153
- # Display the selected content
154
- show_content(st.session_state.page)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/02_difference_between_mi_and_di.py DELETED
File without changes
pages/03_ml_vs_dl.py DELETED
@@ -1,91 +0,0 @@
1
- import streamlit as st
2
- from streamlit_lottie import st_lottie
3
- import requests
4
-
5
- # Function to load Lottie animations
6
- def load_lottie_url(url: str):
7
- response = requests.get(url)
8
- if response.status_code != 200:
9
- return None
10
- return response.json()
11
-
12
- # Load Lottie animations (you can uncomment these as per your need)
13
- # lottie_ml = load_lottie_url("https://assets8.lottiefiles.com/packages/lf20_5eyehzdr.json")
14
- # lottie_dl = load_lottie_url("https://assets8.lottiefiles.com/packages/lf20_vfnu1k6m.json")
15
-
16
- # Sidebar navigation
17
- st.sidebar.title("Navigation")
18
- page = st.sidebar.radio("Go to:", ["Home", "ML vs DL", "Comparison Table"])
19
-
20
- # Add Navigate button to update page
21
- if st.sidebar.button("Navigate"):
22
- st.session_state.page = page
23
-
24
- # Set page to session state if not already defined
25
- if "page" not in st.session_state:
26
- st.session_state.page = page
27
-
28
- # Home page
29
- if st.session_state.page == "Home":
30
- st.title("Understanding Machine Learning and Deep Learning")
31
- st.markdown(
32
- """
33
- Welcome to the interactive guide on Machine Learning (ML) and Deep Learning (DL). This space helps you
34
- explore the differences, capabilities, and applications of ML and DL in a structured manner.
35
- """
36
- )
37
- # If lottie_ml is loaded, display it (uncomment the following line when using animations)
38
- # if lottie_ml:
39
- # st_lottie(lottie_ml, height=300, key="ml_home")
40
-
41
- # ML vs DL page
42
- elif st.session_state.page == "ML vs DL":
43
- st.title("Difference Between Machine Learning (ML) and Deep Learning (DL)")
44
-
45
- st.subheader("Machine Learning 🖥️")
46
- st.markdown(
47
- """
48
- - Uses statistics to understand patterns in data and make predictions 📊.
49
- - Can learn with less data 📉.
50
- - Handles structured data; unstructured data must be converted to structured form 🔄.
51
- - Requires less memory 🧠💾.
52
- - Trains models in less time ⏱️.
53
- - Can run efficiently on CPUs without requiring powerful hardware 🖥️.
54
- """
55
- )
56
-
57
- st.subheader("Deep Learning 🤖")
58
- st.markdown(
59
- """
60
- - Uses neural networks to mimic brain-like learning and decision-making 🧠.
61
- - Requires large amounts of data for better accuracy 🍽️📊.
62
- - Handles both structured and unstructured data like images, text, and audio 🖼️📝🎧.
63
- - Requires more memory and storage 🧠💾.
64
- - Takes more time to train due to complex calculations ⏱️.
65
- - Needs GPUs and advanced hardware for efficient processing 🖥️💡.
66
- """
67
- )
68
- # If lottie_dl is loaded, display it (uncomment the following line when using animations)
69
- # if lottie_dl:
70
- # st_lottie(lottie_dl, height=300, key="dl_page")
71
-
72
- # Comparison Table page
73
- elif st.session_state.page == "Comparison Table":
74
- st.title("Comparison Table: ML vs DL")
75
-
76
- st.markdown(
77
- """
78
- | **Aspect** | **Machine Learning (ML)** | **Deep Learning (DL)** |
79
- |-------------------------|-------------------------------------------------|-------------------------------------------------|
80
- | **Definition** | Uses algorithms and statistics to learn from data. | Uses neural networks to mimic brain-like decision-making. |
81
- | **Data Dependency** | Works well with smaller datasets. | Requires large datasets for better accuracy. |
82
- | **Data Type** | Handles structured data only. | Handles both structured and unstructured data. |
83
- | **Training Time** | Requires less time to train. | Requires more time to train. |
84
- | **Hardware** | Can run on CPUs. | Requires GPUs and advanced hardware. |
85
- | **Memory Requirement** | Uses less memory. | Requires more memory and storage. |
86
- """
87
- )
88
-
89
- st.info(
90
- "Did you know? Deep Learning models are inspired by the human brain, making them exceptionally powerful for tasks like image recognition and natural language processing!"
91
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/04_life_cycle_of_mi.py DELETED
File without changes
pages/05_life_cycle_of_ml.py DELETED
@@ -1,115 +0,0 @@
1
- import streamlit as st
2
-
3
- # Configure the Streamlit app
4
- st.set_page_config(
5
- page_title="ML Project Lifecycle",
6
- page_icon="📊",
7
- layout="wide"
8
- )
9
-
10
- # Sidebar navigation
11
- st.sidebar.title("Navigation")
12
- page = st.sidebar.radio(
13
- "Choose a page:",
14
- [
15
- "Overview of ML Project Lifecycle",
16
- "1. Problem Definition",
17
- "2. Data Collection and Exploration",
18
- "3. Data Preprocessing",
19
- "4. Feature Engineering",
20
- "5. Model Selection and Training",
21
- "6. Model Evaluation",
22
- "7. Model Deployment"
23
- ]
24
- )
25
-
26
- # Main page content
27
- if page == "Overview of ML Project Lifecycle":
28
- st.markdown("<h1 style='text-align: center; color: white;'>Machine Learning Project Lifecycle</h1>", unsafe_allow_html=True)
29
- st.markdown("""
30
- This application provides a comprehensive overview of the **Machine Learning Project Lifecycle**.
31
- Explore the different stages of building an ML project by navigating through the pages on the left.
32
-
33
- ### The ML Project Lifecycle Includes:
34
- 1. **Problem Definition**
35
- 2. **Data Collection and Exploration**
36
- 3. **Data Preprocessing**
37
- 4. **Feature Engineering**
38
- 5. **Model Selection and Training**
39
- 6. **Model Evaluation**
40
- 7. **Model Deployment**
41
- """)
42
- st.image(
43
- "https://www.researchgate.net/profile/Hazem-El-Sayed/publication/335522887/figure/fig1/AS:798613045346310@1567359745828/Typical-ML-project-lifecycle.ppm",
44
- caption="Typical ML Project Lifecycle",
45
- use_column_width=True
46
- )
47
- st.markdown("Navigate through the stages using the sidebar to explore each phase in detail.")
48
-
49
- # Pages for individual lifecycle stages
50
- elif page == "1. Problem Definition":
51
- st.title("1. Problem Definition")
52
- st.markdown("""
53
- In this stage, the focus is on:
54
- - Understanding the business context and objectives.
55
- - Identifying the problem you are solving.
56
- - Breaking the problem into manageable sub-problems.
57
- """)
58
-
59
- elif page == "2. Data Collection and Exploration":
60
- st.title("2. Data Collection and Exploration")
61
- st.markdown("""
62
- This stage involves:
63
- - Gathering data from relevant sources (APIs, databases, web scraping, etc.).
64
- - Performing Exploratory Data Analysis (EDA) to understand patterns, trends, and outliers.
65
- - Visualizing data using tools like `Matplotlib` and `Seaborn`.
66
- """)
67
-
68
- elif page == "3. Data Preprocessing":
69
- st.title("3. Data Preprocessing")
70
- st.markdown("""
71
- Preprocessing involves:
72
- - Cleaning the data (handling missing values, duplicates, and errors).
73
- - Scaling and normalizing features.
74
- - Encoding categorical variables into numerical formats.
75
- """)
76
-
77
- elif page == "4. Feature Engineering":
78
- st.title("4. Feature Engineering")
79
- st.markdown("""
80
- Feature engineering includes:
81
- - Selecting the most relevant features for the model.
82
- - Creating new features using domain knowledge.
83
- - Reducing data dimensionality using techniques like PCA.
84
- """)
85
-
86
- elif page == "5. Model Selection and Training":
87
- st.title("5. Model Selection and Training")
88
- st.markdown("""
89
- This phase involves:
90
- - Choosing the right machine learning algorithm based on the problem type (classification, regression, clustering, etc.).
91
- - Training the model using the training dataset.
92
- - Fine-tuning hyperparameters to optimize performance.
93
- """)
94
-
95
- elif page == "6. Model Evaluation":
96
- st.title("6. Model Evaluation")
97
- st.markdown("""
98
- Model evaluation ensures:
99
- - Validation using techniques like cross-validation.
100
- - Testing on unseen data to estimate real-world performance.
101
- - Comparing multiple models and choosing the best one based on metrics like accuracy, F1-score, etc.
102
- """)
103
-
104
- elif page == "7. Model Deployment":
105
- st.title("7. Model Deployment")
106
- st.markdown("""
107
- In this stage:
108
- - The model is deployed into production using tools like Flask, FastAPI, or cloud platforms (AWS, GCP, Azure).
109
- - Monitoring the model to track its performance over time.
110
- - Setting up pipelines for periodic retraining with new data.
111
- """)
112
-
113
- # Footer
114
- st.sidebar.markdown("---")
115
- st.sidebar.markdown("<p style='text-align: center;'>© 2024 Yash Harish Gupta</p>", unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/06_data.py DELETED
File without changes
pages/07_structured_data.py DELETED
File without changes
pages/08_semi_structured_data.py DELETED
File without changes
pages/09_unstructured_data.py DELETED
File without changes
pages/10_types_of_data.py DELETED
File without changes
pages/11_data_collection.py DELETED
File without changes
pages/12_data_preprocessing.py DELETED
File without changes
pages/13_exploratory_data_analysis.py DELETED
File without changes
pages/14_simple_eda.py DELETED
File without changes
pages/15_feature_engineering.py DELETED
File without changes
pages/16_problem_statement.py DELETED
File without changes
pages/17_choosing_the_right_model.py DELETED
File without changes
pages/18_training_the_model.py DELETED
File without changes
pages/19_testing_the_model.py DELETED
File without changes
pages/20_deployment.py DELETED
File without changes
pages/21_monitoring.py DELETED
File without changes
pages/22_basic_operations_with_opencv.py DELETED
File without changes
pages/23_how_to_work_on_image.py DELETED
File without changes
pages/24_image.py DELETED
File without changes
pages/25_image_augmentation.py DELETED
File without changes
pages/26_handling_videos.py DELETED
File without changes
pages/27_how_to_handle_videos.py DELETED
File without changes
pages/28_converting_color_space.py DELETED
File without changes
pages/29_splitting_and_merging_images.py DELETED
File without changes
pages/30_transformation.py DELETED
File without changes
pages/31_introduction_to_json.py DELETED
File without changes
pages/32_lifecycle_of_ml.py DELETED
File without changes
pages/33_sql.py DELETED
File without changes
pages/34_xml.py DELETED
File without changes
pages/35_excel.py DELETED
File without changes
pages/36_projects.py DELETED
File without changes
pages/image_augmentation.py DELETED
@@ -1,183 +0,0 @@
1
- import streamlit as st
2
- from PIL import Image, ImageOps
3
- import numpy as np
4
- import io
5
-
6
- # Improved App Styling
7
- st.set_page_config(
8
- page_title="Modern Image Augmentation",
9
- page_icon="✨",
10
- layout="wide",
11
- )
12
-
13
- # Custom CSS for modern look
14
- st.markdown(
15
- """
16
- <style>
17
- /* App Background */
18
- .stApp {
19
- background: linear-gradient(135deg, #1f1f1f, #000000);
20
- color: #ffffff;
21
- }
22
-
23
- /* Title Styling */
24
- h1 {
25
- text-align: center;
26
- color: #00ffcc;
27
- font-family: 'Arial Black', sans-serif;
28
- }
29
-
30
- /* Sidebar Styling */
31
- [data-testid="stSidebar"] {
32
- background-color: #1c1c1c;
33
- border-right: 2px solid #00ffcc;
34
- }
35
-
36
- /* Slider Styling */
37
- [class^="css-qbe2hs"] {
38
- color: #00ffcc !important;
39
- }
40
-
41
- /* Buttons */
42
- button {
43
- background-color: #00ffcc !important;
44
- border: none;
45
- font-weight: bold;
46
- }
47
-
48
- button:hover {
49
- background-color: #00e6b8 !important;
50
- }
51
-
52
- /* Image Uploader */
53
- [data-testid="stFileUploadDropzone"] {
54
- background: #1c1c1c;
55
- border: 2px dashed #00ffcc;
56
- border-radius: 10px;
57
- }
58
-
59
- /* Augmentation Options Styling */
60
- [class^="stRadio"] > div > label {
61
- color: #ffffff;
62
- }
63
- </style>
64
- """,
65
- unsafe_allow_html=True,
66
- )
67
-
68
- st.title("✨ Modern Image Data Augmentation ✨")
69
-
70
- # File uploader for image
71
- uploaded_image = st.file_uploader("Upload an Image to Get Started", type=["jpg", "png", "jpeg"])
72
-
73
- if uploaded_image:
74
- try:
75
- image = Image.open(uploaded_image)
76
- col1, col2 = st.columns(2)
77
-
78
- # Display original image
79
- with col1:
80
- st.subheader("Original Image")
81
- st.image(image, caption="Uploaded Image", use_container_width=True)
82
-
83
- st.subheader("✨ Select an Augmentation")
84
-
85
- # Augmentation options
86
- augmentation_option = st.radio(
87
- "Choose an Augmentation Type:",
88
- [
89
- "None",
90
- "Cropping",
91
- "Flipping",
92
- "Rotation",
93
- "Zooming In",
94
- "Zooming Out",
95
- "Translation",
96
- "Shearing",
97
- ],
98
- )
99
-
100
- augmented_image = image
101
-
102
- # Augmentation Logic
103
- if augmentation_option == "Cropping":
104
- st.info("Adjust the crop sliders to modify the image.")
105
- left = st.slider("Left Crop", 0, image.width // 2, 0)
106
- top = st.slider("Top Crop", 0, image.height // 2, 0)
107
- right = st.slider("Right Crop", 0, image.width // 2, 0)
108
- bottom = st.slider("Bottom Crop", 0, image.height // 2, 0)
109
- augmented_image = image.crop((left, top, image.width - right, image.height - bottom))
110
-
111
- elif augmentation_option == "Flipping":
112
- flip_option = st.selectbox("Choose Flip Type", ["Horizontal", "Vertical"])
113
- if flip_option == "Horizontal":
114
- augmented_image = ImageOps.mirror(image)
115
- elif flip_option == "Vertical":
116
- augmented_image = ImageOps.flip(image)
117
-
118
- elif augmentation_option == "Rotation":
119
- rotation_angle = st.slider("Rotation Angle (°)", 0, 360, 0)
120
- if rotation_angle:
121
- augmented_image = image.rotate(rotation_angle, expand=True)
122
-
123
- elif augmentation_option == "Zooming In":
124
- zoom_factor = st.slider("Zoom Factor (%)", 100, 200, 100) / 100.0
125
- if zoom_factor != 1.0:
126
- width, height = image.size
127
- new_width = int(width * zoom_factor)
128
- new_height = int(height * zoom_factor)
129
- zoomed_image = image.resize((new_width, new_height))
130
- augmented_image = zoomed_image.crop(((new_width - width) // 2, (new_height - height) // 2,
131
- (new_width + width) // 2, (new_height + height) // 2))
132
-
133
- elif augmentation_option == "Zooming Out":
134
- zoom_factor = st.slider("Zoom Factor (%)", 50, 100, 100) / 100.0
135
- if zoom_factor != 1.0:
136
- width, height = image.size
137
- new_width = int(width * zoom_factor)
138
- new_height = int(height * zoom_factor)
139
- zoomed_image = image.resize((new_width, new_height))
140
- padded_image = Image.new("RGB", (width, height), (0, 0, 0)) # Black padding
141
- padded_image.paste(zoomed_image, ((width - new_width) // 2, (height - new_height) // 2))
142
- augmented_image = padded_image
143
-
144
- elif augmentation_option == "Translation":
145
- translation_x = st.slider("Horizontal Shift (Pixels)", -100, 100, 0)
146
- translation_y = st.slider("Vertical Shift (Pixels)", -100, 100, 0)
147
- if translation_x or translation_y:
148
- translation_matrix = (1, 0, translation_x, 0, 1, translation_y)
149
- augmented_image = image.transform(
150
- image.size, Image.AFFINE, translation_matrix, fillcolor=(0, 0, 0)
151
- )
152
-
153
- elif augmentation_option == "Shearing":
154
- shear_angle = st.slider("Shearing Angle (°)", -45, 45, 0)
155
- if shear_angle:
156
- shear_matrix = (1, np.tan(np.radians(shear_angle)), 0, 0, 1, 0)
157
- augmented_image = image.transform(
158
- (image.width + abs(int(image.height * np.tan(np.radians(shear_angle)))), image.height),
159
- Image.AFFINE,
160
- shear_matrix,
161
- fillcolor=(0, 0, 0),
162
- )
163
-
164
- # Display Augmented Image
165
- with col2:
166
- st.subheader(f"{augmentation_option} Applied")
167
- st.image(augmented_image, caption="Augmented Image", use_container_width=True)
168
-
169
- # Download button
170
- buffer = io.BytesIO()
171
- augmented_image.save(buffer, format="PNG")
172
- buffer.seek(0)
173
- st.download_button(
174
- "🎉 Download Augmented Image 🎉",
175
- buffer,
176
- file_name="augmented_image.png",
177
- mime="image/png",
178
- )
179
-
180
- except Exception as e:
181
- st.error(f"An error occurred: {e}")
182
- else:
183
- st.warning("Please upload an image to begin.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/introduction.py DELETED
File without changes
pages/life_cycle_of_ml_project.py DELETED
@@ -1,65 +0,0 @@
1
- <<<<<<< HEAD
2
- =======
3
- import matplotlib.pyplot as plt
4
- import numpy as np
5
-
6
- def draw_lifecycle_diagram():
7
- # Labels and colors for the lifecycle phases
8
- labels = [
9
- "1. Gathering Data",
10
- "2. Data Preparation",
11
- "3. Data Wrangling",
12
- "4. Analyze Data",
13
- "5. Train Model",
14
- "6. Test Model",
15
- "7. Deployment"
16
- ]
17
- colors = [
18
- "#3CB371", "#8FBC8F", "#00CED1", "#1E90FF",
19
- "#6A5ACD", "#FF8C00", "#DC143C"
20
- ]
21
-
22
- # Create a figure and axis with equal aspect ratio
23
- fig, ax = plt.subplots(figsize=(9, 9), subplot_kw={"aspect": "equal"})
24
- size = 0.3 # Width of the pie sections
25
-
26
- # Create pie sections for the lifecycle phases
27
- wedges, _ = ax.pie(
28
- [1] * len(labels),
29
- colors=colors,
30
- radius=1,
31
- startangle=90,
32
- wedgeprops=dict(width=size, edgecolor='w')
33
- )
34
-
35
- # Add text labels around the circle
36
- for i, wedge in enumerate(wedges):
37
- # Calculate the angle for the label placement
38
- angle = (wedge.theta2 - wedge.theta1) / 2.0 + wedge.theta1
39
- x = np.cos(np.deg2rad(angle))
40
- y = np.sin(np.deg2rad(angle))
41
-
42
- # Add label text
43
- ax.text(
44
- 1.2 * x, 1.2 * y, labels[i],
45
- ha="center", va="center", fontsize=10, weight="bold",
46
- bbox=dict(boxstyle="round,pad=0.3", facecolor=colors[i], edgecolor="w")
47
- )
48
-
49
- # Add center text with a descriptive title
50
- ax.text(
51
- 0, 0, "Machine Learning\nLifecycle",
52
- ha="center", va="center", fontsize=16, weight="bold", color="black",
53
- bbox=dict(boxstyle="round,pad=0.5", facecolor="white", edgecolor="black")
54
- )
55
-
56
- # Clean up the diagram style
57
- ax.set(aspect="equal", xticks=[], yticks=[], title="Machine Learning Lifecycle")
58
- return fig
59
-
60
- # Save the diagram or display it in Streamlit
61
- if __name__ == "__main__":
62
- # Display the diagram
63
- fig = draw_lifecycle_diagram()
64
- plt.show()
65
- >>>>>>> 8f9a0e1fa29de18412c739d9d5c3da24894df34d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pages/ml_vs_dl.py DELETED
File without changes