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
### System update and install minimum tools ### | |
sudo apt -y update | |
sudo apt -y upgrade | |
sudo apt -y install nano python-pip | |
sudo -H pip install -U jetson-stats | |
### Install other libs ### | |
sudo apt -y install ffmpeg libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libavresample-dev | |
sudo apt -y install libvorbis-dev libxvidcore-dev libx264-dev libxvidcore-dev | |
sudo apt -y install libgtk2.0-dev libgtk-3-dev |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# On Git Bash | |
cd path-to-tensorflow | |
git checkout 00cb358ab2e67d0b06a21901ded13c57fd47e673 | |
./tensorflow/lite/tools/make/download_dependencies.sh | |
nano tensorflow/lite/build_def.bzl | |
### | |
# --- a/tensorflow/lite/build_def.bzl | |
# +++ b/tensorflow/lite/build_def.bzl | |
# @@ -159,6 +159,7 @@ def tflite_cc_shared_object( |
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
# Preparation | |
sudo yum upgrade | |
sudo yum -y groupinstall "Development Tools" | |
sudo yum install -y wget autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel gtk3 gtk3-devel | |
sudo yum install -y git gcc bzip2 bzip2-devel openssl openssl-devel readline readline-devel sqlite-devel | |
sudo yum install -y cmake libjpeg-devel libtiff-devel libpng-devel jasper-devel | |
sudo yum install -y mesa-libGL-devel libXt-devel libgphoto2-devel nasm libtheora-devel | |
sudo yum install -y autoconf automake gcc-c++ libtool yasm openal-devel blas blas-devel atlas atlas-devel lapack lapack-devel | |
sudo yum install -y tbb-devel |
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
### バージョンチェック ### | |
python3 | |
import cv2 | |
cv2.__version__ | |
print(cv2.getBuildInformation()) | |
### 依存パッケージのインストール ### | |
# 古いイメージだと、1回目のupdateでエラーが出るかも。気にせずupgradeして、再度update,upgradesudo する | |
sudo apt update |
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
# -*- coding: utf-8 -*- | |
import cv2 | |
import tensorflow as tf | |
import numpy as np | |
# https://www.tensorflow.org/lite/guide/hosted_models | |
# http://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip | |
def detect_from_camera(): |
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
#include <stdio.h> | |
#include <opencv2/opencv.hpp> | |
using namespace cv; | |
void save(const char *filename, const unsigned char * data, int size) | |
{ | |
FILE *fp = fopen(filename, "wb"); | |
fwrite(data, size, 1, fp); | |
fclose(fp); |
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 | |
with tf.Session() as sess: | |
with tf.gfile.GFile('conv_mnist.pb', 'rb') as f: | |
graph_def = tf.GraphDef() | |
graph_def.ParseFromString(f.read()) | |
g_in = tf.import_graph_def(graph_def) | |
train_writer = tf.summary.FileWriter('logs') | |
train_writer.add_graph(sess.graph) | |
NewerOlder