SnapLoc — Places of interest in a city, from geo-tagged photos

Hawk Hill at sunrise (Photo Credit : David Yu)
  1. To recommend most interesting places based on user preferences. For eg: a small cupcake shop that everyone has been posting about but unless you search for it, you would never know about it.
  2. To the growing number of photo enthusiasts, I want to provide a way to see some great pictures of well known places. For eg. there is an awesome view of Golden Gate from Hawk’s point but many do not know that.
  3. And finally I want to take the location recommender a step further to suggest a travel itinerary for a new place that user wants to travel to. it is also a photo opportunity recommender and a travel itinerary recommender based on hotspots and landmarks.
model = inception-v3('/mnt/inception-v3_weights.h5')
for layer in model.layers:
layer.trainable = False
model.outputs = [model.layers[-1].output]
model.layers[-1].outbound_nodes = []
model.add(Dense(6, activation='softmax'))

sgd = SGD(lr=1e-3, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(optimizer=sgd, loss='categorical_crossentropy', metrics=['accuracy'])
#Imports required
from shapely.geometry import Point, Polygon
from geopy.distance import great_circle, vincenty
from sklearn.cluster import DBSCAN
from scipy.spatial import ConvexHull
# Spatial clusters based on the histogram
data = metadata[['latitude', 'longitude']]
db = DBSCAN(eps = 0.0007, min_samples = 8, metric ='euclidean', algorithm='auto')
# Visualization of clusters with shapely and geojson
coords = metadata.as_matrix(['latitude', 'longitude'])
cluster_labels = db.labels_
n_clusters = len(set(cluster_labels))
clusters = pd.Series([coords[cluster_labels == n] for n in range(0, n_clusters)])
maploc1 = folium.Map(tiles='cartodbpositron', location=[40.678361, -74.019592],zoom_start=11)
for cluster in clusters:
if len(np.unique(cluster)) <= 2:
print ('bad cluster ' + str(cluster))
inverted = [[x[1],x[0]] for x in cluster.tolist()]
ring = Polygon(inverted)
ring_hull = ring.convex_hull
  1. If there was more time, I could have made the application more personalized based on user profiling and interests and give suggestions based on may be just the photography of wildlife.
  2. I can complete the itinerary creation for a new place — map of landmarks and hotspots that can be covered in a day based on current location and time a person wants to spend in that area.
  3. And who says that only Flickr’s geotagged images can be used? The whole world is open and I can take up tagged images from Instagram, Facebook and many other sites to do the same.




Data Scientist

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kalgi Shah

Kalgi Shah

Data Scientist

More from Medium

The science behind the data N°3 —  The advantages of Parallel Categorical Diagrams

Choosing the Right OCR Service for Extracting Text Data

Geo Clustering : An Application of DBSCAN

How to OCR & translate large unstructured data on a budget