lobe / web-bootstrap

Bootstrap your Lobe machine learning model with our web starter project.
https://lobe.ai
MIT License
74 stars 31 forks source link

PredictionEntry not show predicted confidence values #23

Closed amyou2005 closed 3 years ago

amyou2005 commented 3 years ago

How to show confidence value on "PredictionEntry"

Answer:

return (
        <div key={label} className="prediction-entry">
            {label} {!!confidence ? (confidence*100).toFixed(1) +"%" : "0.0%"}
            {!!confidence ?
                <div
                    className={"prediction-bar" + (top ? " prediction-green" : "")}
                    style={{width: (confidence*100).toString() + "%"}} />
            : null}
        </div>
    );