Skip to content

Instantly share code, notes, and snippets.

View shnhrtkyk's full-sized avatar
🏠
Working from home

teddy shnhrtkyk

🏠
Working from home
View GitHub Profile
@shnhrtkyk
shnhrtkyk / JIT_compile.py
Last active February 18, 2020 08:18
pytorchのモデルをJITでコンパイル
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from models import modelName
import numpy as np
import cv2
@shnhrtkyk
shnhrtkyk / PytorchModel.cpp
Created February 18, 2020 08:23
Pytorch C++ API のやつ
#include <iostream>
#include "PytorchModel.h"
PytorchModel::PytorchModel()
{
}
/**
@shnhrtkyk
shnhrtkyk / PytorchModel.h
Created February 18, 2020 08:25
Pytorch C++ APIのやつ
#pragma once
#include <torch/script.h> // One-stop header.
#include <iostream>
#include <memory>
#include <ATen/ATen.h>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
@shnhrtkyk
shnhrtkyk / main.cpp
Created February 18, 2020 08:26
Pytorch C++ APIのメイン
#include <torch/script.h> // One-stop header.
#include <iostream>
#include <memory>
#include <ATen/ATen.h>
#include "PytorchModel.h"
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
@shnhrtkyk
shnhrtkyk / pscp.bat
Created March 5, 2020 05:09
pscpでWin - Ubuntu間のファイル移動
psscp.exe -r -pw PASSWORD /local/path/data user@IPadress:/path/to/dir/
@shnhrtkyk
shnhrtkyk / plink.bat
Created March 5, 2020 05:11
plinkを使ったUbuntuマシンへのコマンド送信
@shnhrtkyk
shnhrtkyk / model.py
Created May 26, 2023 01:59
FWNet architecture using pytorch
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 17 08:04:29 2019
@author: shino
"""
from __future__ import print_function
import torch
import torch.nn as nn