I hereby claim:
- I am cospel on github.
- I am michallukac (https://keybase.io/michallukac) on keybase.
- I have a public key ASDoorxH9WsFryZFoIKVQYAm99NyZs1rGub_EI5tpHfEWQo
To claim this, I am signing this object:
| # create the base model | |
| base_model = tf.keras.applications.MobileNetV2(include_top=False, weights="imagenet", input_shape=shape) | |
| # apply normalization on input | |
| inputs = tf.keras.Input(shape=shape, name="input") | |
| x = PreprocessTFLayer()(inputs) | |
| x = base_model(x) | |
| x = tf.keras.layers.GlobalAveragePooling2D()(x) | |
| outputs = tf.keras.layers.Dense(2, activation="softmax", name="probs")(x) |
| class PreprocessTFLayer(tf.keras.layers.Layer): | |
| def __init__(self, name="preprocess_tf", **kwargs): | |
| super(PreprocessTFLayer, self).__init__(name=name, **kwargs) | |
| self.preprocess = preprocess_tf | |
| def call(self, input): | |
| return self.preprocess(input) | |
| def get_config(self): | |
| config = super(PreprocessTFLayer, self).get_config() |
| @tf.function | |
| def preprocess_tf(x): | |
| """ | |
| Preprocessing for Keras (MobileNetV2, ResNetV2). | |
| :param x: np.asarray([image, image, ...], dtype="float32") in RGB | |
| :return: normalized image tf style (RGB) | |
| """ | |
| batch, height, width, channels = x.shape | |
| x = tf.cast(x, tf.float32) |
| import cv2 | |
| import numpy as np | |
| # load image in cv2 | |
| img = cv2.imread('test_image.jpg') | |
| # the image should be converted to grayscale | |
| img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| # apply threshod |
| import tensorflow as tf | |
| import numpy as np | |
| class BlurPool(tf.keras.layers.Layer): | |
| """ | |
| https://arxiv.org/abs/1904.11486 | |
| https://github.com/adobe/antialiased-cnns | |
| https://github.com/adobe/antialiased-cnns/issues/10 | |
| """ |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>D3 Confusion/Correlation Matrix</title> | |
| <meta name="description" content="D3 Heatmap Demo"> | |
| <meta name="author" content="Marcos Iglesias"> | |
| <script src="https://d3js.org/d3.v5.min.js"></script> | |
| <link rel="stylesheet" href="src/css/styles.css"> | |
| </head> |
| from redis import Redis | |
| from redis_hashring import RingNode | |
| import gevent | |
| import threading | |
| import random | |
| import signal | |
| N_KEYS = 10 | |
| # we cannot use thread object | |
| class Listener():#threading.Thread): |
| import sys, getopt | |
| import tensorflow as tf | |
| usage_str = 'python tensorflow_rename_variables.py --checkpoint_dir=path/to/dir/ ' \ | |
| '--replace_from=substr --replace_to=substr --add_prefix=abc --dry_run' | |
| def rename(checkpoint_dir, replace_from, replace_to, add_prefix, dry_run): | |
| checkpoint = tf.train.get_checkpoint_state(checkpoint_dir) |
I hereby claim:
To claim this, I am signing this object:
| import tensorflow as tf | |
| import numpy as np | |
| import os | |
| import zconfig | |
| import utils | |
| class RBM(object): |