File tree Expand file tree Collapse file tree
facial_landmark_detection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 </ div >
4747 </ div >
4848 </ div >
49- < div class ="row mb-2 align-items-center ">
49+ <!-- < div class="row mb-2 align-items-center">
5050 <div class="col-1 wider-col">
5151 <span>Layout</span>
5252 </div>
6060 </label>
6161 </div>
6262 </div>
63- </ div >
63+ </div> -->
6464 < div class ="row mb-2 align-items-center ">
6565 < div class ="col-1 wider-col ">
6666 < span > FaceRecognition</ span >
Original file line number Diff line number Diff line change @@ -49,8 +49,15 @@ $(document).ready(async () => {
4949 }
5050} ) ;
5151
52- $ ( '#backendBtns .btn' ) . on ( 'change' , async ( ) => {
52+ $ ( '#backendBtns .btn' ) . on ( 'change' , async ( e ) => {
5353 if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
54+ if ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'cpu' ) != - 1 ) {
55+ layout = 'nhwc' ;
56+ } else if ( ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'gpu' ) != - 1 ) ) {
57+ layout = 'nchw' ;
58+ } else {
59+ throw new Error ( 'Unknown backend' ) ;
60+ }
5461 await main ( ) ;
5562} ) ;
5663
@@ -60,11 +67,11 @@ $('#fdModelBtns .btn').on('change', async (e) => {
6067 await main ( ) ;
6168} ) ;
6269
63- $ ( '#layoutBtns .btn' ) . on ( 'change' , async ( e ) => {
64- layout = $ ( e . target ) . attr ( 'id' ) ;
65- if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
66- await main ( ) ;
67- } ) ;
70+ // $('#layoutBtns .btn').on('change', async (e) => {
71+ // layout = $(e.target).attr('id');
72+ // if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
73+ // await main();
74+ // });
6875
6976// Click trigger to do inference with <img> element
7077$ ( '#img' ) . click ( async ( ) => {
Original file line number Diff line number Diff line change 4646 </ div >
4747 </ div >
4848 </ div >
49- < div class ="row mb-2 align-items-center ">
49+ <!-- < div class="row mb-2 align-items-center">
5050 <div class="col-1 wider-col">
5151 <span>Layout</span>
5252 </div>
6060 </label>
6161 </div>
6262 </div>
63- </ div >
63+ </div> -->
6464 < div class ="row mb-2 align-items-center ">
6565 < div class ="col-1 wider-col ">
6666 < span > FacialLandmark</ span >
Original file line number Diff line number Diff line change @@ -45,8 +45,15 @@ $(document).ready(async () => {
4545 }
4646} ) ;
4747
48- $ ( '#backendBtns .btn' ) . on ( 'change' , async ( ) => {
48+ $ ( '#backendBtns .btn' ) . on ( 'change' , async ( e ) => {
4949 if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
50+ if ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'cpu' ) != - 1 ) {
51+ layout = 'nhwc' ;
52+ } else if ( ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'gpu' ) != - 1 ) ) {
53+ layout = 'nchw' ;
54+ } else {
55+ throw new Error ( 'Unknown backend' ) ;
56+ }
5057 await main ( ) ;
5158} ) ;
5259
@@ -56,11 +63,11 @@ $('#fdModelBtns .btn').on('change', async (e) => {
5663 await main ( ) ;
5764} ) ;
5865
59- $ ( '#layoutBtns .btn' ) . on ( 'change' , async ( e ) => {
60- layout = $ ( e . target ) . attr ( 'id' ) ;
61- if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
62- await main ( ) ;
63- } ) ;
66+ // $('#layoutBtns .btn').on('change', async (e) => {
67+ // layout = $(e.target).attr('id');
68+ // if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
69+ // await main();
70+ // });
6471
6572// Click trigger to do inference with <img> element
6673$ ( '#img' ) . click ( async ( ) => {
Original file line number Diff line number Diff line change 4646 </ div >
4747 </ div >
4848 </ div >
49- < div class ="row mb-2 align-items-center ">
49+ <!-- < div class="row mb-2 align-items-center">
5050 <div class="col-1 col-md-1">
5151 <span>Layout</span>
5252 </div>
6060 </label>
6161 </div>
6262 </div>
63- </ div >
63+ </div> -->
6464 < div class ="row align-items-center ">
6565 < div class ="col col-md-1 ">
6666 < span > Model</ span >
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ $(document).ready(async () => {
5151
5252$ ( '#backendBtns .btn' ) . on ( 'change' , async ( e ) => {
5353 if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
54+ if ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'cpu' ) != - 1 ) {
55+ layout = 'nhwc' ;
56+ } else if ( ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'gpu' ) != - 1 ) ) {
57+ layout = 'nchw' ;
58+ } else {
59+ throw new Error ( 'Unknown backend' ) ;
60+ }
5461 await main ( ) ;
5562} ) ;
5663
@@ -60,11 +67,11 @@ $('#modelBtns .btn').on('change', async (e) => {
6067 await main ( ) ;
6168} ) ;
6269
63- $ ( '#layoutBtns .btn' ) . on ( 'change' , async ( e ) => {
64- layout = $ ( e . target ) . attr ( 'id' ) ;
65- if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
66- await main ( ) ;
67- } ) ;
70+ // $('#layoutBtns .btn').on('change', async (e) => {
71+ // layout = $(e.target).attr('id');
72+ // if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
73+ // await main();
74+ // });
6875
6976// Click trigger to do inference with <img> element
7077$ ( '#img' ) . click ( async ( ) => {
Original file line number Diff line number Diff line change 4646 </ div >
4747 </ div >
4848 </ div >
49- < div class ="row mb-2 align-items-center ">
49+ <!-- < div class="row mb-2 align-items-center">
5050 <div class="col-1 col-md-1">
5151 <span>Layout</span>
5252 </div>
6060 </label>
6161 </div>
6262 </div>
63- </ div >
63+ </div> -->
6464 < div class ="row mb-2 align-items-center ">
6565 < div class ="col-1 col-md-1 ">
6666 < span > Model</ span >
Original file line number Diff line number Diff line change @@ -47,8 +47,15 @@ $(window).on('load', () => {
4747 loadRenderUI ( ) ;
4848} ) ;
4949
50- $ ( '#backendBtns .btn' ) . on ( 'change' , async ( ) => {
50+ $ ( '#backendBtns .btn' ) . on ( 'change' , async ( e ) => {
5151 if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
52+ if ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'cpu' ) != - 1 ) {
53+ layout = 'nhwc' ;
54+ } else if ( ( $ ( e . target ) . attr ( 'id' ) . indexOf ( 'gpu' ) != - 1 ) ) {
55+ layout = 'nchw' ;
56+ } else {
57+ throw new Error ( 'Unknown backend' ) ;
58+ }
5259 await main ( ) ;
5360} ) ;
5461
@@ -58,11 +65,11 @@ $('#modelBtns .btn').on('change', async (e) => {
5865 await main ( ) ;
5966} ) ;
6067
61- $ ( '#layoutBtns .btn' ) . on ( 'change' , async ( e ) => {
62- layout = $ ( e . target ) . attr ( 'id' ) ;
63- if ( inputType === 'camera' ) utils . stopCameraStream ( rafReq , stream ) ;
64- await main ( ) ;
65- } ) ;
68+ // $('#layoutBtns .btn').on('change', async (e) => {
69+ // layout = $(e.target).attr('id');
70+ // if (inputType === 'camera') utils.stopCameraStream(rafReq, stream);
71+ // await main();
72+ // });
6673
6774// Click trigger to do inference with <img> element
6875$ ( '#img' ) . click ( async ( ) => {
You can’t perform that action at this time.
0 commit comments