Update index.html
Browse files- index.html +27 -13
index.html
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html
|
| 3 |
<head>
|
| 4 |
-
<
|
| 5 |
-
<
|
| 6 |
</head>
|
| 7 |
<body>
|
| 8 |
-
<
|
| 9 |
-
<form
|
| 10 |
-
<label for="front">Front Image:</label>
|
| 11 |
-
<input type="file" name="front" accept="image/*" required><br><br>
|
| 12 |
-
|
| 13 |
<label for="gender">Gender:</label>
|
| 14 |
-
<select
|
| 15 |
-
<option value="
|
| 16 |
-
<option value="
|
| 17 |
</select><br><br>
|
| 18 |
-
|
| 19 |
-
<button type="
|
| 20 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
</body>
|
| 22 |
</html>
|
| 23 |
|
| 24 |
|
|
|
|
|
|
| 1 |
+
<!-- index.html -->
|
| 2 |
<!DOCTYPE html>
|
| 3 |
+
<html>
|
| 4 |
<head>
|
| 5 |
+
<title>SMPL Measurement</title>
|
| 6 |
+
<meta charset="UTF-8" />
|
| 7 |
</head>
|
| 8 |
<body>
|
| 9 |
+
<h1>SMPL Measurement App</h1>
|
| 10 |
+
<form id="measure-form">
|
|
|
|
|
|
|
|
|
|
| 11 |
<label for="gender">Gender:</label>
|
| 12 |
+
<select id="gender" name="gender">
|
| 13 |
+
<option value="female">Female</option>
|
| 14 |
+
<option value="male">Male</option>
|
| 15 |
</select><br><br>
|
| 16 |
+
<!-- Additional inputs for shape or vertices -->
|
| 17 |
+
<button type="button" onclick="submitMeasurement()">Measure</button>
|
| 18 |
</form>
|
| 19 |
+
<div id="results"></div>
|
| 20 |
+
<script>
|
| 21 |
+
async function submitMeasurement() {
|
| 22 |
+
const gender = document.getElementById('gender').value;
|
| 23 |
+
// Example payload: only gender (model will use default shape)
|
| 24 |
+
const payload = { gender: gender, betas: [], measures: ['height','chest','waist'] };
|
| 25 |
+
const response = await fetch('/measure', {
|
| 26 |
+
method: 'POST',
|
| 27 |
+
headers: { 'Content-Type': 'application/json' },
|
| 28 |
+
body: JSON.stringify(payload)
|
| 29 |
+
});
|
| 30 |
+
const data = await response.json();
|
| 31 |
+
document.getElementById('results').innerText = JSON.stringify(data, null, 2);
|
| 32 |
+
}
|
| 33 |
+
</script>
|
| 34 |
</body>
|
| 35 |
</html>
|
| 36 |
|
| 37 |
|
| 38 |
+
|