Extract images from the main image

Is there a way to separate the 100 mini-images from the main image for each sample?

Hi @jinoooooooooo

Yes! We have a function added in the Baseline notebook of Face Recognition Puzzle named get_target_face which simply takes the target face_no ( which will be between “00” and “99” [ in string ] ) and target_image .

def get_target_face(face_no, target_image):

  # Top-Left x, y corrdinates of the specific face 
  x, y = (int(face_no[0]))*216, (int(face_no[1]))*216

  target_face = target_image[x:x+216, y:y+216]

  return target_face

# Showing a sample face from a sample target image 

sample_target_face = get_target_face("96", sample_target)

You can find more about it in the baseline. I hope this helps!


1 Like