Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
import boto3 | |
from PIL import Image | |
from io import BytesIO | |
import os | |
class S3ImagesInvalidExtension(Exception): | |
pass | |
class S3ImagesUploadFailed(Exception): | |
pass |
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 | |
## |
from __future__ import print_function | |
import requests | |
import json | |
import cv2 | |
addr = 'http://localhost:5000' | |
test_url = addr + '/api/test' | |
# prepare headers for http request | |
content_type = 'image/jpeg' |
'''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 |
# 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 |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
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 |
""" 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 |
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 ): | |
""" |