analytics-jiten commited on
Commit
f6adf9a
·
1 Parent(s): 5d0d7b2

Update classifier.py

Browse files
Files changed (1) hide show
  1. classifier.py +3 -1
classifier.py CHANGED
@@ -19,7 +19,7 @@ class_labels = ['Contempt', 'angry', 'disgust','fear','happy','neutral','sad','s
19
 
20
  def predict_and_display(uploaded_file, model, class_labels):
21
  img = Image.open(uploaded_file)
22
- img = img.resize((224, 224))
23
  img_array = np.array(img)
24
  img_array = np.expand_dims(img_array, axis=0)
25
  img_array = preprocess_input(img_array)
@@ -43,6 +43,8 @@ def run():
43
  if uploaded_files:
44
  for uploaded_file in uploaded_files:
45
  st.write("filename:", uploaded_file.name)
 
 
46
  # Close the form
47
  submitted = st.form_submit_button('Predict')
48
 
 
19
 
20
  def predict_and_display(uploaded_file, model, class_labels):
21
  img = Image.open(uploaded_file)
22
+ img = img.resize((256, 256))
23
  img_array = np.array(img)
24
  img_array = np.expand_dims(img_array, axis=0)
25
  img_array = preprocess_input(img_array)
 
43
  if uploaded_files:
44
  for uploaded_file in uploaded_files:
45
  st.write("filename:", uploaded_file.name)
46
+ elif:
47
+ st.write("Please upload your image properly")
48
  # Close the form
49
  submitted = st.form_submit_button('Predict')
50