Skip to content

Instantly share code, notes, and snippets.

satomacoto satomacoto

Block or report user

Report or block satomacoto

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
@duhaime
duhaime / measure_img_similarity.py
Last active Jun 7, 2019
Compare image similarity in Python using Structural Similarity, Pixel Comparisons, Wasserstein Distance (Earth Mover's Distance), and SIFT
View measure_img_similarity.py
import warnings
from skimage.measure import compare_ssim
from skimage.transform import resize
from scipy.stats import wasserstein_distance
from scipy.misc import imsave
from scipy.ndimage import imread
import numpy as np
import cv2
##
@kylehounslow
kylehounslow / client.py
Created May 8, 2017
Send and receive images using Flask, Numpy and OpenCV
View client.py
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
headers = {'content-type': content_type}
@fchollet
fchollet / classifier_from_little_data_script_3.py
Last active Jun 18, 2019
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
View classifier_from_little_data_script_3.py
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@dannyvassallo
dannyvassallo / 20160216211105_create_images.rb
Created Feb 16, 2016
Use tinymce-rails & tinymce-rails-imageupload with carrierwave & fog
View 20160216211105_create_images.rb
# db/migrate/filename.rb
# generate with >> rails g model image alt:string hint:string file:string
class CreateImages < ActiveRecord::Migration[5.0]
def change
create_table :images do |t|
t.string :alt
t.string :hint
t.string :file
@parmentf
parmentf / GitCommitEmoji.md
Last active Jun 19, 2019
Git Commit message Emoji
View GitCommitEmoji.md
@steerapi
steerapi / siteconf.py
Created Mar 13, 2015
pycuda siteconf.py Mac OS X 10.10
View siteconf.py
BOOST_INC_DIR = []
BOOST_LIB_DIR = []
BOOST_COMPILER = 'gcc43'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-py27']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = '/usr/local/cuda'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
@aronwc
aronwc / lda.py
Last active Feb 11, 2019
Example using GenSim's LDA and sklearn
View lda.py
""" Example using GenSim's LDA and sklearn. """
import numpy as np
from gensim import matutils
from gensim.models.ldamodel import LdaModel
from sklearn import linear_model
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
@yono
yono / 0.md
Last active Dec 26, 2017
fabric で踏み台サーバ越しに ssh アクセス
View 0.md

前提

  • [local] -> [admin] -> [prod]
  • [admin] -> [prod] の鍵は事前に配置済み
  • $HOME/.ssh/config で設定
  • 踏み台サーバ(admin)、目的のサーバ(prod) どちらにも鍵認証でログイン

結果

  • $HOME/.ssh/config だけだと実行終了時の DONE で固まる
@crmccreary
crmccreary / AESCipher.py
Created May 20, 2013
Encryption using pycrypto, AES, and PKCS5 padding
View AESCipher.py
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__( self, key ):
"""
@turadg
turadg / subdomains.rb
Last active May 23, 2019 — forked from rtekie/subdomains.rb
Drop-in utility to test your app subdomains with Capybara, Rspec, and a Javascript driver (Poltergeist, Webkit, or Selenium)
View subdomains.rb
# Support for Rspec / Capybara subdomain integration testing
# Make sure this file is required by spec_helper.rb
# (e.g. save as spec/support/subdomains.rb)
def switch_to_subdomain(subdomain)
# lvh.me always resolves to 127.0.0.1
hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me"
Capybara.app_host = "http://#{hostname}"
end
You can’t perform that action at this time.