This file contains hidden or 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
#ifndef SRC_COMMON_H_ | |
#define SRC_COMMON_H_ | |
#include <stdint.h> | |
/* common return code */ | |
#define RET_OK 0x00000000 | |
#define RET_NO_DATA 0x00000001 | |
#define RET_TIMEOUT 0x00000002 | |
#define RET_ERR 0x80000001 |
This file contains hidden or 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> | |
int main() | |
{ | |
int a; | |
int ret; | |
extern int func1(int *a); | |
ret = func1(&a); | |
printf("ret = %d, a = %d\n", ret, a); | |
} |
This file contains hidden or 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
LIBRARY tensorflow | |
EXPORTS | |
??0?$MaybeStackArray@D$0CI@@icu_62@@AEAA@AEBV01@@Z | |
??0?$MaybeStackArray@D$0CI@@icu_62@@QEAA@$$QEAV01@@Z | |
??0?$MaybeStackArray@D$0CI@@icu_62@@QEAA@H@Z | |
??0?$MaybeStackArray@D$0CI@@icu_62@@QEAA@XZ | |
??0Appendable@icu_62@@QEAA@AEBV01@@Z | |
??0Appendable@icu_62@@QEAA@XZ | |
??0BreakIterator@icu_62@@IEAA@AEBV01@@Z | |
??0BreakIterator@icu_62@@IEAA@AEBVLocale@1@0@Z |
This file contains hidden or 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
(tf_test01) ~/Desktop/win_share/CNN_NumberDetector/02_Tensorflow_Python$ conda list | |
# packages in environment at /home/tak/anaconda3/envs/tf_test01: | |
# | |
# Name Version Build Channel | |
_tflow_select 2.3.0 mkl | |
absl-py 0.7.0 py36_0 | |
astor 0.7.1 py36_0 | |
blas 1.0 mkl | |
bzip2 1.0.6 h14c3975_5 | |
c-ares 1.15.0 h7b6447c_1 |
This file contains hidden or 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) | |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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( |