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
//Debounce in js example: | |
function debounce(func, timeout = 300){ | |
let timer; | |
return (...args) => { | |
clearTimeout(timer); | |
timer = setTimeout(() => { func.apply(this, args); }, timeout); | |
}; | |
} | |
function saveInput(){ | |
console.log('Saving data'); |
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> | |
<meta charset="utf-8"> | |
<title>Tree Example</title> | |
<style> | |
.node { |
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
//Set up Image and video uploaders: | |
window.addEventListener('load', async function() { | |
//Image loader: | |
imageUploadButton.addEventListener('change', async function() { | |
if (videoDownloadLink) videoDownloadLink.remove(); | |
if (this.files && this.files[0]) { |
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
<head> | |
<title>Create Gif</title> | |
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> |
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
//Initate Tesseract model using worker: | |
//Glob variable OCR worker: | |
const worker = Tesseract.createWorker({ | |
logger: m => console.log(m) | |
}); | |
Tesseract.setLogging(true); |
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 detectTFMOBILE(imgToPredict) { | |
//Get next video frame: | |
//Perform OCR: | |
if (Analyzef) | |
{ | |
c.getContext('2d').drawImage(canvas, click_pos.x, click_pos.y, | |
captureSize.w, captureSize.h, 0, 0, captureSize.w, captureSize.h); | |
let tempMark = MarkAreaSimple(mouse_pos.x - captureSize.w / 2, mouse_pos.y - captureSize.h / 2, captureSize.w, captureSize.h); |
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> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Scatter Chart</title> | |
<link href="styles.css" rel="stylesheet" /> |
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
export default async function handler(request, response) { | |
const https = require('https'); | |
let query = Object.entries(request.query); | |
query.shift(); | |
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
#run detector on test image | |
#it takes a little longer on the first run and then runs at normal speed. | |
import random | |
#Define utility functions for presenting the results: | |
def load_image_into_numpy_array(path): | |
"""Load an image from file into a numpy array. | |
Puts image into numpy array to feed into tensorflow graph. | |
Note that by convention we put it into a numpy array with shape | |
(height, width, channels), where channels=3 for RGB. |
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
#Recover our saved model with the latest checkpoint: | |
pipeline_config = pipeline_file | |
#Put the last ckpt from training in here, don't use long pathnames: | |
model_dir = '/content/training/ckpt-2' | |
configs = config_util.get_configs_from_pipeline_file(pipeline_config) | |
model_config = configs['model'] | |
detection_model = model_builder.build( | |
model_config=model_config, is_training=False) | |
# Restore last checkpoint |
NewerOlder