You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.6 KiB

In [14]:
from keras.applications.vgg19 import VGG19
from keras.preprocessing import image
from keras.applications.inception_v3 import preprocess_input
from keras.models import Model
import numpy as np

# base_model = VGG19(weights='imagenet')
# model = Model(inputs=base_model.input, outputs=base_model.get_layer('block4_pool').output)

img_path = 'images/Achanthidium delmontii-!-Achnanthidium delmontii.JPG'
img = image.load_img(img_path, target_size=(224, 224))
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)

# block4_pool_features = model.predict(x)
In [15]:
x.min(), x.max()
Out[15]:
(-1.0, 1.0)