t e s t
test1
test2
#include <napi.h> | |
class Foo : public Napi::ObjectWrap<Foo> { | |
public: | |
// ... | |
Napi::Value foo(const Napi::CallbackInfo& info) { | |
Napi::Env env = info.Env(); | |
Napi::Function consoleLog = env.Global().Get("console").As<Napi::Object>().Get("log").As<Napi::Function>(); | |
consoleLog.Call({ Napi::String::New(env, "Hello, World.") }); |
require 'magro' | |
require 'torch' | |
require 'torchvision' | |
require 'annoy' | |
# @param src [Numo::NArray] (shape: [height, width, channel]) 入力画像 | |
def preprocessing(src) | |
# 画像の中心を正方形に切り出す. | |
height, width, = src.shape | |
img_size = [height, width].min |
require 'magro' | |
require 'json' | |
require 'torch' | |
require 'torchvision' | |
# 学習済みのVGG-16 Networkを読み込む. | |
vgg = TorchVision::Models::VGG16.new | |
vgg.load_state_dict(Torch.load('vgg16_.pth')) | |
# 画像を読み込む. |
t e s t
test1
test2