Skip to content

Instantly share code, notes, and snippets.

@iwatake2222
iwatake2222 / common.h
Last active February 5, 2018 13:16
ZYBO (Zynq) でHDMI出力をする ref: https://qiita.com/take-iwiw/items/b323e129f96426031f9f
#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
@iwatake2222
iwatake2222 / call.c
Last active April 11, 2018 23:40
ARMアセンブリ言語の実装色々とNEON命令のサンプル ref: https://qiita.com/take-iwiw/items/cea0a2cb4d2709cb7ee5
#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);
}
@iwatake2222
iwatake2222 / tensorflow.def
Created March 6, 2019 05:35
tensorflow.def 1.12 for Visual Studio 2017
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
@iwatake2222
iwatake2222 / Linux用.txt
Created March 8, 2019 15:31
Deep Learningアプリケーション開発_Anaconda環境
(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
@iwatake2222
iwatake2222 / create_graph_for_tensorboard.py
Created May 3, 2019 13:48
TensorFlowモデル(pb)の構造を見る
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)
@iwatake2222
iwatake2222 / conv.cpp
Last active April 11, 2022 03:26
OpenCV色フォーマット変換(BGR,YUV420, NV12)
#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);
@iwatake2222
iwatake2222 / detection_PC.py
Last active April 16, 2025 11:10
Object detection using MobileNet SSD with tensorflow lite (with and without Edge TPU)
# -*- 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():
@iwatake2222
iwatake2222 / install_opencv_raspberry_pi3.py
Last active December 8, 2019 13:03
install_opencv_raspberry_pi
### バージョンチェック ###
python3
import cv2
cv2.__version__
print(cv2.getBuildInformation())
### 依存パッケージのインストール ###
# 古いイメージだと、1回目のupdateでエラーが出るかも。気にせずupgradeして、再度update,upgradesudo する
sudo apt update
@iwatake2222
iwatake2222 / install_opencv_centos7.sh
Last active September 9, 2019 15:28
Installing OpenCV4 on Cent OS 7 (AWS)
# 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
@iwatake2222
iwatake2222 / Build_tensorflowlite.dll_.sh
Last active January 17, 2022 10:34
How to generate tensorflowlite.dll for Visual Studio (Windows)
# 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(