text: # -*- coding: utf-8 -*-
  """
  Created on Sat Feb 19 02:20:31 2022
  
  @author: Rejwan Bin Sulaiman
  """
  
  import numpy as np
  import pickle
  import pandas as pd
  #from flasgger import Swagger
  import streamlit as st 
  
  from PIL import Image
  
  #app=Flask(__name__)
  #Swagger(app)
  
  pickle_in = open("classifier.pkl","rb")
  classifier=pickle.load(pickle_in)
  
  #@app.route('/')
  def welcome():
      return "Welcome All"
  
  #@app.route('/predict',methods=["Get"])
  def predict_note_authentication(variance,skewness,curtosis,entropy):
      
      """Let's Authenticate the Banks Note 
      This is using docstrings for specifications.
      ---
      parameters:  
        - name: variance
          in: query
          type: number
          required: true
        - name: skewness
          in: query
          type: number
          required: true
        - name: curtosis
          in: query
          type: number
          required: true
        - name: entropy
          in: query
          type: number
          required: true
      responses:
          200:
              description: The output values
          
      """
     
      prediction=classifier.predict([[variance,skewness,curtosis,entropy]])
      print(prediction)
      return prediction
  
  
  
  def main():
      st.title("Bank Authenticator ")
      html_temp = """
      <div style="background-color:SteelBlue;padding:10px">
      <h2 style="color:white;text-align:center;">Bank Authenticator App using Random Forest classifier </h2>
      </div>
      """
      st.markdown(html_temp,unsafe_allow_html=True)
      variance = st.text_input("Variance","Type Here")
      skewness = st.text_input("skewness","Type Here")
      curtosis = st.text_input("curtosis","Type Here")
      entropy = st.text_input("entropy","Type Here")
      result=""
      if st.button("Predict"):
          result=predict_note_authentication(variance,skewness,curtosis,entropy)
      st.success('The output is {}'.format(result))
      if st.button("About"):
          st.text("Data were extracted from images that were taken from genuine and forged banknote-like specimens. For digitization, an industrial camera usually used for print inspection was used. The final images have 400x 400 pixels. Due to the object lens and distance to the investigated object gray-scale pictures with a resolution of about 660 dpi were gained. Wavelet Transform tool were used to extract features from images.")
          st.text("Example: variance = 3.62 | skewness = 8.66 | cutosis = -2.80 | Entropy = .449 -- > Class = 0")
          st.text("Example: variance = 0.88992 | skewness = 2.2638 | cutosis = -3.1046 | Entropy = -0.11855 -- > Class = 1")
          st.text("Built with Streamlit")
  
  if __name__=='__main__':
      main()
      
      
      
  