File size: 850 Bytes
f26fba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<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>