Spaces:
Sleeping
Sleeping
| <html> | |
| <head> | |
| <title>Image Matcher</title> | |
| </head> | |
| <body> | |
| <h2>Upload an Image (Base64 encoded)</h2> | |
| <textarea id="b64input" rows="10" cols="80" placeholder="Paste Base64 image here..."></textarea> | |
| <br><br> | |
| <button onclick="sendImage()">Match Image</button> | |
| <pre id="result"></pre> | |
| <script> | |
| async function sendImage() { | |
| const b64 = document.getElementById("b64input").value.trim(); | |
| if (!b64) { | |
| alert("Please paste a base64 image string"); | |
| return; | |
| } | |
| const res = await fetch("/match", { | |
| method: "POST", | |
| headers: {"Content-Type": "application/json"}, | |
| body: JSON.stringify({images: [b64]}) | |
| }); | |
| const data = await res.json(); | |
| document.getElementById("result").textContent = JSON.stringify(data, null, 2); | |
| } | |
| </script> | |
| </body> | |
| </html> | |