[ ] Check that you are up-to-date with the master branch of keras-vis. You can update with:
pip install git+git://github.com/raghakot/keras-vis.git --upgrade --no-deps
[ ] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ ] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
`
from vis.losses import ActivationMaximization
from vis.regularizers import TotalVariation, LPNorm
from vis.input_modifiers import Jitter
from PIL import Image
import imageio
from vis.optimizer import Optimizer
from vis.callbacks import GifGenerator
from keras.applications.vgg16 import VGG16
model = VGG16(weights='imagenet', include_top=True)
print('Model loaded.')
layer_name = 'predictions'
layer_dict = dict([(layer.name, layer) for layer in model.layers[1:]])
output_class = [20]
[ ] Check that you are up-to-date with the master branch of keras-vis. You can update with: pip install git+git://github.com/raghakot/keras-vis.git --upgrade --no-deps
[ ] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ ] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
` from vis.losses import ActivationMaximization from vis.regularizers import TotalVariation, LPNorm from vis.input_modifiers import Jitter from PIL import Image import imageio from vis.optimizer import Optimizer
from vis.callbacks import GifGenerator from keras.applications.vgg16 import VGG16
model = VGG16(weights='imagenet', include_top=True) print('Model loaded.')
layer_name = 'predictions' layer_dict = dict([(layer.name, layer) for layer in model.layers[1:]]) output_class = [20]
losses = [ (ActivationMaximization(layer_dict[layer_name], output_class), 0.1), (LPNorm(model.input), 6), (TotalVariation(model.input), 10) ] opt = Optimizer(model.input, losses) opt.minimize(max_iter=1000, verbose=True, input_modifiers=[Jitter()], callbacks=[GifGenerator('opt_progress')]) `
I write above code, and this program generates gif image. But, I cannot see bird in the gif image. Please tell me how to do.
(I rewrite /vis/utils/utils.py )
img = Image.fromarray(img.astype('uint8')) draw = ImageDraw.Draw(img) draw.text(position, text, fill=color, font=font)