Skip to content

Instantly share code, notes, and snippets.

View zbyte64's full-sized avatar

Jason Kraus zbyte64

View GitHub Profile
@mcchae
mcchae / image_diff.py
Created August 24, 2017 00:58
Python OpenCV Image diff
# USAGE
# python image_diff.py --first images/original_01.png --second images/modified_01.png
# import the necessary packages
from skimage.measure import compare_ssim
import argparse
import imutils
import cv2
# construct the argument parse and parse the arguments
@uchidama
uchidama / pillow_with_opencv_findContours.ipynb
Last active January 13, 2024 15:57
Pillow to Opencv to find Contours, and back to Pillow Image.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def tf_pca(x):
'''
Compute PCA on the bottom two dimensions of x,
eg assuming dims = [..., observations, features]
'''
# Center
x -= tf.reduce_mean(x, -2, keepdims=True)
# Currently, the GPU implementation of SVD is awful.
# It is slower than moving data back to CPU to SVD there
@colllin
colllin / adamw.py
Last active January 1, 2020 15:26
PyTorch AdamW optimizer
# Based on https://github.com/pytorch/pytorch/pull/3740
import torch
import math
class AdamW(torch.optim.Optimizer):
"""Implements AdamW algorithm.
It has been proposed in `Fixing Weight Decay Regularization in Adam`_.
Arguments:
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com