Skip to content

Instantly share code, notes, and snippets.

View model_load.py
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 train_model_save.py
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 cudatest.cu
#include <stdio.h>
#include <iostream>
#include <time.h>
// GPUで計算する際の関数
__global__ void gpu_function(float *d_x, float *d_y)
{
int i = blockIdx.x * blockDim.x + threadIdx.x;
d_y[i] = sin(d_x[i]) * sin(d_x[i]) + cos(d_x[i]) * cos(d_x[i]);
}
View colors.txt
0 255 0
0 0 255
255 0 0
0 255 255
255 255 0
255 0 255
80 70 180
250 80 190
245 145 50
70 150 250
View test.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
View TrainAlexnet.py
import numpy as np
import keras
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.layers.core import Dense, Dropout, Activation, Flatten
from sklearn.model_selection import train_test_split
from PIL import Image
import glob
from keras.preprocessing.image import load_img, img_to_array
View loadPCDfile.cpp
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/io/pcd_io.h>
#include <iostream>
using namespace std;
// ビューワー起動時の一回だけ呼ばれる
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(0.2, 0.2, 0.2);
cout << "viewerOneOff" << std::endl;
View savePCLFile.cpp
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/io/pcd_io.h>
#include <iostream>
using namespace std;
// ビューワー起動時の一回だけ呼ばれる
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(0.2, 0.2, 0.2);
cout << "viewerOneOff" << std::endl;
View PCLtestSource1.cpp
#include <pcl/visualization/cloud_viewer.h>
#include <iostream>
using namespace std;
// ビューワー起動時の一回だけ呼ばれる
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(0.2, 0.2, 0.2);
cout << "viewerOneOff" << std::endl;
}
View OpenGL_3d_display.cpp
/* ------------------------------------------------------
     基本図形による3D描画の実施
--------------------------------------------------------*/
#include <GL/glut.h>
#include <iostream>
// 描画処理が必要なときに呼ばれる
void display(void)
{