Skip to content

Instantly share code, notes, and snippets.

View davegreenwood's full-sized avatar

Dave Greenwood davegreenwood

  • University of East Anglia
View GitHub Profile
@davegreenwood
davegreenwood / black.css
Created June 7, 2019 18:31
slack black
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@davegreenwood
davegreenwood / .gitignore
Created May 9, 2019 11:02
gitignore that excludes everything except files of interest
*
!README.md
!setup.py
!tedview.py
!face_detection.py
!data/
!data/data.txt
name: base
channels:
- defaults
dependencies:
- _ipyw_jlab_nb_ext_conf=0.1.0=py37_0
- alabaster=0.7.11=py37_0
- anaconda=5.3.0=py37_0
- anaconda-client=1.7.2=py37_0
- anaconda-navigator=1.9.2=py37_0
- anaconda-project=0.8.2=py37_0
@davegreenwood
davegreenwood / cleannb.py
Last active February 23, 2019 15:56
Strip the outputs and set execution to zero in jupyter notebook.
"""
Strip the output from a jupyter notebook.
A utility to shrink the deltas when versioning.
"""
import json
import shutil
import click
def readnb(fname):
@davegreenwood
davegreenwood / 3dpose.py
Created January 3, 2019 10:40
Download all the 3d pose files from CMU Panoptic Studio.
"""
Download all the 3d Pose data from the CMU panoptic studio.
"""
from tqdm import tqdm
import requests
import os
scenes = [
"171204_pose1",
"171204_pose2",
@davegreenwood
davegreenwood / MDD.md
Created December 14, 2018 10:15
MDD file format

MDD file format

The MDD file format is very simple and here is a brief description for TD's and developers who are interested in adding tools to a pipeline built around MDD.

The first thing to note is that the MDD file format is Motorola Big Endian byte order as opposed to the Intel Little Endian standard. So however you implement the structure below, you must come up with an algorithm to flip the bytes during file IO.

The data structure is:

@davegreenwood
davegreenwood / distort-undistort.ipynb
Created October 26, 2018 13:59
implement and compare the 'Exact formula for inverse radial distortion'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegreenwood
davegreenwood / gradient-descent.ipynb
Created October 9, 2018 08:19
Simple gradient descent for fitting points
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegreenwood
davegreenwood / triangulation.py
Created September 16, 2018 10:18
Triangulate image points to world points comparing openCV to pure python.
from __future__ import print_function
import numpy as np
import cv2
import time
np.set_printoptions(formatter={'float': '{: 0.3f}'.format})
def triangulate_nviews(P, ip):
"""
@davegreenwood
davegreenwood / Dockerfile
Last active November 4, 2018 14:40 — forked from christian-lanius/Dockerfile
Docker file to run OpenPose
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.5 (apt)
# tensorflow latest (pip)
# opencv latest (git)
# caffe latest (git)
# openpose latest (git)
# pyopenpose latest (git)
# custom_dependencies latest (apt)