Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Layout options #182

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions face_recognition/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
</div>
</div>
<div class="row mb-2 align-items-center">
<!-- <div class="row mb-2 align-items-center">
<div class="col-1 wider-col">
<span>Layout</span>
</div>
Expand All @@ -60,7 +60,7 @@
</label>
</div>
</div>
</div>
</div> -->
<div class="row mb-2 align-items-center">
<div class="col-1 wider-col">
<span>FaceRecognition</span>
Expand Down
19 changes: 13 additions & 6 deletions face_recognition/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ $(document).ready(async () => {
}
});

$('#backendBtns .btn').on('change', async () => {
$('#backendBtns .btn').on('change', async (e) => {
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
if ($(e.target).attr('id').indexOf('cpu') != -1) {
layout = 'nhwc';
} else if (($(e.target).attr('id').indexOf('gpu') != -1)) {
layout = 'nchw';
} else {
throw new Error('Unknown backend');
}
await main();
});

Expand All @@ -60,11 +67,11 @@ $('#fdModelBtns .btn').on('change', async (e) => {
await main();
});

$('#layoutBtns .btn').on('change', async (e) => {
layout = $(e.target).attr('id');
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
await main();
});
// $('#layoutBtns .btn').on('change', async (e) => {
// layout = $(e.target).attr('id');
// if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
// await main();
// });

// Click trigger to do inference with <img> element
$('#img').click(async () => {
Expand Down
4 changes: 2 additions & 2 deletions facial_landmark_detection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
</div>
</div>
<div class="row mb-2 align-items-center">
<!-- <div class="row mb-2 align-items-center">
<div class="col-1 wider-col">
<span>Layout</span>
</div>
Expand All @@ -60,7 +60,7 @@
</label>
</div>
</div>
</div>
</div> -->
<div class="row mb-2 align-items-center">
<div class="col-1 wider-col">
<span>FacialLandmark</span>
Expand Down
19 changes: 13 additions & 6 deletions facial_landmark_detection/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ $(document).ready(async () => {
}
});

$('#backendBtns .btn').on('change', async () => {
$('#backendBtns .btn').on('change', async (e) => {
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
if ($(e.target).attr('id').indexOf('cpu') != -1) {
layout = 'nhwc';
} else if (($(e.target).attr('id').indexOf('gpu') != -1)) {
layout = 'nchw';
} else {
throw new Error('Unknown backend');
}
await main();
});

Expand All @@ -56,11 +63,11 @@ $('#fdModelBtns .btn').on('change', async (e) => {
await main();
});

$('#layoutBtns .btn').on('change', async (e) => {
layout = $(e.target).attr('id');
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
await main();
});
// $('#layoutBtns .btn').on('change', async (e) => {
// layout = $(e.target).attr('id');
// if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
// await main();
// });

// Click trigger to do inference with <img> element
$('#img').click(async () => {
Expand Down
4 changes: 2 additions & 2 deletions image_classification/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
</div>
</div>
<div class="row mb-2 align-items-center">
<!-- <div class="row mb-2 align-items-center">
<div class="col-1 col-md-1">
<span>Layout</span>
</div>
Expand All @@ -60,7 +60,7 @@
</label>
</div>
</div>
</div>
</div> -->
<div class="row align-items-center">
<div class="col col-md-1">
<span>Model</span>
Expand Down
17 changes: 12 additions & 5 deletions image_classification/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ $(document).ready(async () => {

$('#backendBtns .btn').on('change', async (e) => {
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
if ($(e.target).attr('id').indexOf('cpu') != -1) {
layout = 'nhwc';
} else if (($(e.target).attr('id').indexOf('gpu') != -1)) {
layout = 'nchw';
} else {
throw new Error('Unknown backend');
}
await main();
});

Expand All @@ -60,11 +67,11 @@ $('#modelBtns .btn').on('change', async (e) => {
await main();
});

$('#layoutBtns .btn').on('change', async (e) => {
layout = $(e.target).attr('id');
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
await main();
});
// $('#layoutBtns .btn').on('change', async (e) => {
// layout = $(e.target).attr('id');
// if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
// await main();
// });

// Click trigger to do inference with <img> element
$('#img').click(async () => {
Expand Down
4 changes: 2 additions & 2 deletions semantic_segmentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
</div>
</div>
<div class="row mb-2 align-items-center">
<!-- <div class="row mb-2 align-items-center">
<div class="col-1 col-md-1">
<span>Layout</span>
</div>
Expand All @@ -60,7 +60,7 @@
</label>
</div>
</div>
</div>
</div> -->
<div class="row mb-2 align-items-center">
<div class="col-1 col-md-1">
<span>Model</span>
Expand Down
19 changes: 13 additions & 6 deletions semantic_segmentation/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ $(window).on('load', () => {
loadRenderUI();
});

$('#backendBtns .btn').on('change', async () => {
$('#backendBtns .btn').on('change', async (e) => {
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
if ($(e.target).attr('id').indexOf('cpu') != -1) {
layout = 'nhwc';
} else if (($(e.target).attr('id').indexOf('gpu') != -1)) {
layout = 'nchw';
} else {
throw new Error('Unknown backend');
}
await main();
});

Expand All @@ -58,11 +65,11 @@ $('#modelBtns .btn').on('change', async (e) => {
await main();
});

$('#layoutBtns .btn').on('change', async (e) => {
layout = $(e.target).attr('id');
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
await main();
});
// $('#layoutBtns .btn').on('change', async (e) => {
// layout = $(e.target).attr('id');
// if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
// await main();
// });

// Click trigger to do inference with <img> element
$('#img').click(async () => {
Expand Down