This file contains 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
mainVideo = container.querySelector("video"); | |
mainVideo.crossOrigin = "anonymous"; | |
var dataURI = canvas.toDataURL('image/jpeg'); | |
ctx.drawImage(mainVideo, 0, 0, canvas.width, canvas.height); |
This file contains 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
class bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKCYAN = '\033[96m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' | |
BOLD = '\033[1m' | |
UNDERLINE = '\033[4m' |
This file contains 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
import glob | |
import xml.etree.ElementTree as ET | |
png_images = glob.glob('<folder_containing_xml>/*.xml') | |
saving_path = '<saving_folder_path>' | |
for i in png_images: | |
print(i) | |
splitted_path = i.split('/') | |
path = '/'.join(splitted_path[:-1]) | |
name_ext = splitted_path[-1] |
This file contains 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
async function createFile(){ | |
let response = await fetch('<video_url>'); | |
let data = await response.blob(); | |
console.log(data) | |
var url = URL.createObjectURL(data); | |
document.getElementById('video-player').src = url; | |
let metadata = { | |
type: 'video/mp4' | |
}; | |
let file = new File([data], "test.jpg", metadata); |
This file contains 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
import cv2 | |
import time | |
import mediapipe as mp | |
class FaceDetector: | |
def __init__(self, minDetectionConf=0.5): | |
self.minDetectionConf = minDetectionConf | |
self.mpFaceDetection = mp.solutions.face_detection | |
self.mpDraw = mp.solutions.drawing_utils | |
self.faceDetection = self.mpFaceDetection.FaceDetection(min_detection_confidence=self.minDetectionConf) |
NewerOlder