Skip to content

Instantly share code, notes, and snippets.

MXNet Artifacts
https://s3.amazonaws.com/deeplens-araitats/HeadPoseDemo/HeadPoseMXModel/model-0000.params
https://s3.amazonaws.com/deeplens-araitats/HeadPoseDemo/HeadPoseMXModel/model-symbol.json
Lambda
https://s3.amazonaws.com/deeplens-araitats/HeadPoseDemo/HeadPoseLambda/HeadPoseFeb1-9082a683-bc2f-4dfb-bff3-d14b5b271a13.zip
Getting started with SageMaker
https://docs.aws.amazon.com/sagemaker/latest/dg/gs.html
* Lab 1: Image Classification:
* Traffic Sign classification
* https://github.com/aws-samples/aws-ml-vision-end2end/
* Lab 2: Transfer Learning
* https://s3.amazonaws.com/smallya-test/mxnet-finetune-nb/finetuning-mxnet.zip
import base64
import cStringIO
import cv2
import numpy as np
from IPython.display import HTML
from PIL import Image
vis = False
@sunilmallya
sunilmallya / ngx_hello_world
Created March 20, 2015 22:19
hello world nginx module
/*
* Hello world NGINX template for the blog
*
* For nginx data types refer -
* http://antoine.bonavita.free.fr/nginx_mod_dev_en.html
* @author: sunil mallya
*
*/
<?xml version='1.0' encoding='UTF-8' ?>
<?charles serialisation-version='2.0' ?>
<rewriteSet-array>
<rewriteSet>
<active>true</active>
<name>Rewrite</name>
<hosts>
<locationPatterns>
<locationMatch>
<location>
@sunilmallya
sunilmallya / redisdbconnection
Created March 5, 2015 23:20
Wrapper class that supports both synchronous and asynchronous redis client
'''
A useful DB Connection class with both sync & async redis clients
It uses a threadpool to make the redis library asynchronous so as
to work with tornado seamlessly. There is also a retry wrapper built in
to retry in case of connection failures to redis server
Tornado 4.0 required, for the rest of the requirements check the imports
'''
@sunilmallya
sunilmallya / clousre_compiler
Created March 5, 2015 21:08
Compiling js online with closure
import urllib
import urllib2
CLOSURE_URL = "http://closure-compiler.appspot.com/compile"
def compile_js(contents):
data = { "compilation_level" : "SIMPLE_OPTIMIZATIONS",
"output_format" : "text",
"output_info" : "compiled_code",
"js_code" : contents
@sunilmallya
sunilmallya / cosinescore
Created March 4, 2015 19:37
Compute cosine score
import math
import stemmer
def irange(sequence):
return zip(range(len(sequence)), sequence)
class CosineScore(object):
def __init__(self,all_docs):
self.documents = all_docs #list all docs [doc1,doc2..]
self.ndocs = len(all_docs)
@sunilmallya
sunilmallya / gist:76766675367717cb44f7
Created February 20, 2015 01:30
vim settings for python
syntax on
filetype indent plugin on
setlocal tabstop=4
set tabstop=4 shiftwidth=4 expandtab
set showmatch " highlight matching braces
set comments=sl:/*,mb:\ *,elx:\ */ " intelligent comments
set nocompatible " dont support vi stuff
set autoindent
set smartindent
set textwidth=80
@sunilmallya
sunilmallya / gist:7573627
Last active June 30, 2021 18:23
Mocking Httpclient and AsyncHttpclient in Tornado Server
#!/usr/bin/env python
'''
Mocking Httpclient and AsyncHttpclient in Tornado Server
'''
import unittest
import urllib
import tornado.gen
import tornado.ioloop
import tornado.web