Skip to content

Instantly share code, notes, and snippets.

View tatsy's full-sized avatar
:octocat:
Render the possibility!

Tatsuya Yatagawa tatsy

:octocat:
Render the possibility!
View GitHub Profile
@tatsy
tatsy / vec3.py
Last active July 29, 2016 08:58
Python Vec3
import math
class Vec(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
@staticmethod
def dot(v1, v2):
@tatsy
tatsy / diffusion.py
Last active August 12, 2016 22:23
Diffusion approximation
import math
import numpy as np
import matplotlib.pyplot as plt
class Color(object):
def __init__(self, r = 0.0, g = 0.0, b = 0.0):
if not isinstance(r, float) or \
not isinstance(g, float) or \
not isinstance(b, float):
raise Exception('Bad arguments!!')
@tatsy
tatsy / scholar.py
Last active February 2, 2018 07:20
Download open access paper from Google Scholar
import os
import sys
import re
import argparse
import urllib.parse
import urllib.request
import requests
from bs4 import BeautifulSoup
BasedOnStyle: Google
IndentWidth: 4
AccessModifierOffset: -4
IndentCaseLabels: false
AlignConsecutiveAssignments: false
AlignTrailingComments: true
BinPackArguments: true
DerivePointerAlignment: false
@tatsy
tatsy / ..Orinent2D..
Last active September 9, 2019 07:18
Orientation detection filter
Calculate edge orientation for digital images.
@tatsy
tatsy / mp4_compress.py
Created January 5, 2020 04:44
Compress image sequence into MP4 video
#!/usr/bin/python
import os
import argparse
import cv2
def is_image_file(filename):
""" Check whether the file name sounds like an image """
image_extensions = ['.jpg', '.jpeg', '.png', '.bmp', '.tiff', '.tif']
_, ext = os.path.splitext(filename)
@tatsy
tatsy / t2_voxel_down_sample.py
Created December 22, 2020 02:01
t2_voxel_down_sample
import os
import sys
import argparse
import numpy as np
import open3d as o3d
sys.path.append('./tools/python_toolbox/evaluation')
# Tau value for each scene in Table 1 of the paper.
@tatsy
tatsy / metropolis.ipynb
Last active January 4, 2022 01:39
Metropolis Hastings method
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tatsy
tatsy / simuanneal.ipynb
Created January 4, 2022 01:38
Metropolis Hastings with simulated annealing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tatsy
tatsy / gibbs.ipynb
Last active January 4, 2022 02:22
Gibbs sampling
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.