Skip to content

Commit

Permalink
Add npu option to image classification
Browse files Browse the repository at this point in the history
  • Loading branch information
Honry committed Oct 12, 2023
1 parent 45f9a75 commit 653d27d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions image_classification/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<label class="btn btn-outline-info custom" name="webnn">
<input type="radio" name="backend" id="webnn_cpu" autocomplete="off">WebNN (CPU)
</label>
<label class="btn btn-outline-info custom" name="webnn">
<input type="radio" name="backend" id="webnn_npu" autocomplete="off">WebNN (NPU)
</label>
<label class="btn btn-outline-info custom" name="webnn">
<input type="radio" name="backend" id="webnn_gpu" autocomplete="off">WebNN (GPU)
</label>
Expand Down
2 changes: 1 addition & 1 deletion image_classification/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $(document).ready(async () => {

$('#backendBtns .btn').on('change', async (e) => {
if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
if ($(e.target).attr('id').indexOf('cpu') != -1) {
if ($(e.target).attr('id').indexOf('cpu') != -1 || $(e.target).attr('id').indexOf('npu') != -1) {

Check failure on line 54 in image_classification/main.js

View workflow job for this annotation

GitHub Actions / job (ubuntu-latest)

This line has a length of 99. Maximum allowed is 80

Check failure on line 54 in image_classification/main.js

View workflow job for this annotation

GitHub Actions / job (ubuntu-latest)

This line has a length of 99. Maximum allowed is 80
layout = 'nhwc';
} else if (($(e.target).attr('id').indexOf('gpu') != -1)) {
layout = 'nchw';
Expand Down

0 comments on commit 653d27d

Please sign in to comment.