Skip to content

Instantly share code, notes, and snippets.

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 },
<!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>
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) => {
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,
let video = document.getElementById("video");
const setupCamera = () => {
navigator.mediaDevices
.getUserMedia({
audio: false,
video: { width: 600, height: 400 },
})
.then((stream) => {
// stream is a MediaStream object
<!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>
#include <iostream>
#include <queue>
using namespace std;
int main()
{
// declare a queue
queue<int> q;
# 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
#include <iostream>
#include <stack>
using namespace std;
int main()
{
// Declare a new stack
stack<int> myStack;
# Create a new stack
stack = []
# PUSH
stack.append(25)
stack.append(35)
stack.append(45)
print(stack)