Skip to content

Instantly share code, notes, and snippets.

Kevin Mader kmader

  • Magic Leap
  • Zurich, Switzerland
Block or report user

Report or block kmader

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kmader
kmader / README.md
Last active Mar 26, 2019
Beating Serialization in Spark
View README.md

Serialization

As all objects must be Serializable to be used as part of RDD operations in Spark, it can be difficult to work with libraries which do not implement these featuers.

Java Solutions

Simple Classes

For simple classes, it is easiest to make a wrapper interface that extends Serializable. This means that even though UnserializableObject cannot be serialized we can pass in the following object without any issue

public interface UnserializableWrapper extends Serializable {
    public UnserializableObject create(String parm1, String parm2);
@kmader
kmader / environment.yml
Last active Mar 22, 2019
Out of order bug
View environment.yml
name: plotly_express
dependencies:
- python=3.5
- numpy
- matplotlib
- pandas
- scikit-learn
- pip:
- plotly==3.7.1
- plotly_express
View Comparing_Heart_Rate.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / CornerstoneDemo.ipynb
Created Aug 30, 2018
Cornerstone Demo Notebook
View CornerstoneDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / volume_labelmap.py
Created Aug 17, 2018
convert volumes to labelmaps in Slicer3D
View volume_labelmap.py
from glob import glob
import os
cur_glob = '/Volumes/NO NAME/*seg.nii'
files_to_process = glob(cur_glob)
print('Processing', len(files_to_process), 'files')
def process_file(in_path):
slicer.mrmlScene.Clear(0)
[success, loadedVolumeNode] = slicer.util.loadVolume(in_path, returnNode=True)
outputLabelMap = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')
vol_logic = slicer.modules.volumes.logic()
@kmader
kmader / jupyanno.html
Created Aug 2, 2018
FunAnnotation.html
View jupyanno.html
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Thebe Lab examples</title>
<link rel="stylesheet" type="text/css" href="index.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js">
</script>
<!-- Configure and load Thebe !-->
@kmader
kmader / ImageEnhancementPlayground.ipynb
Created Mar 7, 2018
Using IPywidgets and Matplotlib Together
View ImageEnhancementPlayground.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / README.md
Created Feb 13, 2018
RCNN / YOLO in JS
View README.md

How to display output

How to display reasonable output from a RCNN in JS

@kmader
kmader / CNN_MNIST_PlaidML.ipynb
Last active Oct 29, 2017
PlaidML Keras MNIST
View CNN_MNIST_PlaidML.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.