Vikas01 commited on
Commit
0304d96
1 Parent(s): d76ab76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -82,14 +82,18 @@ def run_face_recognition():
82
 
83
  img_file_buffer=st.camera_input("Take a picture")
84
  if img_file_buffer is not None:
85
- # To read image file buffer as bytes:
86
- bytes_data = img_file_buffer.getvalue()
87
- cv2_img = cv2.imdecode(np.frombuffer(bytes_data, np.uint8), cv2.IMREAD_COLOR)
88
- st.write(type(cv2_img))
89
- st.image(cv2_img)
90
- # Call the function to run face recognition
91
-
92
- return redirect(url_for('show_table'))
 
 
 
 
93
 
94
  @app.route('/table')
95
  def show_table():
 
82
 
83
  img_file_buffer=st.camera_input("Take a picture")
84
  if img_file_buffer is not None:
85
+ test_image = Image.open(img_file_buffer)
86
+ st.image(test_image, use_column_width=True)
87
+ st.write(type(test_image))
88
+ image = np.asarray(test_image)
89
+ gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
90
+
91
+ st.image(cv2.cvtColor(gray))
92
+ if bytes_data is None:
93
+ st.stop()
94
+
95
+
96
+
97
 
98
  @app.route('/table')
99
  def show_table():