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 colorlover as cl | |
from plotly import graph_objs as go | |
from plotly import offline | |
from sklearn.decomposition import PCA | |
import torch | |
from torch.autograd import Variable | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torchvision import datasets, transforms |
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 random | |
import torch | |
from torch.autograd import Variable | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import torchvision | |
from torchvision import datasets, transforms |
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.applications.resnet50 import ResNet50, preprocess_input | |
from keras.preprocessing import image | |
import numpy as np | |
resnet = ResNet50(include_top=False) | |
def extract_features(img_paths, batch_size=64): | |
""" This function extracts image features for each image in img_paths using ResNet50 bottleneck layer. | |
Returned features is a numpy array with shape (len(img_paths), 2048). |
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 __future__ import print_function | |
import os | |
import time | |
import boto3 | |
from boto3 import dynamodb | |
import cv2 | |
import numpy as np | |
import scipy.misc |
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 datetime import datetime, timedelta | |
import urllib2 | |
from urllib2 import URLError | |
import boto3 | |
START_BYTE = b'\xff\xd8' | |
END_BYTE = b'\xff\xd9' | |
ITER_LIMIT = 10000 |