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
''' | |
CS.661: Computer Vision | |
Johns Hopkins University | |
Flynn, Michael | |
Python script to scrape images from Google CSE. | |
Usage: | |
python scrape_images.py {directory} {num_queries} |
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 math, sys | |
def print_progress_bar(progress, length=40, fill_char='=', empty_char=' ', | |
side_char='|'): | |
''' | |
Prints a simple progress bar using carriage returns. | |
Args: | |
progress (int): The progress done as a percentage 0-100 |
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
# such grammar. very linguistics. wow. | |
# | |
# a context-free grammar of doge. | |
# | |
# much reference: the-toast.net/2014/02/06/linguist-explains-grammar-doge-wow | |
1 ROOT S | |
# ---- Sentences and doge phrases | |
# |
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.layers import Dense, Dropout, Flatten, Input | |
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D | |
from keras.models import Model | |
from keras.utils.layer_utils import print_summary | |
VGG_PATH = 'vgg16_weights.h5' | |
vis_input = Input(shape=visual_shape, name="vis_input") | |
x = ZeroPadding2D((1,1)) (vis_input) |
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
#!/usr/bin/env sh | |
# | |
# Installs the C++ headers and library for TensorFlow. | |
TF_VERSION=v1.2.1 | |
INSTALL_TARGET=/usr/local | |
if [ ! `command -v bazel` ]; then | |
echo "TensorFlow requires bazel in order to build TensorFlow!" | |
echo "Please install bazel and make sure it's on your PATH and try again." |