This file contains hidden or 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
| """ | |
| Utility script to visualize embeddings using the tensorboard projector module. | |
| Usage | |
| ----- | |
| Dependencies : numpy, pillow, pandas, tensorflow | |
| Call `prepare_projection(embedding, metadata, image_paths, ...)`, where : | |
| - `embedding` is a 2D numpy array (`n_sample` x `dim_embedding`) |
This file contains hidden or 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
| Mapnik supports the PROJ.4 WKT for projections and buried deep in the doc's is one called | |
| 'Two Point Equidistant'. You provide the left and right points and the map is rotated | |
| such that these two points are horizontal in the output. | |
| This allows you to rotate the map to any angle (including south up!!) and the text is | |
| rendered correctly! You don't have to change the projections of your input vectors. | |
| Simply tweak the mapnik generate_image.py script like this: | |
| Change: |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """ | |
| This script will delete all of the tweets in the specified account. | |
| You may need to hit the "more" button on the bottom of your twitter profile | |
| page every now and then as the script runs, this is due to a bug in twitter. | |
| You will need to get a consumer key and consumer secret token to use this | |
| script, you can do so by registering a twitter application at https://dev.twitter.com/apps | |
| @requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1) |