Skip to content

Commit

Permalink
Revert " Fix to an UnboundLocalError due to rename." -- Bind the vari…
Browse files Browse the repository at this point in the history
…able in question, rather than replace it with another parameter (#320)

* Switching naming of _bgr as discussed to reverse detector call

Switching naming of _bgr as discussed to reverse detector call
renaming iterator in loop for clarity

* Revert "Adds support for arbitrary image rotations (#309)"

This reverts commit 44dfd9d.

* Revert "FaceLandmarksExtractor comment (#317)"

This reverts commit f79c487.

* Revert "Fix to an UnboundLocalError due to rename. (#318)"

This reverts commit 2e2dc84.

* Correction to UnboundLocalError

Tested that "sort -s face-cnn" works correctly after chagnes to FaceLandmarksExtractor.py
  • Loading branch information
kvrooman authored and Clorr committed Mar 28, 2018
1 parent 44dfd9d commit 3e1d957
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/FaceLandmarksExtractor/FaceLandmarksExtractor.py
Expand Up @@ -148,6 +148,7 @@ def extract(input_image_bgr, detector, verbose, all_faces=True, input_is_predete
if input_is_predetected_face:
input_scale = 1.0
detected_faces = [ dlib.rectangle(0, 0, w, h) ]
input_image = input_image_bgr[:,:,::-1].copy()
else:
input_scale = scale_to / (w if w > h else h)
input_image_bgr = cv2.resize (input_image_bgr, ( int(w*input_scale), int(h*input_scale) ), interpolation=cv2.INTER_LINEAR)
Expand All @@ -174,7 +175,7 @@ def extract(input_image_bgr, detector, verbose, all_faces=True, input_is_predete
center[1] -= (bottom - top) * 0.12
scale = (right - left + bottom - top) / 195.0

image = crop(input_image_bgr, center, scale).transpose ( (2,0,1) ).astype(np.float32) / 255.0
image = crop(input_image, center, scale).transpose ( (2,0,1) ).astype(np.float32) / 255.0
image = np.expand_dims(image, 0)

pts_img = get_pts_from_predict ( keras_model.predict (image)[-1][0], center, scale)
Expand Down

0 comments on commit 3e1d957

Please sign in to comment.