GDDO commited on
Commit
aeee05d
·
verified ·
1 Parent(s): be8f209

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -58
index.html DELETED
@@ -1,58 +0,0 @@
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>Python + HTML Inference</title>
7
- <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- display: flex;
11
- flex-direction: column;
12
- align-items: center;
13
- justify-content: center;
14
- height: 100vh;
15
- }
16
- input {
17
- margin: 10px;
18
- }
19
- #result {
20
- margin-top: 20px;
21
- font-size: 20px;
22
- font-weight: bold;
23
- }
24
- </style>
25
- </head>
26
- <body>
27
- <h1>Upload an Image for Inference</h1>
28
- <input type="file" id="imageUploader" accept="image/*">
29
- <p id="result">Upload an image to start inference.</p>
30
- <script>
31
- document.getElementById('imageUploader').addEventListener('change', async (event) => {
32
- const file = event.target.files[0];
33
- if (file) {
34
- const formData = new FormData();
35
- formData.append('file', file);
36
-
37
- document.getElementById('result').textContent = "Processing...";
38
- try {
39
- const response = await fetch('http://localhost:5000/predict', {
40
- method: 'POST',
41
- body: formData
42
- });
43
- const result = await response.json();
44
- if (result.error) {
45
- document.getElementById('result').textContent = "Error: " + result.error;
46
- } else {
47
- document.getElementById('result').textContent =
48
- `Class: ${result.class} (Confidence: ${result.confidence.toFixed(2)}%)`;
49
- }
50
- } catch (error) {
51
- document.getElementById('result').textContent = "Error communicating with the server.";
52
- console.error("Error:", error);
53
- }
54
- }
55
- });
56
- </script>
57
- </body>
58
- </html>