Skip to content

Instantly share code, notes, and snippets.

An eroteme is a question mark

Jon Crall Erotemic

An eroteme is a question mark
View GitHub Profile
Erotemic /
Created Dec 24, 2020
Demo auto-generated version of skimage.filters
def lazy_install(module_name, submodules, submod_attrs):
Defines gettr for lazy import via PEP 562
import sys
import importlib
import importlib.util
all_funcs = []
for mod, funcs in submod_attrs.items():
Experiment Script Related to Pytorch Memory Leak Issue
from import Dataset, DataLoader
import numpy as np
import torch
View gist:244890e27b37aa2219ac2f3414f8c302
(py36) joncrall@Ooo:~/code/netharn$ python build
-- Trying "Ninja" generator
Erotemic / gist:1f9b19ad1d116c9731ce7f446f020ce4
Created Feb 9, 2019
cant find numpy error with pip install
View gist:1f9b19ad1d116c9731ce7f446f020ce4
(py36) joncrall@Ooo:~/code/netharn$ ./ clean && pip install -e .
Deleting directory="./__pycache__"
Deleting directory="./_skbuild"
Not deleting non-existant path="./__pycache__/skbuild_pr.cpython-36.pyc"
Obtaining file:///home/joncrall/code/netharn
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: torch in /home/joncrall/.local/conda/envs/py36/lib/python3.6/site-packages (from netharn==0.1.8.dev0) (1.0.0)
Requirement already satisfied: tqdm in /home/joncrall/.local/conda/envs/py36/lib/python3.6/site-packages (from netharn==0.1.8.dev0) (4.23.4)
# -*- coding: utf-8 -*-
This module can be used as both a script and an importable module.
Run `python --help` for more details.
See docstring in fit for more details on the importable module.
conda install opencv
conda install pytorch torchvision -c pytorch
Erotemic /
Last active Dec 19, 2018
The setup_venv3 bash command sets up a python3 virtual environment on a fresh ubuntu install. The file contains quite a few helper functions that make the actual implementation of setup_venv3 rather short.
__heredoc__(){ NOOP=; }
__heredoc__ '''
Check if a python module is installed. Echos "True" or "False" to the
command line depending on the result.
source $HOME/local/init/
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')))
View gist:27f80be9eca982aa51518770b826b6a4
Timer unit: 1e-06 s
Pystone time: 0.026254 s
File: /home/joncrall/code/netharn/netharn/models/yolo2/
Function: _build_targets_tensor at line 382
Line # Hits Time Per Hit % Time Line Contents
382 @profiler.profile
View gist:e6be4658bad9fa28a56bf4e7c516a820
Timer unit: 1e-06 s
Pystone time: 0.05441 s
File: /home/joncrall/code/netharn/netharn/models/yolo2/
Function: _get_boxes at line 202
Line # Hits Time Per Hit % Time Line Contents
202 @profiler.profile