First of all install update and upgrade your system:
$ sudo apt update
$ sudo apt upgrade
Then, install required libraries:
| #include <ctype.h> | |
| #include <errno.h> | |
| #include <libgen.h> | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <signal.h> | |
| #include <time.h> | |
| #include <unistd.h> |
| lines = open('/proc/meminfo', 'r').read().split('\n') | |
| def get_mem_free(): | |
| for line in lines: | |
| if 'MemFree' in line: | |
| return int(line.split(':')[1].strip().split(' ')[0]) | |
| def transposeMatrix(m): | |
| return list(map(list,zip(*m))) |
| import boto3 | |
| import collections | |
| import time | |
| import sys | |
| from datetime import datetime, timedelta | |
| myAccount = boto3.client('sts').get_caller_identity()['Account'] | |
| def lambda_handler(event, context): |
| // g++ -O3 -std=c++11 -o ps_boilerplate mic.cpp \ | |
| -DMODELDIR=\"`pkg-config --variable=modeldir pocketsphinx`\" \ | |
| `pkg-config --cflags --libs pocketsphinx sphinxbase` | |
| #include <iostream> | |
| #include <string> | |
| #include <pocketsphinx.h> | |
| #include <sphinxbase/ad.h> | |
| #include <sphinxbase/err.h> | |
| using namespace std; |
| #include "rpiPWM1.h" | |
| //Need to do this to be able to access these constants | |
| //Private constants | |
| const int rpiPWM1::BCM2708_PERI_BASE; | |
| const int rpiPWM1::PWM_BASE;/* PWM controller */ | |
| const int rpiPWM1::CLOCK_BASE; /* Clock controller */ | |
| const int rpiPWM1::GPIO_BASE; /* GPIO controller */ | |
| const int rpiPWM1::PWM_CTL ; | |
| const int rpiPWM1::PWM_RNG1; |
| import os | |
| import pickle | |
| import json | |
| import random | |
| import csv | |
| import cv2 | |
| import numpy as np | |
| from keras.preprocessing.image import ImageDataGenerator |
| # Image Tensor | |
| images_placeholder = tf.placeholder(tf.float32, shape=[None, 32, 32, 3], name='x') | |
| gray = tf.image.rgb_to_grayscale(images_placeholder, name='gray') | |
| gray /= 255. | |
| # Label Tensor | |
| labels_placeholder = tf.placeholder(tf.float32, shape=(None, 43), name='y') |
| # all imports | |
| import time | |
| import pickle | |
| import csv | |
| import operator | |
| from itertools import groupby | |
| import cv2 | |
| import numpy as np | |
| import tensorflow as tf |
| # Dockerfile to setup opencv 3.1.0 for use outside of Jupyter Notebook | |
| FROM ubuntu:16.04 | |
| #2.7 | |
| ENV PYTHON_VERSION 2.7 | |
| ENV NUM_CORES 4 | |
| # Install OpenCV 3.1 | |
| RUN apt-get -y update | |
| RUN apt-get -y install python$PYTHON_VERSION-dev wget unzip \ |