Skip to content

Instantly share code, notes, and snippets.

Alasdair Allan aallan

Block or report user

Report or block aallan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aallan
aallan / benchmark_xnor.py
Created May 23, 2019
Benchmarking script for the Xnor Platform SDK on the Raspberry Pi
View benchmark_xnor.py
#!/usr/bin/env python3
import sys
import os
import logging as log
import argparse
import subprocess
from timeit import default_timer as timer
from PIL import Image
@aallan
aallan / benchmark_tf_lite.py
Created May 8, 2019
benchmarking script for TensorFlow Lite on the Raspberry Pi
View benchmark_tf_lite.py
#!/usr/bin/env python3
import tensorflow as tf
import sys
import os
import logging as log
import argparse
import subprocess
from timeit import default_timer as timer
@aallan
aallan / benchmark_edgetpu.py
Last active May 7, 2019
Benchmarking script for TensorFlow Lite on EdgeTPU-based hardware
View benchmark_edgetpu.py
#!/usr/bin/env python3
import platform
PLATFORM = platform.system().lower()
GOOGLE = 'edge_tpu'
INTEL = 'ncs2'
NVIDIA = 'jetson_nano'
PI = 'raspberry_pi'
IS_LINUX = (PLATFORM == 'linux')
@aallan
aallan / benchmark_intel_ncs.py
Created Apr 26, 2019
Benchmarking script for OpenVINO IR inferencing with the Intel Neural Compute Stick
View benchmark_intel_ncs.py
#!/usr/bin/env python3
import platform
PLATFORM = platform.system().lower()
GOOGLE = 'edge_tpu'
INTEL = 'ncs2'
NVIDIA = 'jetson_nano'
PI = 'raspberry_pi'
IS_LINUX = (PLATFORM == 'linux')
@aallan
aallan / benchmark_tf_trt.py
Created Apr 26, 2019
Benchmarking script for TensorFlow + TensorRT inferencing on the NVIDIA Jetson Nano
View benchmark_tf_trt.py
#!/usr/bin/env python3
import platform
PLATFORM = platform.system().lower()
GOOGLE = 'edge_tpu'
INTEL = 'ncs2'
NVIDIA = 'jetson_nano'
PI = 'raspberry_pi'
IS_LINUX = (PLATFORM == 'linux')
@aallan
aallan / benchmark_tf.py
Created Apr 26, 2019
Benchmarking script for TensorFlow inferencing on Raspberry Pi, Darwin, and NVIDIA Jetson Nano
View benchmark_tf.py
#!/usr/bin/env python3
import platform
PLATFORM = platform.system().lower()
GOOGLE = 'edge_tpu'
INTEL = 'ncs2'
NVIDIA = 'jetson_nano'
PI = 'raspberry_pi'
MAC = 'darwin'
IS_LINUX = (PLATFORM == 'linux')
@aallan
aallan / coco_labels.txt
Created Apr 22, 2019
Labels for the Mobilenet v2 SSD model trained with the COCO (2018/03/29) dataset.
View coco_labels.txt
1 person
2 bicycle
3 car
4 motorcycle
5 airplane
6 bus
7 train
8 truck
9 boat
10 traffic light
@aallan
aallan / CMakeLists.txt
Last active Apr 15, 2019
A CMakeList.txt file for the NVIDIA Jetson Nano object_recognition.cpp example, https://gist.github.com/aallan/4de3a74676d4ff10a476c2d6c20b9255
View CMakeLists.txt
# require CMake 2.8 or greater
cmake_minimum_required(VERSION 2.8)
# declare my-recognition project
project(object_recognition)
# import jetson-inference and jetson-utils packages.
# note that if you didn't do "sudo make install"
# while building jetson-inference, this will error.
find_package(jetson-utils)
@aallan
aallan / object_recognition.cpp
Last active Apr 15, 2019
Obejct recognition example code for the NVIDIA Jetson Nano.
View object_recognition.cpp
// Object Recognition example code from NVIDIA
// See https://github.com/dusty-nv/jetson-inference/blob/master/examples/my-recognition/my-recognition.cpp
#include <jetson-inference/imageNet.h>
#include <jetson-utils/loadImage.h>
int main( int argc, char** argv ){
if( argc < 2 ) {
printf("object_recognition: expected image filename as argument\n");
printf("example usage: ./object_recognition image.jpg\n");
@aallan
aallan / throttled.sh
Last active Jun 10, 2019
Script to parse the output of the 'vcgencmd get_throttled' command on a Raspberry Pi
View throttled.sh
#!/bin/bash
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling
#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
HAS_UNDERVOLTED=0x10000
HAS_CAPPED=0x20000
You can’t perform that action at this time.