Skip to content

Instantly share code, notes, and snippets.

View Erotemic's full-sized avatar
An eroteme is a question mark

Jon Crall Erotemic

An eroteme is a question mark
View GitHub Profile
@Erotemic
Erotemic / scale_space.py
Last active October 14, 2018 21:38
scale space
import scipy
import scipy.ndimage
import numpy as np
import ubelt as ub
def g(f, s, **kw):
"""
Apply a gaussian filter to an input signal
def benchmark_pandas():
import timerit
import pandas as pd
import numpy as np
column_data = {
key: np.random.rand(1000)
for key in map(chr, range(ord('a'), ord('z')))
}
Timer unit: 1e-06 s
Pystone time: 0.026254 s
File: /home/joncrall/code/netharn/netharn/models/yolo2/light_region_loss.py
Function: _build_targets_tensor at line 382
Line # Hits Time Per Hit % Time Line Contents
==============================================================
382 @profiler.profile
Timer unit: 1e-06 s
Pystone time: 0.05441 s
File: /home/joncrall/code/netharn/netharn/models/yolo2/light_postproc.py
Function: _get_boxes at line 202
Line # Hits Time Per Hit % Time Line Contents
==============================================================
202 @profiler.profile
Timer unit: 1e-06 s
Pystone time: 0.034663 s
File: /home/joncrall/code/netharn/netharn/models/yolo2/light_postproc.py
Function: _clip_boxes at line 139
Line # Hits Time Per Hit % Time Line Contents
==============================================================
139 @profiler.profile
# This is the CMakeCache file.
# For build in directory: /home/joncrall/code/caffe2/build_py3
# It was generated by CMake: /home/joncrall/.local/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
@Erotemic
Erotemic / bench.py
Created February 5, 2018 03:28
benchmark code
import ubelt as ub
import numpy as np
from PIL import Image
import six
import cv2
from clab.augment import augment_common
from clab.util import imutil
from clab import util
try:
import skimage
@Erotemic
Erotemic / output_shape_for.py
Created November 20, 2017 21:54
Output shape information for pytorch
import math
import torch
import torch.nn as nn
import torchvision
REGISTERED_OUTPUT_SHAPE_TYPES = []
def compute_type(type):
def _wrap(func):
@Erotemic
Erotemic / gist:cb14439beefa8ad61695c9f819f0839b
Created October 30, 2017 17:21
Output of serial fletch make
This file has been truncated, but you can view the full file.
(venv2) joncrall@calculex:~/code/fletch/build-py2-test$ make
Scanning dependencies of target PyBind11
[ 0%] Creating directories for 'PyBind11'
[ 0%] Performing download step (download, verify and extract) for 'PyBind11'
-- verifying file...
file='/home/joncrall/code/fletch/Downloads/pybind11-2.2.0.tar.gz'
-- File already exists and hash match (skip download):
file='/home/joncrall/code/fletch/Downloads/pybind11-2.2.0.tar.gz'
MD5='978b26aea1c6bfc4f88518ef33771af2'
-- extracting...
#!/bin/bash
codeblock()
{
if [ "-h" == "$1" ] || [ "--help" == "$1" ]; then
# Use codeblock to show the usage of codeblock, so you can use
# codeblock while you codeblock.
echo "$(codeblock '
Unindents code before its executed so you can maintain a pretty
indentation in your code file. Multiline strings simply begin