This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
from pit import Pit | |
import requests | |
import getpass | |
import json | |
HTTPUnauthorized = 401 | |
HTTPCreated = 201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv/cv.h> | |
#include <opencv/highgui.h> | |
#include <glut.h> | |
static void display(void) | |
{ | |
cv::Mat img = cv::imread("test.jpg"); | |
cv::flip(img, img, 0); | |
cv::cvtColor(img, img, CV_BGR2RGB); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from collections import Counter | |
# hist | |
m = np.asarray([2058, 2059, 2058, 2100, 2100, 2102, 2101, 2058, 2059, 2100]) | |
print sorted(Counter(m).items()) | |
plt.subplot(211) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><title>mpld3 plot</title></head><body> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as plt | |
from sklearn import svm, datasets | |
import mpld3 | |
iris = datasets.load_iris() | |
X = iris.data[:, :2] | |
Y = iris.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><title>mpld3 plot</title></head><body> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as plt | |
from sklearn import svm, datasets | |
from mpld3 import show_d3, fig_to_d3, plugins | |
iris = datasets.load_iris() | |
X = iris.data[:, :2] | |
Y = iris.target | |
h = .02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mpld3.plugins import PluginBase | |
import jinja2 | |
import json | |
from mpld3 import show_d3 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
class LinkedView(PluginBase): | |
"""A simple plugin showing how multiple axes can be linked""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from mpld3 import show_d3, plugins | |
import requests as rq | |
def main(): | |
url = 'http://sochi.kimonolabs.com/api/countries' | |
payload = {'fields': 'name,medals', | |
'sort': 'medals.total,-1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- encoding: utf-8 -*- | |
import numpy as np | |
import cv2 | |
if __name__ == '__main__': | |
img = cv2.imread("Ryo.jpg", 0) | |
params = {'ksize':(31, 31), 'sigma':1.0, 'theta':0, 'lambd':15.0, |