Skip to content

Instantly share code, notes, and snippets.

View alexcpn's full-sized avatar

Alex Punnen alexcpn

View GitHub Profile
@alexcpn
alexcpn / happyplace.jpg
Last active February 5, 2018 04:35
Functional and Non Functional Requirements
happyplace.jpg
Primary Key name type Example
Partition Key bin_cell_key tuple<int,int,text> (1234, 222, 'Candidate1')
Cluster Key time_key tuple<time,time> ('07:30:00.000000000','07:45:00.000000000')
event text some data
Primary Key name type Example
Partition Key bin,year,month,day,key tuple<double,double>int,int,int,int (1234, 222, 12,01,2017)
Cluster Key cell text Candidate1
Cluster Key time_key tuple<time,time> ('07:30:00.000000000','07:45:00.000000000')
event text some data
Node Table SS Table Count No of Keys (estimate) Write Count Write Latency ReadCount Read latency (in MS) Space Used (MB) Space Used (In MB) In GB ~ space used per row (bytes)
*.101 demo1 4 77351 28079297 0.07 3 10.562 39.27958606
*.102 demo1 6 70768 26748356 0.078 19 7.065 39.66590036
@alexcpn
alexcpn / Dockerfile
Created August 9, 2018 05:26
For running GRPC gateway
FROM envoyproxy/envoy:latest
RUN apt-get update
COPY envoy.yaml /etc/envoy.yaml
CMD /usr/local/bin/envoy -c /etc/envoy.yaml
@alexcpn
alexcpn / Dockerfile
Created August 9, 2018 05:26
For running GRPC gateway
FROM envoyproxy/envoy:latest
RUN apt-get update
COPY envoy.yaml /etc/envoy.yaml
CMD /usr/local/bin/envoy -c /etc/envoy.yaml
@alexcpn
alexcpn / python_grpc.py
Created February 5, 2019 10:23
Python Protobuffer GRPC assign to nested type and assign to repeated types
obj1 = proto.Object.Detection()
obj1.classname= classname
bbox = proto.BoundingBox()
bbox.X1 =1
# Use CopyFrom to assign to nested element
obj1.boundingbox.CopyFrom(bbox)
obj1.object_id = random.randint(1, 6)
callback = proto.Object()
# use Extend to add to repeated elements
import grpc
import numpy
import tensorflow as tf
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2_grpc
from keras.preprocessing import image
from keras_retinanet.utils.image import read_image_bgr, preprocess_image, resize_image
import time
import cv2
import grpc
import numpy
import tensorflow as tf
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2_grpc
import time
import cv2
import numpy as np
@alexcpn
alexcpn / image_preprocessor_tf_client.py
Last active April 3, 2019 19:24
Image preprocessor for TF Serving Client
################################################################################
# Helper functions for image preoricessing #
################################################################################
__author__ = "Alex Punnen"
__date__ = "March 2019"
from timeit import default_timer as timer
import numpy as np
import cv2