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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -175,27 +175,27 @@ if picture:
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
 
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