Skip to content

Commit

Permalink
Add threads in filters demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksazh committed Nov 8, 2019
1 parent cc00fc4 commit 58374d5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion samples/faceDetection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ function initUI() {
});

enableThreads();
}

// Event listener for dowscale parameter.
let downscaleLevelInput = document.getElementById('downscaleLevel');
Expand Down
5 changes: 5 additions & 0 deletions samples/filters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@
<label id="hideStatsLabel" class="hidden" for="hideStats">Hide statistics</label>
<input id="hideStats" class="hidden" type="checkbox" checked>
</div>

<div class="threads-control centered hidden">
<label for="threadsNum" id="threadsNumLabel"></label>
<input type="number" id="threadsNum" min="1" max="16">
</div>
</div>
<video id="videoInput" class="hidden"></video>

Expand Down
2 changes: 2 additions & 0 deletions samples/filters/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ function initUI() {
utils.stopCamera();
utils.startCamera(videoConstraint, 'videoInput', startVideoProcessing);
});

enableThreads();
}

function setFilter(filter) {
Expand Down
1 change: 0 additions & 1 deletion samples/funnyHats/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ function initUI() {
});

enableThreads();
}

// Event listener for dowscale parameter.
let downscaleLevelInput = document.getElementById('downscaleLevel');
Expand Down
1 change: 0 additions & 1 deletion utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ function addButtonToCameraBar(id, text, maxItems) {

function enableThreads() {
if (!isMobileDevice()) {
// Init threads number.
let threadsControl = document.getElementsByClassName('threads-control')[0];
threadsControl.classList.remove('hidden');
let threadsNumLabel = document.getElementById('threadsNumLabel');
Expand Down

0 comments on commit 58374d5

Please sign in to comment.