Skip to content

Instantly share code, notes, and snippets.

View dalequark's full-sized avatar
🪂 slacking

Dale Markowitz dalequark

🪂 slacking
View GitHub Profile
dalequark / objecttracker.js
Created June 18, 2021 21:11
Simple object tracker
View objecttracker.js
function huntForPets(monitoredItem, detectionArray, target) {
// naughtyAnimals is an array that keeps track of each animal are in frame
var naughtyAnimals = [];
// Loop through all of the objects recognized by the API
for (let i = 0; i < detectionArray.length; i++) {
// If we found one of the objects we were looking for...
if (detectionArray[i].class === target && detectionArray[i].score > MIN_DETECTION_CONFIDENCE) {
// Draw a bounding box on screen
dalequark / bbox_distance.js
Created June 17, 2021 21:43
bbox distance
View bbox_distance.js
class BBox {
constructor(bbox) {
let x = bbox[0];
let y = bbox[1];
this.width = bbox[2];
this.height = bbox[3];
this.midX = x + this.width / 2;
this.midY = y + this.height / 2;
dalequark / webcam_obj_detection.html
Last active June 18, 2021 23:34
Webcam object detection
View webcam_obj_detection.html
<!-- Load TensorFlow.js. This is required to use coco-ssd model. -->
<script src=""> </script>
<!-- Load the coco-ssd model. -->
<script src=""> </script>
// Grab DOM reference to video element.
const video = document.getElementById('webcamVideo');
dalequark / stt_api_output.json
Created February 2, 2021 23:07
View stt_api_output.json
"transcript": "Software developers. We're not known for our Rock and style. Are we or are we today? I'll show you how I use ml to make new trendier taking inspiration from influencers. I'm going to build an app that analyzes my closet and pictures of fashionable influencers and then makes me outfit recommendations. If I'm missing an important piece will also recommend me products to buy let me show you how",
"words": [
"word": "Software",
"start_time": 0.2,
"end_time": 0.6,
"speaker_tag": 0
dalequark /
Created December 1, 2020 22:18
Spreadsheet NLP on GCP
* Copyright 2020 Google LLC
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
def canAddItem(existingArray, newType):
bottoms = {"pants", "skirt", "shorts", "dress"}
newType = newType.lower()
if newType in existingArray:
return False
if newType == "shoe":
return True
if newType in bottoms and len(bottoms.intersection(existingArray)):
return False
if newType == "top" and "dress" in existingArray:
dalequark / rtt2
Created August 6, 2020 00:06
View rtt2
sudo apt-get update && sudo apt-get install -y git python3-dev python3-pygame python3-venv libatlas-base-dev libasound2-dev python3-pyaudio
sudo cp /usr/share/alsa/alsa.conf /usr/share/alsa/alsa.conf.orig
dalequark / rtt1
Last active August 6, 2020 00:05
View rtt1
echo "deb [signed-by=/usr/share/keyrings/] cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
curl | sudo apt-key --keyring /usr/share/keyrings/ add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
View dalessickgist
echo "deb [signed-by=/usr/share/keyrings/] cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
View gist:a21006ad5e4b3754813ecb5da6a4edb9
echo "deb [signed-by=/usr/share/keyrings/] cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list