Fossil Classifier

Upload a Fossil Image

Classify





<script> async function classifyImage() { const fileInput = document.getElementById(‘imageInput’); const file = fileInput.files[0]; if (!file) { alert(“Please select an image file first.”); return; } const formData = new FormData(); formData.append(‘file’, file); const resultsElement = document.getElementById(‘results’); resultsElement.textContent = “Classifying image…”; try { // IMPORTANT: Replace with your actual domain and endpoint const response = await fetch(‘https://appalachianrockarts.com/classify’, { method: ‘POST’, body: formData }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); resultsElement.textContent = JSON.stringify(data, null, 2); } catch (error) { resultsElement.textContent = “Error: ” + error.message; console.error(“Error:”, error); } } </script>