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 / gist:1f9b19ad1d116c9731ce7f446f020ce4
Created February 9, 2019 17:41
cant find numpy error with pip install
(py36) joncrall@Ooo:~/code/netharn$ ./setup.py 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 ggr_matching.py --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
Erotemic / ubuntu_setup_venv3_standalone.sh
Last active December 19, 2018 16:46
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=; }
has_pymodule(){
__heredoc__ '''
Check if a python module is installed. Echos "True" or "False" to the
command line depending on the result.
Example:
source $HOME/local/init/utils.sh
@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