This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let video = document.getElementById("video"); | |
| let model; | |
| // declare a canvas variable and get its context | |
| let canvas = document.getElementById("canvas"); | |
| let ctx = canvas.getContext("2d"); | |
| const setupCamera = () => { | |
| navigator.mediaDevices | |
| .getUserMedia({ | |
| video: { width: 600, height: 400 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Face Detection</title> | |
| </head> | |
| <body> | |
| <h1>Face Detection</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let video = document.getElementById("video"); | |
| let model; // to store the blazeface model | |
| const setupCamera = () => { | |
| navigator.mediaDevices | |
| .getUserMedia({ | |
| video: { width: 600, height: 400 }, | |
| audio: false, | |
| }) | |
| .then((stream) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let video = document.getElementById("video"); | |
| let model; | |
| let canvas = document.getElementById("canvas"); | |
| let ctx = canvas.getContext("2d"); | |
| const setupCamera = () => { | |
| navigator.mediaDevices | |
| .getUserMedia({ | |
| video: { width: 600, height: 400 }, | |
| audio: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let video = document.getElementById("video"); | |
| const setupCamera = () => { | |
| navigator.mediaDevices | |
| .getUserMedia({ | |
| audio: false, | |
| video: { width: 600, height: 400 }, | |
| }) | |
| .then((stream) => { | |
| // stream is a MediaStream object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Face Detection in Browser</title> | |
| </head> | |
| <body> | |
| <h1>Face Detection</h1> | |
| <video id="video" autoplay></video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <queue> | |
| using namespace std; | |
| int main() | |
| { | |
| // declare a queue | |
| queue<int> q; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a queue | |
| q = [] | |
| # Enqueue | |
| q.append(7) | |
| q.append(4) | |
| q.append(10) | |
| # Dequeue | |
| q.pop(0) # Remove from the 0th index, since that is the front of the queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stack> | |
| using namespace std; | |
| int main() | |
| { | |
| // Declare a new stack | |
| stack<int> myStack; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a new stack | |
| stack = [] | |
| # PUSH | |
| stack.append(25) | |
| stack.append(35) | |
| stack.append(45) | |
| print(stack) |
NewerOlder