EngAbod commited on
Commit
7e1f5d7
·
1 Parent(s): bd9dbb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -23
app.py CHANGED
@@ -174,29 +174,28 @@ if picture:
174
  st.text("إضاءة غير جيدة")
175
  st.text("انتقل الى مكان جيد الإضاءة")
176
  else:
177
- import dlib
178
-
179
- # Initialize the face detector
180
- faceDetector = dlib.get_frontal_face_detector()
181
-
182
- # Assuming 'frm' is your input image
183
- faces = faceDetector(frm, 0)
184
-
185
- # Check if there are any faces detected
186
- if len(faces) > 0:
187
- largest_face = None
188
- max_area = 0
189
-
190
- # Find the largest face
191
- for face in faces:
192
- w = face.right() - face.left()
193
- h = face.bottom() - face.top()
194
- area = w * h
195
- if area > max_area:
196
- max_area = area
197
- largest_face = face
198
-
199
- # If a largest face is detected
200
  if largest_face is not None:
201
  # Calculate the expanded dimensions
202
  expansion_factor = 1.5
 
174
  st.text("إضاءة غير جيدة")
175
  st.text("انتقل الى مكان جيد الإضاءة")
176
  else:
177
+
178
+ # Initialize the face detector
179
+ faceDetector = dlib.get_frontal_face_detector()
180
+
181
+ # Assuming 'frm' is your input image
182
+ faces = faceDetector(frm, 0)
183
+
184
+ # Check if there are any faces detected
185
+ if len(faces) > 0:
186
+ largest_face = None
187
+ max_area = 0
188
+
189
+ # Find the largest face
190
+ for face in faces:
191
+ w = face.right() - face.left()
192
+ h = face.bottom() - face.top()
193
+ area = w * h
194
+ if area > max_area:
195
+ max_area = area
196
+ largest_face = face
197
+
198
+ # If a largest face is detected
 
199
  if largest_face is not None:
200
  # Calculate the expanded dimensions
201
  expansion_factor = 1.5