Skip to content

Instantly share code, notes, and snippets.

shgidi / marker_listener.js
Created September 24, 2018 14:51
marker_listener'click', event => {
let name = event.feature.getProperty('name');
let desc = event.feature.getProperty('desc');
let position = event.feature.getGeometry().get();
let content = `
<img style="float:left; width:10px; margin-top:30px">
<div style="margin-left:120px; margin-bottom:20px;">
shgidi / map.js
Created September 24, 2018 12:32
minimal initMap
function initMap (){
const map = new google.maps.Map(document.querySelector('#map'), {
zoom: 14,
center: {
// TA
lat: 32.0705, // N-S
lng: 34.7691 // W-E
shgidi / index.html
Created September 24, 2018 12:31
Basic index for a map
<title>TA Artist Map</title>
<link rel="stylesheet" type="text/css" href="style.css">
<div id="map" class="map"></div>
<script src="map.js"></script>
<script async defer
shgidi / 0_reuse_code.js
Created August 8, 2017 12:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
shgidi /
Created July 12, 2017 10:30
plots loss in keras, additionally plots segmentation in image
class PlotLosses(keras.callbacks.Callback):
def __init__(self,imgs):
super(PlotLosses, self).__init__()
def on_train_begin(self, logs={}):
self.i = 0
self.x = []
from keras.models import model_from_json
def save_keras_model(model,path):
model_json = model.to_json()
with open(path+"json", "w") as json_file:
def load_keras_model(path):
#simple model
model = Sequential([
#Embedding(vocab_size, vec_size, input_length=seq_len,weights=[emb]),
Dense(100, input_dim=test_data.shape[1], init='uniform', activation='relu'),
Dense(1, activation='sigmoid')])
model.compile(loss='binary_crossentropy', optimizer=Adam(), metrics=['accuracy'])
from keras.applications.vgg16 import VGG16
from keras.layers import Conv2D
from keras.models import Sequential
from keras.layers import BatchNormalization
from keras.optimizers import Adam
p=0.4 #dropout
from keras.applications.resnet50 import ResNet50
from scipy.misc import imresize
for i,img in enumerate(imgs_new_rand):
currentAxis = plt.gca()
currentAxis.add_patch(plt.Rectangle(*coords, fill=False, edgecolor=color, linewidth=2))