basheer67 commited on
Commit
659435f
·
verified ·
1 Parent(s): 7aea9e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +136 -136
app.py CHANGED
@@ -1,137 +1,137 @@
1
- import streamlit as st
2
- from PIL import Image
3
- import base64
4
- from io import BytesIO
5
-
6
- # Function to convert image to base64 for hover effect
7
- def get_image_base64(image_path):
8
- img = Image.open(image_path)
9
- buffered = BytesIO()
10
- img.save(buffered, format="jpg")
11
- return base64.b64encode(buffered.getvalue()).decode()
12
-
13
- # Set page configuration
14
- st.set_page_config(
15
- page_title="ML Projects Portfolio",
16
- page_icon="🤖",
17
- layout="wide"
18
- )
19
-
20
- # Custom CSS for styling
21
- st.markdown("""
22
- <style>
23
- .project-card {
24
- transition: all 0.3s ease;
25
- border-radius: 10px;
26
- padding: 10px;
27
- }
28
- .project-card:hover {
29
- transform: scale(1.05);
30
- box-shadow: 0 5px 15px rgba(0,0,0,0.3);
31
- }
32
- .main-title {
33
- font-size: 3rem;
34
- color: #1E90FF;
35
- text-align: center;
36
- margin-bottom: 2rem;
37
- }
38
- .subtitle {
39
- text-align: center;
40
- color: #666;
41
- margin-bottom: 3rem;
42
- }
43
- </style>
44
- """, unsafe_allow_html=True)
45
-
46
- # Header
47
- st.markdown('<h1 class="main-title">Machine Learning Projects Portfolio</h1>', unsafe_allow_html=True)
48
- st.markdown('<p class="subtitle">Click on any project image to explore</p>', unsafe_allow_html=True)
49
-
50
- # Create three columns for layout
51
- col1, col2, col3 = st.columns(3)
52
-
53
- # Project data actual project links)
54
- projects = [
55
-
56
- {
57
- "title": "FCCU 'LCO D 95' Lab Value Prediction App",
58
- "image": "refinery.jpg", # image path
59
- "url": "https://models-rhhj7lfypshz87uadtsqnp.streamlit.app/",
60
- "description": "Predicts '95% Distillation' of Diesel"
61
- },
62
- {
63
- "title": "CDU SRN 'RVP' Prediction Tool",
64
- "image": "flask3.jpg", # image path
65
- "url": "https://huggingface.co/spaces/basheer67/SRN_RVP",
66
- "description": "Predicts 'Ried Vapour Pressure' of Naptha"
67
- },
68
- {
69
- "title": "Old Car Price Prediction",
70
- "image": "car.jpg", # image path
71
- "url": "https://models-efsxczfpjxgyjw4h3tavch.streamlit.app/",
72
- "description": "Predict prices of used cars using ML"
73
- },
74
- {
75
- "title": "Indian Weather monitoring app",
76
- "image": "weather.jpg", # image path
77
- "url": "https://huggingface.co/spaces/basheer67/basheer-models",
78
- "description": "Feteches weather data of Indian cities"
79
- },
80
- {
81
- "title": "Depression Proneness Predictor",
82
- "image": "dep1.jpg", # image path
83
- "url": "https://huggingface.co/spaces/basheer67/mental_health",
84
- "description": "Predicts depression proneness using deep learning"
85
- },
86
-
87
- {
88
- "title": "Telegram bot of Chemical Engineering formulae",
89
- "image": "data.jpg", # Replace with your image path
90
- "url": "https://your-data-price-project-link.com",
91
- "description": "Telegram bot of formulae"
92
- }
93
- ]
94
-
95
- # Display projects in columns
96
- for i, project in enumerate(projects):
97
- # Place projects in appropriate columns
98
- if i % 3 == 0:
99
- current_col = col1
100
- elif i % 3 == 1:
101
- current_col = col2
102
- else:
103
- current_col = col3
104
-
105
- with current_col:
106
- # Create a container for each project
107
- with st.container():
108
- st.markdown(f'<div class="project-card">', unsafe_allow_html=True)
109
-
110
- # Display image with hyperlink
111
- try:
112
- img = Image.open(project["image"])
113
- st.image(
114
- img,
115
- caption=project["title"],
116
- use_container_width=True,
117
- output_format="jpg"
118
- )
119
-
120
- # Create clickable area
121
- if st.button("View Project", key=f"btn_{i}"):
122
- st.markdown(f'<meta http-equiv="refresh" content="0;URL={project["url"]}" />',
123
- unsafe_allow_html=True)
124
-
125
- except FileNotFoundError:
126
- st.error(f"Image for {project['title']} not found")
127
-
128
- st.write(project["description"])
129
- st.markdown('</div>', unsafe_allow_html=True)
130
- st.write("---")
131
-
132
- # Footer
133
- st.markdown("""
134
- <div style='text-align: center; padding: 20px;'>
135
- <p>Developed by SKB | © 2025 </p>
136
- </div>
137
  """, unsafe_allow_html=True)
 
