-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
74 lines (62 loc) · 2.65 KB
/
index.html
File metadata and controls
74 lines (62 loc) · 2.65 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vegetable Image Predictor</title>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest/dist/tf.min.js"></script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
<nav class="navbar">
<div class="logo">
<span class="logo-icon">🍃</span>
<span>Vegetable Image Predictor</span>
</div>
</nav>
<main class="container">
<div class="header-text">
<h1>What vegetable is this?</h1>
<p>Upload an image to identify the vegetable. Our AI will analyze the image and tell you what it is.</p>
</div>
<div class="upload-area" id="drop-area">
<div class="icon-upload">
<i class="fas fa-cloud-upload-alt"></i>
</div>
<h3>Drag & Drop Image or Click to Browse</h3>
<p>Please upload a valid image file (JPG, PNG).</p>
<input type="file" id="image-upload" accept="image/*" hidden>
<button class="btn-secondary" onclick="document.getElementById('image-upload').click()">Upload File</button>
</div>
<div id="preview-container" class="hidden">
<img id="image-preview" src="#" alt="Preview">
<button id="btn-predict" class="btn-primary">Predict Vegetable</button>
</div>
<div id="loading" class="hidden">
<div class="spinner"></div>
<p>Analyzing your vegetable...</p>
</div>
<div id="result-card" class="result-card hidden">
<div class="result-image">
<img id="result-img-display" src="" alt="Result">
</div>
<div class="result-info">
<span class="label">It looks like a...</span>
<h2 id="prediction-name">Tomato</h2>
<p id="prediction-desc">Probability: <span id="prediction-score">99%</span></p>
<button class="btn-text" onclick="location.reload()">Try another image</button>
</div>
</div>
<div id="error-card" class="error-card hidden">
<div class="error-icon">!</div>
<h3>Prediction Failed</h3>
<p>Sorry, we couldn't identify this vegetable. Please ensure it's a clear photo.</p>
</div>
</main>
<footer>
© 2025 Reynard Adimas N. All Rights Reserved.
</footer>
<script src="script.js"></script>
</body>
</html>