text: # -*- coding: utf-8 -*-
  """Untitled5.ipynb
  
  Automatically generated by Colaboratory.
  
      
  """
  
  import cv2
  
  import tensorflow as tf
  from tensorflow.keras.datasets import cifar10
  from tensorflow.keras.preprocessing.image import ImageDataGenerator
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten
  from tensorflow.keras.layers import Conv2D, MaxPooling2D
  
  import numpy as np
  
  import pickle
  
  pickle_in = open("drive/MyDrive/strt_view/X1.pickle","rb")
  X = pickle.load(pickle_in)
  
  pickle_in = open("drive/MyDrive/strt_view/y1.pickle","rb")
  y = pickle.load(pickle_in)
  y = np.array(y)
  X = X/255.0
  
  print("before sequential")
  model = Sequential()
  
  model.add(Conv2D(256, (3, 3), input_shape=X.shape[1:]))
  model.add(Activation('relu'))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  
  model.add(Conv2D(256, (3, 3)))
  model.add(Activation('relu'))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  
  model.add(Flatten())  # this converts our 3D feature maps to 1D feature vectors
  
  model.add(Dense(64))
  
  model.add(Dense(1))
  model.add(Activation('sigmoid'))
  print("before compile")
  model.compile(loss='binary_crossentropy',
                optimizer='adam',
                metrics=['accuracy'])
  print("okk")
  model.fit(X, y, batch_size=8, epochs=10, validation_split=0.3)
  model.save('64x3-CNN3.model')
  
  import cv2
  #import tensorflow as tf
  
  CATEGORIES = ["Posters", "NotPosters"]
  
  
  def prepare(filepath):
    IMG_SIZE = 250  # 50 in txt-based
    img_array = cv2.imread(filepath, cv2.IMREAD_GRAYSCALE)
    new_array = cv2.resize(img_array, (IMG_SIZE, IMG_SIZE))
    return new_array.reshape(-1, IMG_SIZE, IMG_SIZE, 1)
  
  
  model = tf.keras.models.load_model("drive/MyDrive/strt_view/model.model")
  
  prediction = model.predict([prepare('yess.png')])
  print(prediction)  # will be a list in a list.
  print(CATEGORIES[int(prediction[0][0])])