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 keras import applications | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras import optimizers | |
from keras.models import Sequential, Model | |
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D | |
from keras import backend as k | |
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping | |
img_width, img_height = 256, 256 |
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 tensorflow as tf | |
# Assuming object detection API is available for use | |
from object_detection.utils.config_util import create_pipeline_proto_from_configs | |
from object_detection.utils.config_util import get_configs_from_pipeline_file | |
import object_detection.tf_server_export_inference_graph | |
# Configuration for model to be exported, the pipeline_config_path | |
config_pathname = "custom_detection/configs/101resnet_frcnn_coco.config" |
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
"""Functions to export object detection inference graph.""" | |
import logging | |
import os | |
import tempfile | |
import tensorflow as tf | |
from tensorflow.core.protobuf import rewriter_config_pb2 | |
from tensorflow.python import pywrap_tensorflow | |
from tensorflow.python.client import session | |
from tensorflow.python.framework import graph_util | |
from tensorflow.python.platform import gfile |
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
"""A simple GRPC client to communicate with tf-server on the given port. | |
It has been developed by some help from another GIST which I forgot to reference.""" | |
import time | |
from argparse import ArgumentParser | |
from grpc.beta import implementations | |
from tensorflow_serving.apis import predict_pb2 | |
from tensorflow_serving.apis import prediction_service_pb2 | |
from tensorflow.contrib.util import make_tensor_proto | |
import grpc | |
import scipy |
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
model_config_list: { | |
config: { | |
name: "resnet_101", | |
base_path: "/models/res2", | |
model_platform: "tensorflow", | |
model_version_policy: { | |
specific: { | |
versions: 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
s = class_descriptions[class_descriptions['class']\ | |
.isin(classes)]\ | |
.set_index('name').T.to_dict() | |
train_df = pd.DataFrame(columns=['FileName', 'XMin', 'XMax', | |
'YMin', 'YMax', | |
'ClassName']) | |
# Find boxes in each image and put them in a dataframe | |
train_imgs = os.listdir(train_path) | |
train_imgs = [name[0:16] for name in train_imgs\ |
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
""" | |
Use this code to download High resolution Birds Eye view which is similar to Google map's 45° imagery. There is no straight | |
forward way to download either of these. | |
""" | |
import urllib | |
import json, sys | |
from PIL import Image | |
from io import BytesIO | |
latlon = sys.argv[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
License Key PhpStorm 8 | |
User Name : EMBRACE | |
===== LICENSE BEGIN ===== | |
43136-12042010 | |
00002UsvSON704l"dILe1PVx3y4"B3 | |
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh | |
gd1BebYc5U"6OxDbVsALB4Eb10PW8" | |
===== LICENSE END ===== |