Skip to content

Instantly share code, notes, and snippets.

Aaron Markham aaronmarkham

Block or report user

Report or block aaronmarkham

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
View nano inference notes
https://cdn-images-1.medium.com/max/800/1*x5lnmcK-PvjDeXZAfMEsRQ.jpeg
@aaronmarkham
aaronmarkham / inception_predict.py
Created Feb 14, 2019
prediction example (from wine_detector on raspberry pi tutorial)
View inception_predict.py
# inception_predict.py
import mxnet as mx
import numpy as np
import cv2, os, urllib
from collections import namedtuple
Batch = namedtuple('Batch', ['data'])
# Load the symbols for the networks
with open('synset.txt', 'r') as f:
View gist:b3d0c715abca92ccc4b79ed0f19d1916
Requirements:
Raspberry Pi 3B with Stretch.
If you have an existing installation, it must be upgraded to Stretch.
Follow these directions to upgrade: https://www.datenreise.de/en/raspberry-pi-raspbian-update-update-jessie-to-stretch/
Format your SD card with SD Card Formatter.
Download, unzip, then copy contents of the NOOBS (network install) zip file to SD card.
Boot up the Pi and follow the prompts to install the headless Raspbian.
Login to the pi with user `pi` and password `raspberry`.
View install-template.md

Installation Instructions for MXNet-$binding on $OS

The following guide will help you install MXNet-$binding on $OS.

Prerequisites

The following are required prerequisites:

  1. Install $prerequisite:
@aaronmarkham
aaronmarkham / gluon-export-model
Created Jan 30, 2018
shows a problem with exporting then importing a model in gluon
View gluon-export-model
import mxnet as mx
from mxnet.test_utils import download
from mxnet.gluon.model_zoo import vision as models
gpus = 0
contexts = [mx.gpu(i) for i in range(gpus)] if gpus > 0 else [mx.cpu()]
deep_dog_net = models.squeezenet1_1(prefix='deep_dog_', classes=2)
deep_dog_net.collect_params().initialize(ctx=contexts)
download('https://apache-mxnet.s3-accelerate.amazonaws.com/gluon/models/deep-dog-5a342a6f.params',
@aaronmarkham
aaronmarkham / alexnet_codes
Created Apr 4, 2017
This list of codes is useful for looking up results from a neural network trained on AlexNet
View alexnet_codes
{
0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
View gist:dcdb284065c9ea4569214bcb0ca3a858
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([[-0.7635088 ],
[-0.24276257]], dtype=float32), gc=, dc=[])
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([[ 0. , 1. ],
[ 0.20600842, -0.92744243]], dtype=float32), gc=, dc=[])
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([ 0.22169138, -0. , 0. , 0. ], dtype=float32), gc=, dc=[])
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([-0.], dtype=float32), gc=, dc=[])
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([ 0.], dtype=float32), gc=, dc=[])
Trying example: test_relu(self=<__main__.TestRelu testMethod=test_relu>, X=array([[-0.28297934],
[ 0.20971532],
[ 0. ]], dtype=float32), gc=, dc=[])
You can’t perform that action at this time.