Spaces:
Sleeping

nivith commited on
Commit
ca7de2c
·
verified ·
1 Parent(s): d9b29f8

Upload PCOSpred.html

Browse files
Files changed (1) hide show
  1. PCOSpred.html +240 -0
PCOSpred.html ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
+ <title>PCOS Prediction</title>
7
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet"/>
8
+ <style>
9
+
10
+ * { margin: 0; padding: 0; box-sizing: border-box; }
11
+ body {
12
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
13
+ background-color: #0f172a;
14
+ color: #f1f5f9;
15
+ display: flex;
16
+ height: 100vh;
17
+ }
18
+ .sidebar {
19
+ width: 320px;
20
+ background-color: #1e293b;
21
+ display: flex;
22
+ justify-content: center;
23
+ align-items: center;
24
+ position: fixed;
25
+ height: 100vh;
26
+ top: 0;
27
+ left: 0;
28
+ }
29
+ .sidebar-content {
30
+ background-color: #0f172a;
31
+ border-radius: 18px;
32
+ padding: 60px 30px;
33
+ width: 90%;
34
+ box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
35
+ display: flex;
36
+ flex-direction: column;
37
+ align-items: center;
38
+ gap: 30px;
39
+ }
40
+ .sidebar h2 {
41
+ font-size: 20px;
42
+ font-weight: 500;
43
+ color: #f1f5f9;
44
+ text-align: center;
45
+ display: flex;
46
+ align-items: center;
47
+ gap: 12px;
48
+ }
49
+ .nav {
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 18px;
53
+ width: 100%;
54
+ }
55
+ .nav a {
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 12px;
59
+ padding: 14px 18px;
60
+ text-decoration: none;
61
+ color: #cbd5e1;
62
+ border-radius: 8px;
63
+ font-size: 16px;
64
+ transition: background 0.2s ease;
65
+ }
66
+ .nav a:hover { background-color: #334155; }
67
+ .nav a.active { background-color: #ef4444; color: white; }
68
+ .main {
69
+ margin-left: 320px;
70
+ padding: 60px 80px;
71
+ width: 100%;
72
+ overflow-y: auto;
73
+ }
74
+ .main h1 { font-size: 28px; margin-bottom: 10px; }
75
+ form { margin-top: 30px; }
76
+ .form-row { margin-bottom: 18px; }
77
+ label { display: block; margin-bottom: 6px; color: #cbd5e1; }
78
+ input, select {
79
+ width: 100%;
80
+ padding: 10px;
81
+ border-radius: 6px;
82
+ border: none;
83
+ background-color: #1e293b;
84
+ color: #f8fafc;
85
+ }
86
+ button {
87
+ margin-top: 20px;
88
+ padding: 12px 24px;
89
+ border: none;
90
+ border-radius: 6px;
91
+ background-color: #ef4444;
92
+ color: white;
93
+ font-size: 16px;
94
+ cursor: pointer;
95
+ transition: background-color 0.2s ease;
96
+ }
97
+ button:hover { background-color: #dc2626; }
98
+ .result-box {
99
+ margin-top: 30px;
100
+ padding: 24px;
101
+ border: 2px solid #38bdf8;
102
+ border-radius: 10px;
103
+ background-color: #0f172a;
104
+ text-align: center;
105
+ font-size: 20px;
106
+ font-weight: bold;
107
+ color: #38bdf8;
108
+ display: none;
109
+ box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
110
+ animation: fadeIn 0.6s ease-in-out;
111
+ }
112
+ @keyframes fadeIn {
113
+ from { opacity: 0; transform: translateY(10px); }
114
+ to { opacity: 1; transform: translateY(0); }
115
+ }
116
+ </style>
117
+ </head>
118
+
119
+ <body>
120
+
121
+ <div class="main">
122
+ <h1>PCOS Prediction</h1>
123
+ <p>Enter Your Health Details</p>
124
+
125
+ <form id="predict-form">
126
+ <!-- Inputs matching your Gradio app -->
127
+ <div class="form-row"><label>Weight</label><input type="text" id="Weight" required /></div>
128
+ <div class="form-row"><label>Height</label><input type="text" id="Height" required /></div>
129
+ <div class="form-row">
130
+ <label>Blood Group</label>
131
+ <select id="BG" required>
132
+ <option value="">-- Select --</option>
133
+ <option value="A+">A+</option><option value="A-">A-</option>
134
+ <option value="B+">B+</option><option value="B-">B-</option>
135
+ <option value="O+">O+</option><option value="O-">O-</option>
136
+ <option value="AB+">AB+</option><option value="AB-">AB-</option>
137
+ </select>
138
+ </div>
139
+ <div class="form-row"><label>BPM</label><input type="text" id="bpm" required /></div>
140
+ <div class="form-row"><label>Respiratory Rate</label><input type="text" id="RR" required /></div>
141
+ <div class="form-row">
142
+ <label>Cycle</label>
143
+ <select id="cycle" required>
144
+ <option value="">-- Select --</option>
145
+ <option value="Regular">Regular</option>
146
+ <option value="Irregular">Irregular</option>
147
+ <option value="Neutral">Neutral</option>
148
+ </select>
149
+ </div>
150
+
151
+ <div class="form-row"><label>Cycle Length</label><input type="text" id="CL" required /></div>
152
+ <div class="form-row"><label>Marraige Status(Years)</label><input type="text" id="MS" required /></div>
153
+ <div class="form-row">
154
+ <label>Pregnant</label>
155
+ <select id="Pregnant" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
156
+ </div>
157
+ <div class="form-row"><label>Abortions</label><input type="text" id="Abortions" required /></div>
158
+ <div class="form-row"><label>Hip Circumference</label><input type="text" id="Hip" required /></div>
159
+ <div class="form-row"><label>Waist Circumference</label><input type="text" id="Waist" required /></div>
160
+ <div class="form-row">
161
+ <label>Weight Gain</label>
162
+ <select id="WG" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
163
+ </div>
164
+ <div class="form-row">
165
+ <label>Hair Growth</label>
166
+ <select id="HG" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
167
+ </div>
168
+ <div class="form-row">
169
+ <label>Hair Loss</label>
170
+ <select id="HL" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
171
+ </div>
172
+ <div class="form-row">
173
+ <label>Pimples</label>
174
+ <select id="Pimples" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
175
+ </div>
176
+ <div class="form-row">
177
+ <label>Fast Food Consumption</label>
178
+ <select id="FF" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
179
+ </div>
180
+ <div class="form-row">
181
+ <label>Regular Exercise</label>
182
+ <select id="RE" required><option value="">-- Select --</option><option value="Yes">Yes</option><option value="No">No</option></select>
183
+ </div>
184
+ <div class="form-row"><label>BP Systolic</label><input type="text" id="BP_Systo" required /></div>
185
+ <div class="form-row"><label>BP Diastolic</label><input type="text" id="BP_Diasto" required /></div>
186
+
187
+ <button type="submit">Predict</button>
188
+ </form>
189
+
190
+ <div id="result" class="result-box"></div>
191
+ </div>
192
+
193
+ <script>
194
+ const form = document.getElementById('predict-form');
195
+ const resultBox = document.getElementById('result');
196
+ form.addEventListener('submit', async function (e) {
197
+ e.preventDefault();
198
+ const formData = {
199
+ Weight: document.getElementById('Weight').value,
200
+ Height: document.getElementById('Height').value,
201
+ BG: document.getElementById('BG').value,
202
+ bpm: document.getElementById('bpm').value,
203
+ RR: document.getElementById('RR').value,
204
+ cycle: document.getElementById('cycle').value,
205
+ CL: document.getElementById('CL').value,
206
+ MS: document.getElementById('MS').value,
207
+ Pregnant: document.getElementById('Pregnant').value,
208
+ Abortions: document.getElementById('Abortions').value,
209
+ Hip: document.getElementById('Hip').value,
210
+ Waist: document.getElementById('Waist').value,
211
+ WG: document.getElementById('WG').value,
212
+ HG: document.getElementById('HG').value,
213
+ HL: document.getElementById('HL').value,
214
+ Pimples: document.getElementById('Pimples').value,
215
+ FF: document.getElementById('FF').value,
216
+ RE: document.getElementById('RE').value,
217
+ BP_Systo: document.getElementById('BP_Systo').value,
218
+ BP_Diasto: document.getElementById('BP_Diasto').value,
219
+ };
220
+ try {
221
+ const res = await fetch('/predict', {
222
+ method: 'POST',
223
+ headers: { 'Content-Type': 'application/json' },
224
+ body: JSON.stringify(formData)
225
+ });
226
+ const data = await res.json();
227
+ resultBox.style.display = 'block';
228
+ if (data.prediction) {
229
+ resultBox.textContent = `Prediction: ${data.prediction}`;
230
+ } else if (data.error) {
231
+ resultBox.textContent = `Error: ${data.error}`;
232
+ }
233
+ } catch (error) {
234
+ resultBox.style.display = 'block';
235
+ resultBox.textContent = "Server error.";
236
+ }
237
+ });
238
+ </script>
239
+ </body>
240
+ </html>