Spaces:
Build error
Build error
Update app.py
Browse files
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
|
| 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
|
| 13 |
from datetime import datetime
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
pylab
|
| 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] == ".
|
| 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()
|