Merge pull request #21 from PaskalSunari/ML-Office-01

Ml office 01
pull/915/head
Paskal Sunari 1 year ago committed by GitHub
commit 292a94518a

@ -7,14 +7,11 @@ const checks = [...document.querySelectorAll('.checkbox')];
checks.forEach(check => { checks.forEach(check => {
check.addEventListener('change', function() { check.addEventListener('change', function() {
// toggle the state of the ingredient
// based on the checkbox's value (1 or 0)
ingredients[check.value] = check.checked ? 1 : 0; ingredients[check.value] = check.checked ? 1 : 0;
}); });
}); });
function testCheckboxes() { function testCheckboxes() {
// validate if at least one checkbox is checked
return checks.some(check => check.checked); return checks.some(check => check.checked);
} }
@ -27,7 +24,6 @@ async function startInference() {
return; return;
} }
try { try {
// create a new session and load the model.
const session = await ort.InferenceSession.create('./model.onnx'); const session = await ort.InferenceSession.create('./model.onnx');

@ -6,7 +6,7 @@
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.9.0/dist/ort.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.9.0/dist/ort.min.js"></script>
</head> </head>
<body> <body>
<!-- Navigation Bar -->
<nav> <nav>
<div class="logo"> <div class="logo">
<a href="#">Cuisine Matcher</a> <a href="#">Cuisine Matcher</a>

Loading…
Cancel
Save