osheina commited on
Commit
0799a5f
·
verified ·
1 Parent(s): 99e3e87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -95
app.py CHANGED
@@ -91,116 +91,62 @@ st.markdown(
91
  from { opacity: 0; }
92
  to { opacity: 1; }
93
  }
94
-
95
- /* Стили для интерактивных элементов боковой панели */
96
- .sidebar .element-container {
97
- margin: 20px 0;
98
- }
99
-
100
- .sidebar .element-container h3 {
101
- color: #ff7043;
102
- margin-bottom: 10px;
103
- }
104
-
105
- .sidebar .element-container input[type="text"] {
106
- padding: 10px;
107
- border-radius: 5px;
108
- border: 1px solid #ccc;
109
- width: 100%;
110
- }
111
-
112
- .sidebar .element-container textarea {
113
- padding: 10px;
114
- border-radius: 5px;
115
- border: 1px solid #ccc;
116
- width: 100%;
117
- height: 100px;
118
- }
119
  </style>
120
  """,
121
  unsafe_allow_html=True,
122
  )
123
 
124
- # Основной контент
125
- st.title("GestureGuru")
126
- st.subheader("Russian Sign Language Recognition")
127
- st.markdown("""
128
- <div class="card fade-in">
129
- <p>This application is designed to recognize sign language using a webcam feed. The model has been trained to recognize various sign language gestures and display the corresponding text in real-time.</p>
130
- </div>
131
- <div class="divider"></div>
132
- <div class="card fade-in">
133
- <h3>Features:</h3>
134
- <ul>
135
- <li>Real-time sign language recognition</li>
136
- <li>Supports multiple gestures</li>
137
- <li>Easy to use interface</li>
138
- </ul>
139
- </div>
140
- <div class="divider"></div>
141
- <div class="card fade-in">
142
- <h3>How it works:</h3>
143
- <ol>
144
- <li>Upload a video or use the camera for live recognition.</li>
145
- <li>The model processes the video and identifies the gestures.</li>
146
- <li>The recognized gestures are displayed as text.</li>
147
- </ol>
148
- </div>
149
- <div class="divider"></div>
150
- <div class="card fade-in">
151
- <h3>Why use this app:</h3>
152
- <ul>
153
- <li>Helps bridge the communication gap between sign language users and others.</li>
154
- <li>Useful for educational purposes and learning sign language.</li>
155
- <li>Enhances accessibility for people with hearing impairments.</li>
156
- </ul>
157
- </div>
158
- """, unsafe_allow_html=True)
159
-
160
- # Добавление картинки
161
- st.image("image.webp", caption="Sign Language Recognition", use_column_width=True)
162
-
163
  # Боковая панель
164
  st.sidebar.title("Navigation")
165
- st.sidebar.markdown(
166
- """
167
- <style>
168
- .sidebar .sidebar-content a {
169
- color: #4CAF50;
170
- font-size: 1.2rem;
171
- text-decoration: none;
172
- }
173
- .sidebar .sidebar-content a:hover {
174
- color: #f4511e;
175
- text-decoration: underline;
176
- }
177
- </style>
178
- """,
179
- unsafe_allow_html=True
180
- )
181
-
182
- # Добавление ссылок навигации
183
- st.sidebar.markdown("### Pages")
184
  page = st.sidebar.radio("Select a page:", ["Main", "Camera", "Video Upload"])
185
 
 
 
 
 
186
  if page == "Main":
 
 
187
  st.markdown("""
188
  <div class="card fade-in">
189
- <p>This is the main page of the application. Use the navigation menu on the left to access different features of the app.</p>
190
  </div>
191
- """, unsafe_allow_html=True)
192
-
193
- elif page == "Camera":
194
- st.markdown("""
195
  <div class="card fade-in">
196
- <p>This is the Camera page. Here you can use your webcam to recognize sign language gestures in real-time.</p>
 
 
 
 
 
197
  </div>
198
- """, unsafe_allow_html=True)
199
-
200
- elif page == "Video Upload":
201
- st.markdown("""
202
  <div class="card fade-in">
203
- <p>This is the Video Upload page. Here you can upload a video file to recognize sign language gestures from the video.</p>
 
 
 
 
 
204
  </div>
205
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
 
 
91
  from { opacity: 0; }
92
  to { opacity: 1; }
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  </style>
95
  """,
96
  unsafe_allow_html=True,
97
  )
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  # Боковая панель
100
  st.sidebar.title("Navigation")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  page = st.sidebar.radio("Select a page:", ["Main", "Camera", "Video Upload"])
102
 
103
+ # Установка параметров URL
104
+ st.experimental_set_query_params(page=page)
105
+
106
+ # Основной контент
107
  if page == "Main":
108
+ st.title("GestureGuru")
109
+ st.subheader("Russian Sign Language Recognition")
110
  st.markdown("""
111
  <div class="card fade-in">
112
+ <p>This application is designed to recognize sign language using a webcam feed. The model has been trained to recognize various sign language gestures and display the corresponding text in real-time.</p>
113
  </div>
114
+ <div class="divider"></div>
 
 
 
115
  <div class="card fade-in">
116
+ <h3>Features:</h3>
117
+ <ul>
118
+ <li>Real-time sign language recognition</li>
119
+ <li>Supports multiple gestures</li>
120
+ <li>Easy to use interface</li>
121
+ </ul>
122
  </div>
123
+ <div class="divider"></div>
 
 
 
124
  <div class="card fade-in">
125
+ <h3>How it works:</h3>
126
+ <ol>
127
+ <li>Upload a video or use the camera for live recognition.</li>
128
+ <li>The model processes the video and identifies the gestures.</li>
129
+ <li>The recognized gestures are displayed as text.</li>
130
+ </ol>
131
  </div>
132
+ <div class="divider"></div>
133
+ <div class="card fade-in">
134
+ <h3>Why use this app:</h3>
135
+ <ul>
136
+ <li>Helps bridge the communication gap between sign language users and others.</li>
137
+ <li>Useful for educational purposes and learning sign language.</li>
138
+ <li>Enhances accessibility for people with hearing impairments.</li>
139
+ </ul>
140
+ </div>
141
+ """, unsafe_allow_html=True)
142
+ st.image("/mnt/data/A_colorful,_artistic_representation_of_hands_signi.png", caption="Sign Language Recognition", use_column_width=True)
143
+
144
+ elif page == "Camera":
145
+ from pages import camera
146
+ camera.display()
147
+
148
+ elif page == "Video Upload":
149
+ from pages import video_upload
150
+ video_upload.display()
151
+
152