-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathextract_bottleneck_features.py
More file actions
19 lines (15 loc) · 932 Bytes
/
extract_bottleneck_features.py
File metadata and controls
19 lines (15 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def extract_VGG16(tensor):
from keras.applications.vgg16 import VGG16, preprocess_input
return VGG16(weights='imagenet', include_top=False).predict(preprocess_input(tensor))
def extract_VGG19(tensor):
from keras.applications.vgg19 import VGG19, preprocess_input
return VGG19(weights='imagenet', include_top=False).predict(preprocess_input(tensor))
def extract_Resnet50(tensor):
from keras.applications.resnet50 import ResNet50, preprocess_input
return ResNet50(weights='imagenet', include_top=False).predict(preprocess_input(tensor))
def extract_Xception(tensor):
from keras.applications.xception import Xception, preprocess_input
return Xception(weights='imagenet', include_top=False).predict(preprocess_input(tensor))
def extract_InceptionV3(tensor):
from keras.applications.inception_v3 import InceptionV3, preprocess_input
return InceptionV3(weights='imagenet', include_top=False).predict(preprocess_input(tensor))