koulsahil commited on
Commit
ddd6ce2
·
verified ·
1 Parent(s): 0f71ad6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +151 -0
app.py CHANGED
@@ -39,6 +39,156 @@ def predict(image):
39
 
40
 
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  # Set the page title and favicon (emoji as the icon)
44
  st.set_page_config(
@@ -117,6 +267,7 @@ with st.sidebar:
117
 
118
  # Main layout
119
  st.title("Land Cover Classification from Satellite Images ")
 
120
  st.write("🖼️📸 Drag and drop one of the thumbnails below, select a random image from the dropdown, or upload your own image to classify its land cover type.🌍")
121
 
122
  # Define sample images
 
39
 
40
 
41
 
42
+ def create_map_animation():
43
+ st.markdown("""
44
+ <div class="map-container">
45
+ <div class="sun"></div>
46
+ <div class="cloud cloud1"></div>
47
+ <div class="cloud cloud2"></div>
48
+ <div class="moving-car car1"></div>
49
+ <div class="moving-car car2"></div>
50
+ </div>
51
+
52
+ <style>
53
+ .map-container {
54
+ position: relative;
55
+ height: 400px;
56
+ width: 100%;
57
+ background: #87CEEB;
58
+ border-radius: 10px;
59
+ overflow: hidden;
60
+ margin: 20px 0;
61
+ border: 2px solid #4682B4;
62
+ }
63
+
64
+ /* Sun */
65
+ .sun {
66
+ position: absolute;
67
+ top: 20px;
68
+ right: 30px;
69
+ width: 50px;
70
+ height: 50px;
71
+ background: #FFD700;
72
+ border-radius: 50%;
73
+ animation: sunGlow 2s ease-in-out infinite;
74
+ }
75
+
76
+ .sun::after {
77
+ content: "";
78
+ position: absolute;
79
+ width: 100%;
80
+ height: 100%;
81
+ border: 4px solid #FFD700;
82
+ border-radius: 50%;
83
+ animation: sunPulse 2s ease-out infinite;
84
+ }
85
+
86
+ /* Clouds */
87
+ .cloud {
88
+ position: absolute;
89
+ background: white;
90
+ border-radius: 20px;
91
+ animation: cloudFloat 20s linear infinite;
92
+ }
93
+
94
+ .cloud1 {
95
+ top: 80px;
96
+ left: -100px;
97
+ width: 80px;
98
+ height: 30px;
99
+ animation-delay: 2s;
100
+ }
101
+
102
+ .cloud1::before {
103
+ content: "";
104
+ position: absolute;
105
+ top: -15px;
106
+ left: 10px;
107
+ width: 40px;
108
+ height: 40px;
109
+ background: white;
110
+ border-radius: 50%;
111
+ }
112
+
113
+ .cloud2 {
114
+ top: 120px;
115
+ left: -100px;
116
+ width: 100px;
117
+ height: 35px;
118
+ animation-delay: 5s;
119
+ }
120
+
121
+ .cloud2::before {
122
+ content: "";
123
+ position: absolute;
124
+ top: -15px;
125
+ left: 15px;
126
+ width: 50px;
127
+ height: 50px;
128
+ background: white;
129
+ border-radius: 50%;
130
+ }
131
+
132
+ /* Cars */
133
+ .moving-car {
134
+ position: absolute;
135
+ bottom: 30px;
136
+ width: 40px;
137
+ height: 20px;
138
+ border-radius: 5px;
139
+ animation: drive 8s linear infinite;
140
+ }
141
+
142
+ .car1 {
143
+ left: -50px;
144
+ background: #FF4757;
145
+ animation-delay: 1s;
146
+ }
147
+
148
+ .car2 {
149
+ left: -50px;
150
+ background: #2ED573;
151
+ animation-delay: 3s;
152
+ }
153
+
154
+ .moving-car::after, .moving-car::before {
155
+ content: "";
156
+ position: absolute;
157
+ width: 10px;
158
+ height: 10px;
159
+ background: #333;
160
+ border-radius: 50%;
161
+ bottom: -5px;
162
+ }
163
+
164
+ .moving-car::after { left: 5px; }
165
+ .moving-car::before { right: 5px; }
166
+
167
+ /* Animations */
168
+ @keyframes sunGlow {
169
+ 0%, 100% { box-shadow: 0 0 20px #FFD700; }
170
+ 50% { box-shadow: 0 0 40px #FFD700; }
171
+ }
172
+
173
+ @keyframes sunPulse {
174
+ 0% { transform: scale(1); opacity: 0.5; }
175
+ 100% { transform: scale(1.5); opacity: 0; }
176
+ }
177
+
178
+ @keyframes cloudFloat {
179
+ 0% { transform: translateX(0); }
180
+ 100% { transform: translateX(1200px); }
181
+ }
182
+
183
+ @keyframes drive {
184
+ 0% { transform: translateX(0); }
185
+ 100% { transform: translateX(1200px); }
186
+ }
187
+ </style>
188
+ """, unsafe_allow_html=True)
189
+
190
+
191
+
192
 
193
  # Set the page title and favicon (emoji as the icon)
194
  st.set_page_config(
 
267
 
268
  # Main layout
269
  st.title("Land Cover Classification from Satellite Images ")
270
+ create_map_animation()
271
  st.write("🖼️📸 Drag and drop one of the thumbnails below, select a random image from the dropdown, or upload your own image to classify its land cover type.🌍")
272
 
273
  # Define sample images