Skip to content

Instantly share code, notes, and snippets.

View 408881465's full-sized avatar
🏠
Working from home

408881465

🏠
Working from home
View GitHub Profile
@408881465
408881465 / ESP32-Cam Pixel Downsampling
Created May 21, 2020 23:05 — forked from litamin/ESP32-Cam Pixel Downsampling
ESP32-Cam Pixel Downsampling - read out downsampled RGB pixels pretty pretty fast!
// Code based on BITLUNI's ESP32-cam work
// the size you want to downsample to
int newWidth = 40;
int newHeight = 30;
int DSF = 160 / newWidth; // Down Sampling Factor - ideally DSF should be 4, 8 or 16.. so that the bitshifting happening below is accurate
void downSample(unsigned char *frame)
{
@408881465
408881465 / WebResourceResponse.java
Created February 26, 2020 08:18 — forked from chethann/WebResourceResponse.java
Sample code of WebResourceResponse to load WebView resources from local assets!
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
String resourceUrl = request.getUrl().toString();
String fileExtension = WebviewResourceMappingHelper.getInstance().getFileExt(resourceUrl);
if(WebviewResourceMappingHelper.getInstance().getOverridableExtensions().contains(fileExtension)){
String encoding = "UTF-8";
String assetName = WebviewResourceMappingHelper.getInstance().getLocalAssetPath(resourceUrl);
if (StringUtils.isNotEmpty(assetName)) {
String mimeType = WebviewResourceMappingHelper.getInstance().getMimeType(fileExtension);
if (StringUtils.isNotEmpty(mimeType)) {
@408881465
408881465 / WebResourceResponse.java
Created February 26, 2020 08:18 — forked from chethann/WebResourceResponse.java
Sample code of WebResourceResponse to load WebView resources from local assets!
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
String resourceUrl = request.getUrl().toString();
String fileExtension = WebviewResourceMappingHelper.getInstance().getFileExt(resourceUrl);
if(WebviewResourceMappingHelper.getInstance().getOverridableExtensions().contains(fileExtension)){
String encoding = "UTF-8";
String assetName = WebviewResourceMappingHelper.getInstance().getLocalAssetPath(resourceUrl);
if (StringUtils.isNotEmpty(assetName)) {
String mimeType = WebviewResourceMappingHelper.getInstance().getMimeType(fileExtension);
if (StringUtils.isNotEmpty(mimeType)) {
@408881465
408881465 / draw.js
Created February 23, 2020 12:33 — forked from mohdsanadzakirizvi/draw.js
PoseNet demo with Ml5.js
function draw() {
image(video, 0, 0, width, height);
// We can call both functions to draw all keypoints and the skeletons
drawKeypoints();
drawSkeleton();
}
# Code adapted from Tensorflow Object Detection Framework
# https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb
# Tensorflow Object Detection Detector
import numpy as np
import tensorflow as tf
import cv2
import time
@408881465
408881465 / xbee.ino
Created April 2, 2019 23:27 — forked from bgentry/xbee.ino
XBee ZigBee HA interaction, Arduino example
/**
This is an implementation of Zigbee device communication using an XBee
and a Centralite Smart Switch 4256050-ZHAC
dave (www.desert-home.com)
source: http://www.desert-home.com/2014/10/zigbee-protocol-xbee-but-this-time.html
*/
// This code will handle both a Uno and a Mega2560 by careful use of
// the defines. I tried it on both of them, and the only problem is that