Update templates/index.html
Browse files44 unmodified lines454647484950515253545556575835 unmodified lines94959697989910010110210310410510610710810911011144 unmodified lines</div><div id="prediction-box"><p id="prediction">Prediction: <span id="prediction-text">N/A</span></p><p id="prediction2">Prediction2: <span id="prediction-text2">N/A</span></p></div><button id="switch-camera">Switch Camera</button><script>const video = document.getElementById('video');const predictionElem = document.getElementById('prediction-text');const predictionElem2 = document.getElementById('prediction-text2');const switchCameraBtn = document.getElementById('switch-camera');let useFrontCamera = true; // Start with front-facing camera// Condition to determine which prediction to show35 unmodified lines// Convert the image to base64const imageData = canvas.toDataURL('image/jpeg');fetch('/textis', {method: 'POST',headers: {'Content-Type': 'application/json',},body: JSON.stringify({ image: imageData }),}).then(response => response.json()).then(data => {predictionElem2.textContent = `bool: ${data.prediction}`; // Update vegetable prediction}).catch(err => console.error('Error:', err));if (showVegetablePrediction) {44 unmodified lines45464748495051525354555635 unmodified lines92939495969744 unmodified lines</div><div id="prediction-box"><p id="prediction">Prediction: <span id="prediction-text">N/A</span></p></div><button id="switch-camera">Switch Camera</button><script>const video = document.getElementById('video');const predictionElem = document.getElementById('prediction-text');const switchCameraBtn = document.getElementById('switch-camera');let useFrontCamera = true; // Start with front-facing camera// Condition to determine which prediction to show35 unmodified lines// Convert the image to base64const imageData = canvas.toDataURL('image/jpeg');if (showVegetablePrediction) {
templates/index.html-14