import { useState } from 'react' import axios from 'axios' import './App.css' export default function App() { const [param1, setParam1] = useState('') const [param2, setParam2] = useState('') const [result, setResult] = useState(null) const [loading, setLoading] = useState(false) const [error, setError] = useState('') const handleSubmit = async (e) => { e.preventDefault() setLoading(true) setError('') setResult(null) try { const response = await axios.post('/api/predict/', { param1: parseFloat(param1), param2: parseFloat(param2) }) setResult(response.data) } catch (err) { setError('Error during material identification.') console.error(err) } finally { setLoading(false) } } return (

Material Identification: Talc

Based on SciANN and Hugging Face

Input Parameters

setParam1(e.target.value)} required />
setParam2(e.target.value)} required />
{error &&

{error}

} {result && (

Result

Material: {result.material}

Confidence: {(result.confidence * 100).toFixed(2)}%

{result.properties && (

Predicted Properties

Stress: {result.properties.stress.toFixed(4)}

Strain: {result.properties.strain.toFixed(4)}

)}
)}
) }