Skip to content

Instantly share code, notes, and snippets.


Daniel Seita DanielTakeshi

Block or report user

Report or block DanielTakeshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DanielTakeshi /
Last active May 12, 2019
Exception Testing in Python
"""Some exception testing.
The code in the `try` block will stop as soon as any exception is encountered.
a = 5
View gist:bae674deb74bced22fdc3ca39c4fe3aa
I am testing different PyTorch transforms on my data, and saving sample
images as they are loaded during training. See examples below.
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision.models as models
from torchvision import datasets, transforms
import copy, cv2, os, sys, pickle, time
import numpy as np
from os.path import join
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 / processing depth images
Last active Nov 13, 2018
Depth Image Processing
View processing depth images
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 / Gist for Plotting A2C
Last active Jul 7, 2019
For plotting some A2C results from OpenAI baselines.
View Gist for Plotting A2C
Quick script I ran to visualuze some A2C results. Just run `python` in the same directory
as where the stuff in `files` is located.
import argparse, csv, os, pickle, sys, matplotlib
from os.path import join
import matplotlib.pyplot as plt'seaborn-darkgrid')
import numpy as np
DanielTakeshi / tikz example
Last active Jan 10, 2017
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.
View tikz example
\node (1) [align=center] {$\mathsf{EXPSPACE}$};
\node (2) [align=center, below=3mm of 1] {$\mathsf{MA}_{\mathsf{EXP}}$};
You can’t perform that action at this time.