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) |
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 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
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
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
# pip install onvif-zeep | |
# import package | |
import requests | |
from onvif import ONVIFCamera | |
# create onvif camera object | |
cam_obj = ONVIFCamera(CAMERA_HOST, CAMERA_PORT, CAMERA_USER, CAMERA_PASS) | |
# create media service |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<!-- Bootstrap CSS --> | |
<link | |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" |
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 json | |
import boto3 | |
import random | |
from botocore.vendored import requests | |
def random_url(plen=10, ucfirst=True, spchar=True): | |
if plen >= 6 and plen % 2 != 0: | |
plen = plen+1 | |
elif plen < 8: | |
return None, 'length too small' |
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 json | |
import boto3 | |
def lambda_handler(event, context): | |
page_name = event['queryStringParameters']['page'] | |
cover_name = event['queryStringParameters']['cover'] | |
print(page_name) | |
ssm_client = boto3.client('ssm') |
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 json | |
import boto3 | |
def lambda_handler(event, context): | |
page_name = event['queryStringParameters']['page'] | |
page_start_time = event['queryStringParameters']['starttime'] | |
print(page_name) | |
print(page_start_time) | |
OlderNewer