Soumen commited on
Commit
d50976b
1 Parent(s): 3969ba8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -22,8 +22,10 @@ st.text("Build with Streamlit and OpenCV")
22
  face_cascade = cv2.CascadeClassifier('frecog/haarcascade_frontalface_default.xml')
23
  eye_cascade = cv2.CascadeClassifier('frecog/haarcascade_eye.xml')
24
  smile_cascade = cv2.CascadeClassifier('frecog/haarcascade_smile.xml')
25
- obj_detector = pipeline('object-detection')
26
-
 
 
27
  def detect_faces(our_image):
28
  new_img = np.array(our_image.convert('RGB'))
29
  img = cv2.cvtColor(new_img,1)
@@ -148,7 +150,7 @@ if choice == 'Detection':
148
  else:
149
  st.image(our_image,width=300)
150
  # Face Detection
151
- task = ["Faces","Smiles","Eyes","Cannize","Cartonize","detect_objects"]
152
  feature_choice = st.sidebar.selectbox("Find Features",task)
153
  if st.button("Process"):
154
  if feature_choice == 'Faces':
@@ -171,7 +173,7 @@ if choice == 'Detection':
171
  elif feature_choice == 'Cannize':
172
  result_canny = cannize_image(our_image)
173
  st.image(result_canny)
174
- elif feature_choice == 'detect_objects':
175
  detect_objects(our_image)
176
 
177
  elif choice == 'About':
 
22
  face_cascade = cv2.CascadeClassifier('frecog/haarcascade_frontalface_default.xml')
23
  eye_cascade = cv2.CascadeClassifier('frecog/haarcascade_eye.xml')
24
  smile_cascade = cv2.CascadeClassifier('frecog/haarcascade_smile.xml')
25
+ #@st_cache
26
+ #od():
27
+ #obj_detector = pipeline('object-detection')
28
+ #return obj_detector
29
  def detect_faces(our_image):
30
  new_img = np.array(our_image.convert('RGB'))
31
  img = cv2.cvtColor(new_img,1)
 
150
  else:
151
  st.image(our_image,width=300)
152
  # Face Detection
153
+ task = ["Detect_any_objects", "Faces","Smiles","Eyes","Cannize","Cartonize"]
154
  feature_choice = st.sidebar.selectbox("Find Features",task)
155
  if st.button("Process"):
156
  if feature_choice == 'Faces':
 
173
  elif feature_choice == 'Cannize':
174
  result_canny = cannize_image(our_image)
175
  st.image(result_canny)
176
+ elif feature_choice == 'Detect_any_objects':
177
  detect_objects(our_image)
178
 
179
  elif choice == 'About':