-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (52 loc) · 1.57 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snake Species Predictor</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f8ff;
}
h1 {
color: #4CAF50;
}
form {
margin-bottom: 20px;
}
#prediction {
font-weight: bold;
color: #333;
}
</style>
</head>
<body>
<h1>Snake Species Predictor</h1>
<form id="predictionForm">
<label for="imageInput">Upload an Image:</label>
<input type="file" id="imageInput" name="image" accept="image/*">
<button type="button" onclick="makePrediction()">Predict</button>
</form>
<h2>Prediction: <span id="prediction"></span></h2>
<script>
async function makePrediction() {
const fileInput = document.getElementById('imageInput');
const file = fileInput.files[0];
const formData = new FormData();
formData.append('file', file);
const response = await fetch('http://127.0.0.1:5000/predict', {
method: 'POST',
body: formData
});
const result = await response.json();
document.getElementById('prediction').innerText = result.output;
}
</script>
</body>
</html>