Pas encore de compte ?
Testé sous Anaconda et Python 3.7
# First import Keras layers needed for the model from keras.models import Sequential from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.preprocessing import image # for image loading and manipulation import numpy as np # for additional processing needed by Keras import matplotlib.pyplot as plt # for plotting the images dog = image.load_img('dog.jpg') plt.imshow(dog) plt.show() dog = image.load_img('dog.jpg',target_size=(64,64)) plt.imshow(dog) plt.show() def show_features(classifier,dog): img = np.expand_dims(dog,axis=0) conv = classifier.predict(img) conv = np.squeeze(conv, axis=0) conv = conv.reshape(conv.shape[:2]) plt.imshow(conv) plt.show() dog = image.img_to_array(dog) classifier = Sequential() classifier.add(Conv2D(1,(3,3), input_shape=dog.shape, activation='relu')) show_features(classifier,dog) classifier = Sequential() classifier.add(Conv2D(1,(3,3), input_shape=dog.shape, activation='relu')) classifier.add(MaxPooling2D(pool_size=(2,2))) show_features(classifier,dog)
Image originale
64 x 64
Con2D
Conv2D + Maxpooling2D
Image originale
64 x 64
Con2D
Conv2D + Maxpooling2D
visualizing-CNNs - GitHub
Bienvenu, je m’appelle Eric Soupet et je suis l'administrateur du site elodees.com. elodees.com est un état de l'art de l'Intelligence Artificielle et se veut collaboratif, vous pouvez dès à présent proposer du contenu tels que des articles, des événements, des tutoriels, ... alors n'hésitez pas !
Crédit des images de la plate-forme : Pixabay - Pixabay License | Pexels - Pexels License