View train_model_save.py
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 numpy as np | |
from keras.utils import np_utils | |
from keras.models import Sequential | |
from sklearn.model_selection import train_test_split | |
import glob | |
from keras.preprocessing.image import load_img, img_to_array | |
from keras.initializers import TruncatedNormal, Constant | |
from keras.layers import Dropout, Flatten, Conv2D, MaxPooling2D, Dense, BatchNormalization | |
from keras.optimizers import SGD |
View model_load.py
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 numpy as np | |
from keras.models import model_from_json | |
from keras.preprocessing.image import load_img, img_to_array | |
# ------------------------------------------------------------------------------------- | |
# モデルの読み込み部 | |
# ------------------------------------------------------------------------------------- | |
# 入力画像サイズ - 訓練時の画像サイズと合わせる | |
INPUT_IMAGE_SIZE = 224 |
View image_divider.cpp
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 <opencv2/opencv.hpp> | |
#include <iostream> | |
int main(int argc, char* argv[]) { | |
int col_num = 11; // 列方向の分割数 | |
int row_num = 7; // 行方向の分割数 | |
cv::Mat input_image = cv::imread("test1.jpg"); // 分割する画像の取得 | |
if (input_image.empty() == true) { |
View lbp.cpp
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 <opencv2/opencv.hpp> | |
#include <ctime> | |
std::string input_image_name = "test.jpg"; | |
int lbp_weights[8] = {128, 64, 32, 16, 8, 4, 2, 1}; | |
int main(int argc, char* argv[]) { | |
// 入力画像の取得 |
View device.cu
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
__global__ void convertToGray(uchar3 *color_pixel, unsigned char* gray_pixel) { | |
int ID = blockIdx.x*blockDim.x + threadIdx.x; | |
// カラーからグレースケール変換を実施 | |
gray_pixel[ID] = | |
(unsigned char)(0.299f*color_pixel[ID].x | |
+ 0.587f*(float)color_pixel[ID].y | |
+ 0.114f*(float)color_pixel[ID].z); | |
} |
View exec.bat
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
ffmpeg -safe 0 -f concat -i movielists.txt -c copy output.mp4 |
View client.cpp
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
// クライアント側 WinSock2 | |
#include <stdio.h> | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#include <iostream> | |
int main() { | |
char server_ip_addr[32]; |
View optical_flow.cpp
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 <opencv2/opencv.hpp> | |
#include <opencv2/superres/optical_flow.hpp> | |
int main(int argc, char* argv[]) | |
{ | |
// オプティカルフローの計算手法の決定 | |
//cv::Ptr<cv::superres::DenseOpticalFlowExt> opticalFlow = cv::superres::createOptFlow_Farneback(); // Franeback | |
cv::Ptr<cv::superres::DenseOpticalFlowExt> opticalFlow = cv::superres::createOptFlow_DualTVL1(); // TVL1 | |
// Optical Flowを計算する前後2フレームを保存するMat |
View colortest.tex
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
\documentclass{article} | |
\usepackage{color} | |
\begin{document} | |
\section*{Color test} | |
\textcolor{red}{test} | |
\textcolor{blue}{test} | |
\textcolor{magenta}{test} |
View colortest2.tex
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
\documentclass{article} | |
\usepackage{color} | |
\begin{document} | |
\section*{Color test} | |
\textcolor{red}{test} | |
\textcolor{blue}{test} | |
\textcolor{magenta}{test} |