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
import tensorflow as tf | |
if not str(tf.__version__).startswith('1.15'): | |
print('please use tensorflow 1.15') | |
exit() | |
from tensorflow.keras.models import Model | |
from tensorflow.keras.layers import Input, Conv2D | |
tf.enable_eager_execution() | |
image_shape = (64,64,3) |
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
import os | |
import argparse | |
import cv2 | |
import numpy as np | |
import sys | |
import time | |
import importlib.util | |
from tflite_runtime.interpreter import Interpreter | |
from tflite_runtime.interpreter import load_delegate |
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
# MAKE THIS DOCKERFILE | |
FROM ubuntu:20.04 | |
ENV TZ=US/Central | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
WORKDIR /home | |
ENV HOME /home | |
VOLUME /data | |
EXPOSE 8888 |
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
I got librosa working on the Dev Board running Mendel Day (4.0). | |
Some steps may not be necessary at later OS release. | |
1) Preparations: | |
The Dev Board may not have enough storage, so I suggest first to add an sdcard (I have a 16GB card), than mount it: | |
mkdir /home/mendel/sdcard | |
sudo mount /dev/mmcblk1p1 /home/mendel/sdcard | |
With extra storage now, we can add some swap which may be necessary for the build: |
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
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "fsl,imx8mq-hdmi"; | |
fragment@0 { | |
target-path = "/hdmi@32c00000"; | |
__overlay__ { | |
status = "disabled"; |
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
FROM ubuntu:18.04 | |
WORKDIR /home | |
ENV HOME /home | |
RUN cd ~ | |
RUN apt-get update | |
RUN apt-get install -y git nano python3-pip python-dev pkg-config wget usbutils curl | |
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" \ | |
| tee /etc/apt/sources.list.d/coral-edgetpu.list |
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
# This is an example of starting a systemd object detection service on boot on the Coral Dev Board. | |
# 1) create a file call detects.service with the following contents: | |
[Unit] | |
Description=systemd object detection service | |
After=weston.target | |
[Service] | |
PAMName=login |
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
FROM arm64v8/debian:latest | |
WORKDIR /home | |
ENV HOME /home | |
RUN cd ~ | |
RUN apt-get update | |
RUN apt-get install -y git nano python3-pip python-dev pkg-config wget usbutils curl | |
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" \ | |
| tee /etc/apt/sources.list.d/coral-edgetpu.list |
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
# Install tflite_runtime package to evaluate the model. | |
!pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-linux_x86_64.whl | |
# Now we do evaluation on the tflite model. | |
import os | |
import numpy as np | |
from tflite_runtime.interpreter import Interpreter | |
from tflite_runtime.interpreter import load_delegate | |
from PIL import Image | |
from PIL import ImageDraw |
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
THIS IS DEPRECATED | |
# docker can be installed on the dev board following these instructions: | |
# https://github.com/f0cal/google-coral/issues/32#issuecomment-571629174 | |
# 1) create this dockerfile | |
# 2) build: docker build -t "coral" . | |
# 3) run: docker run -it --device /dev/apex_0:/dev/apex_0 coral /bin/bash | |
# 4) Try the classify_image demo: | |
# apt-get install edgetpu-examples |
NewerOlder