Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Satoshi Terasaki terasakisatoshi

🏠
Working from home
View GitHub Profile
View Lz.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@terasakisatoshi
terasakisatoshi / torchloader.jl
Last active Jun 3, 2022
Torch: DataLoader, DLpack, PyCall
View torchloader.jl
using PyCall
using ProgressMeter
using DLPack
py"""
import torch
from tqdm import tqdm
# just in case
# https://github.com/pytorch/pytorch/issues/11201
@terasakisatoshi
terasakisatoshi / Manifest.toml
Last active May 18, 2022
Training FlowerPhoto dataset using PyCallChainRule.jl
View Manifest.toml
# This file is machine-generated - editing it directly is not advised
julia_version = "1.7.2"
manifest_format = "2.0"
[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.1.0"
@terasakisatoshi
terasakisatoshi / photo_flower.jl
Last active Jun 12, 2022
アーニャ,Flux.jl 頑張るます
View photo_flower.jl
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .jl
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
@terasakisatoshi
terasakisatoshi / flower_photo.py
Last active Jun 1, 2022
ディープ何もわからん
View flower_photo.py
import numpy as np
import os
from glob import glob
import torch
import torch.nn as nn
from tqdm import tqdm
from PIL import Image
import imageio
import torchvision
@terasakisatoshi
terasakisatoshi / montyhall.jl
Last active May 6, 2022
ヤギは引きたくないんじゃ
View montyhall.jl
using Random
using StaticArrays
function selectrest(i::T, j::T) where T <: Integer
(i, j) == (T(1), T(2)) && return T(3)
(i, j) == (T(2), T(1)) && return T(3)
(i, j) == (T(2), T(3)) && return T(1)
(i, j) == (T(3), T(2)) && return T(1)
View QuartzGetWindow.jl
module QuartzGetWindow
export screensize, getActiveWindow, getWindowGeometry
include("CG_const.jl")
using Libdl
const CFArrayRef = Ptr{Cvoid}
const CFDictionaryRef = Ptr{Cvoid}
View estimate_camera_pose_part1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View estimate_camera_pose_part2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@terasakisatoshi
terasakisatoshi / star.jl
Last active Mar 5, 2022
お星様 matplotlib animation
View star.jl
# Jupyter Notebook で実行してください
# https://qiita.com/yoku_/items/11ac4ad1df349095655c の Python 実装が
# https://gist.github.com/genkuroki/f1480db0c035d4cb82d1d5ec6989b05d?short_path=c1a52fb
# によって Julia によって移植され, 下記の実装は Julia 1.7 版です.
using PyPlot
using PyCall
anim = pyimport("matplotlib.animation")
t = range(0, stop=6π, length=60)