Jassk28 commited on
Commit
015e05f
·
1 Parent(s): c7611f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -1,29 +1,28 @@
1
- import streamlit as st
2
  from keras.models import load_model
3
  from PIL import Image
4
  import numpy as np
5
- import cv2 #module in openCV to provide easy to use interface for workin image and video
6
  import requests
7
 
8
- import io #for input output or simply read and write files operations
9
- bytes_data = None # this under io, bytesio is classfor operation on byte data
10
-
11
  import face_recognition
12
- import os #os module allows us to operate on underlying OS irrespective mac windows etc.
13
  from datetime import datetime
14
 
15
- from matplotlib import pyplot as plt #matplotlib is package lets you draw inline pictures in the notebooks
16
- import pylab #module that bulk imports matplotlib.pyplot (for plotting) and NumPy (for Mathematics and working with arrays) in a single name space.
17
- pylab.rcParams['figure.figsize'] = (10.0, 8.0) # this controls figure size
18
-
19
 
 
 
 
20
 
21
  Images = []
22
  classnames = []
23
  myList = os.listdir()
24
  #st.write(myList)
25
  for cls in myList:
26
- if os.path.splitext(cls)[1] == ".jpeg" :
27
  curImg = cv2.imread(f'{cls}')
28
  Images.append(curImg)
29
  classnames.append(os.path.splitext(cls)[0])
@@ -84,4 +83,4 @@ if img_file_buffer is not None:
84
  ##############################
85
  st.image(image)
86
  if bytes_data is None:
87
- st.stop()
 
 
1
  from keras.models import load_model
2
  from PIL import Image
3
  import numpy as np
4
+ import cv2
5
  import requests
6
 
 
 
 
7
  import face_recognition
8
+ import os
9
  from datetime import datetime
10
 
11
+ #the following are to do with this interactive notebook code
12
+ from matplotlib import pyplot as plt # this lets you draw inline pictures in the notebooks
13
+ import pylab # this allows you to control figure size
14
+ pylab.rcParams['figure.figsize'] = (10.0, 8.0) # this controls figure size in the notebook
15
 
16
+ import io
17
+ import streamlit as st
18
+ bytes_data=None
19
 
20
  Images = []
21
  classnames = []
22
  myList = os.listdir()
23
  #st.write(myList)
24
  for cls in myList:
25
+ if os.path.splitext(cls)[1] == ".jpg" :
26
  curImg = cv2.imread(f'{cls}')
27
  Images.append(curImg)
28
  classnames.append(os.path.splitext(cls)[0])
 
83
  ##############################
84
  st.image(image)
85
  if bytes_data is None:
86
+ st.stop()