Skip to content

Instantly share code, notes, and snippets.

View DanielTakeshi's full-sized avatar
🎯
Focusing

Daniel Seita DanielTakeshi

🎯
Focusing
View GitHub Profile
import copy, cv2, os, sys, pickle, time
import numpy as np
from os.path import join
TARGET = 'tmp/'
RAW_PICKLE_FILE = 'data_raw_115_items.pkl'
def prepare_data():
"""Create the appropriate data for PyTorch using `ImageFolder`. From:
@DanielTakeshi
DanielTakeshi / processing depth images
Last active March 19, 2020 16:44
Depth Image Processing
"""
For the BAIR Blog post.
(c) 2018 by Daniel Seita (and Michael Laskey).
"""
import numpy as np
import cv2
def depth_to_3ch(img, cutoff):
"""Useful to turn the background into black into the depth images.
@DanielTakeshi
DanielTakeshi / Gist for Plotting A2C
Last active May 2, 2022 23:55
For plotting some A2C results from OpenAI baselines.
"""
Quick script I ran to visualuze some A2C results. Just run `python plot.py` in the same directory
as where the stuff in `files` is located.
"""
import argparse, csv, os, pickle, sys, matplotlib
from os.path import join
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('seaborn-darkgrid')
import numpy as np
@DanielTakeshi
DanielTakeshi / tikz example
Last active January 10, 2017 01:43
An example of using tikz to generate a figure. Use `pdflatex file_name.tex` to compile, where `file_name.tex` is the name of this file. It should create an image directly in the text. Note that the package assumptions are minimal.
\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node (1) [align=center] {$\mathsf{EXPSPACE}$};
\node (2) [align=center, below=3mm of 1] {$\mathsf{MA}_{\mathsf{EXP}}$};