1
+ import streamlit as st
2
+ from PIL import Image
3
+ import base64
4
+ from io import BytesIO
5
+
6
+ # Function to convert image to base64 for hover effect
7
+ def get_image_base64(image_path):
8
+ img = Image.open(image_path)
9
+ buffered = BytesIO()
10
+ img.save(buffered, format="jpg")
11
+ return base64.b64encode(buffered.getvalue()).decode()
12
+
13
+ # Set page configuration
14
+ st.set_page_config(
15
+ page_title="ML Projects Portfolio",
16
+ page_icon="📊",
17
+ layout="wide"
18
+ )
19
+
20
+ # Custom CSS for styling
21
+ st.markdown("""
22
+ <style>
23
+ .project-card {
24
+ transition: all 0.3s ease;
25
+ border-radius: 10px;
26
+ padding: 10px;
27
+ }
28
+ .project-card:hover {
29
+ transform: scale(1.05);
30
+ box-shadow: 0 5px 15px rgba(0,0,0,0.3);
31
+ }
32
+ .main-title {
33
+ font-size: 3rem;
34
+ color: #1E90FF;
35
+ text-align: center;
36
+ margin-bottom: 2rem;
37
+ }
38
+ .subtitle {
39
+ text-align: center;
40
+ color: #666;
41
+ margin-bottom: 3rem;
42
+ }
43
+ </style>
44
+ """, unsafe_allow_html=True)
45
+
46
+ # Header
47
+ st.markdown('<h1 class="main-title">Machine Learning Projects Portfolio</h1>', unsafe_allow_html=True)
48
+ st.markdown('<p class="subtitle">Click on any project image to explore</p>', unsafe_allow_html=True)
49
+
50
+ # Create three columns for layout
51
+ col1, col2, col3 = st.columns(3)
52
+
53
+ # Project data actual project links)
54
+ projects = [
55
+
56
+ {
57
+ "title": "FCCU 'LCO D 95' Lab Value Prediction App",
58
+ "image": "refinery.jpg", # image path
59
+ "url": "https://models-rhhj7lfypshz87uadtsqnp.streamlit.app/",
60
+ "description": "Predicts '95% Distillation' of Diesel"
61
+ },
62
+ {
63
+ "title": "CDU SRN 'RVP' Prediction Tool",
64
+ "image": "flask3.jpg", # image path
65
+ "url": "https://huggingface.co/spaces/basheer67/SRN_RVP",
66
+ "description": "Predicts 'Ried Vapour Pressure' of Naptha"
67
+ },
68
+ {
69
+ "title": "Old Car Price Prediction",
70
+ "image": "car.jpg", # image path
71
+ "url": "https://models-efsxczfpjxgyjw4h3tavch.streamlit.app/",
72
+ "description": "Predict prices of used cars using ML"
73
+ },
74
+ {
75
+ "title": "Indian Weather monitoring app",
76
+ "image": "weather.jpg", # image path
77
+ "url": "https://huggingface.co/spaces/basheer67/basheer-models",
78
+ "description": "Feteches weather data of Indian cities"
79
+ },
80
+ {
81
+ "title": "Depression Proneness Predictor",
82
+ "image": "dep1.jpg", # image path
83
+ "url": "https://huggingface.co/spaces/basheer67/mental_health",
84
+ "description": "Predicts depression proneness using deep learning"
85
+ },
86
+
87
+ {
88
+ "title": "Telegram bot of Chemical Engineering formulae",
89
+ "image": "data.jpg", # Replace with your image path
90
+ "url": "https://your-data-price-project-link.com",
91
+ "description": "Telegram bot of formulae"
92
+ }
93
+ ]
94
+
95
+ # Display projects in columns
96
+ for i, project in enumerate(projects):
97
+ # Place projects in appropriate columns
98
+ if i % 3 == 0:
99
+ current_col = col1
100
+ elif i % 3 == 1:
101
+ current_col = col2
102
+ else:
103
+ current_col = col3
104
+
105
+ with current_col:
106
+ # Create a container for each project
107
+ with st.container():
108
+ st.markdown(f'<div class="project-card">', unsafe_allow_html=True)
109
+
110
+ # Display image with hyperlink
111
+ try:
112
+ img = Image.open(project["image"])
113
+ st.image(
114
+ img,
115
+ caption=project["title"],
116
+ use_container_width=True,
117
+ output_format="jpg"
118
+ )
119
+
120
+ # Create clickable area
121
+ if st.button("View Project", key=f"btn_{i}"):
122
+ st.markdown(f'<meta http-equiv="refresh" content="0;URL={project["url"]}" />',
123
+ unsafe_allow_html=True)
124
+
125
+ except FileNotFoundError:
126
+ st.error(f"Image for {project['title']} not found")
127
+
128
+ st.write(project["description"])
129
+ st.markdown('</div>', unsafe_allow_html=True)
130
+ st.write("---")
131
+
132
+ # Footer
133
+ st.markdown("""
134
+ <div style='text-align: center; padding: 20px;'>
135
+ <p>Developed by SKB | © 2025 </p>
136
+ </div>
137
  """, unsafe_allow_html=True)