Skip to content

Instantly share code, notes, and snippets.

View mpdroid's full-sized avatar

Rajaram Gurumurthi mpdroid

View GitHub Profile
@mpdroid
mpdroid / camvid_benchmark.ipynb
Last active December 26, 2019 02:00
camvid_benchmark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mpdroid
mpdroid / benchmark.ipynb
Last active December 26, 2019 01:33
benchmark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mpdroid
mpdroid / mona_lisa.py
Last active December 1, 2019 13:52
Transform Mona Lisa to grayscale using numpy array manipulation
# Based on https://www.degeneratestate.org/posts/2016/Oct/23/image-processing-with-numpy/
import numpy as np
import matplotlib.pylab as plt
import matplotlib.gridspec as gridspec
%matplotlib inline
original = plt.imread("mona_lisa_full.jpg")
@mpdroid
mpdroid / gist:d922cfc1ae31c20f081339497593eaba
Created December 30, 2017 17:44
Tracing a path using Swift SpriteKit
// Demonstrates how to trace a path using SKShapeNode, CGMutablePath and Update
// Swift 4.0
import SpriteKit
import PlaygroundSupport
import AVFoundation
let start = CGPoint(x: 100, y: 50)
let end = CGPoint(x: 200, y: 50)
let control = CGPoint(x: 150, y: 100);
var motion: SKAction = SKAction();
@mpdroid
mpdroid / gist:cea82e9603ac347709d93a1d5a2ee4fd
Created December 11, 2017 20:18
Swift Arrowhead using CGPath
// Arrowhead pointing in the direction of "towards" CGPoint - supports triangular, pointy and diamond shaped heads as well
//
// Based on https://gist.github.com/mayoff/4146780//
//
import UIKit
class ArrowHeadPath {
class func create(from start: CGPoint, towards end: CGPoint, width: CGFloat, headLengthOuter: CGFloat, headLengthInner: CGFloat) -> CGPath {
@mpdroid
mpdroid / gist:fd8dbeabf8dc874e78937db0273bf4bc
Created December 9, 2017 05:29
Picture-frame using CAShapeLayer
import UIKit
import PlaygroundSupport
let bounds = CGRect(x: 0, y: 0, width: 400, height: 200)
let uiview = UIView(frame: bounds)
uiview.backgroundColor = UIColor.clear
PlaygroundPage.current.liveView = uiview