old_contents: from keras.applications.vgg16 import VGG16
  from keras.models import Sequential, Model
  from keras.layers import Input, Activation, Dropout, Flatten, Dense
  from keras.preprocessing import image
  import sys
  import numpy as np
  
  filename = sys.argv[1]
  print('input:', filename)
  
  classes = ['Tulip', 'Snowdrop', 'LilyValley', 'Bluebell', 'Crocus',
             'Iris', 'Tigerlily', 'Daffodil', 'Fritillary', 'Sunflower',
             'Daisy', 'ColtsFoot', 'Dandelion', 'Cowslip', 'Buttercup',
             'Windflower', 'Pansy']
  nb_classes = len(classes)
  
  img_height, img_width = 150, 150
  channels = 3
  
  # VGG16
  input_tensor = Input(shape=(img_height, img_width, channels))
  vgg16 = VGG16(include_top=False, weights='imagenet', input_tensor=input_tensor)
  
  # FC
  fc = Sequential()
  fc.add(Flatten(input_shape=vgg16.output_shape[1:]))
  fc.add(Dense(256, activation='relu'))
  fc.add(Dropout(0.5))
  fc.add(Dense(nb_classes, activation='softmax'))
  
  # VGG16とFCを接続
  model = Model(input=vgg16.input, output=fc(vgg16.output))
  
  # 学習済みの重みをロード
  model.load_weights('fine-tuning.h5')
  
  model.compile(loss='categorical_crossentropy',
                optimizer='adam',
                metrics=['accuracy'])
  # model.summary()
  
  # 画像を読み込んで4次元テンソルへ変換
  img = image.load_img(filename, target_size=(img_height, img_width))
  x = image.img_to_array(img)
  x = np.expand_dims(x, axis=0)
  
  # print(x.shape)
  
  # クラスを予測
  # 入力は1枚の画像なので[0]のみ
  pred = model.predict(x)[0]
  
  # 予測確率が高いトップ5を出力
  top = 5
  top_indices = pred.argsort()[-top:][::-1]
  result = [(classes[i], pred[i]) for i in top_indices]
  for x in result:
      print(x)
  
new_contents: from keras.applications.vgg16 import VGG16
  from keras.models import Sequential, Model
  from keras.layers import Input, Activation, Dropout, Flatten, Dense
  from keras.preprocessing import image
  import sys
  import numpy as np
  
  filename = sys.argv[1]
  print('input:', filename)
  
  classes = ['Tulip', 'Snowdrop', 'LilyValley', 'Bluebell', 'Crocus',
             'Iris', 'Tigerlily', 'Daffodil', 'Fritillary', 'Sunflower',
             'Daisy', 'ColtsFoot', 'Dandelion', 'Cowslip', 'Buttercup',
             'Windflower', 'Pansy']
  nb_classes = len(classes)
  
  img_height, img_width = 150, 150
  channels = 3
  
  # VGG16
  input_tensor = Input(shape=(img_height, img_width, channels))
  vgg16 = VGG16(include_top=False, weights='imagenet', input_tensor=input_tensor)
  
  # FC
  fc = Sequential()
  fc.add(Flatten(input_shape=vgg16.output_shape[1:]))
  fc.add(Dense(256, activation='relu'))
  fc.add(Dropout(0.5))
  fc.add(Dense(nb_classes, activation='softmax'))
  
  # VGG16とFCを接続
  model = Model(input=vgg16.input, output=fc(vgg16.output))
  
  # 学習済みの重みをロード
  model.load_weights('results/fine-tuning.h5')
  
  model.compile(loss='categorical_crossentropy',
                optimizer='adam',
                metrics=['accuracy'])
  # model.summary()
  
  # 画像を読み込んで4次元テンソルへ変換
  img = image.load_img(filename, target_size=(img_height, img_width))
  x = image.img_to_array(img)
  x = np.expand_dims(x, axis=0)
  
  # print(x.shape)
  
  # クラスを予測
  # 入力は1枚の画像なので[0]のみ
  pred = model.predict(x)[0]
  
  # 予測確率が高いトップ5を出力
  top = 5
  top_indices = pred.argsort()[-top:][::-1]
  result = [(classes[i], pred[i]) for i in top_indices]
  for x in result:
      print(x)
  
subject: Fix a small bug