Update script.js
Browse files
script.js
CHANGED
|
@@ -37,12 +37,13 @@ async function captureAndSendImage() {
|
|
| 37 |
|
| 38 |
try {
|
| 39 |
const response = await fetch('https://your-space-name.hf.space/api/recognize_pose', {
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
if (!response.ok) {
|
| 48 |
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
| 37 |
|
| 38 |
try {
|
| 39 |
const response = await fetch('https://your-space-name.hf.space/api/recognize_pose', {
|
| 40 |
+
method: 'POST',
|
| 41 |
+
headers: {
|
| 42 |
+
'Content-Type': 'application/json',
|
| 43 |
+
},
|
| 44 |
+
body: JSON.stringify({ image: image })
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
|
| 48 |
if (!response.ok) {
|
| 49 |
throw new Error(`HTTP error! status: ${response.status}`);
|