Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def face_mark(image):
- """
- Mark faces with boxes-----cambiar
- """
- # work on a copy
- image = image.copy()
- # identify boxes
- boxes = face_detect(image)
- # get drawing context for the current image
- ctx = ImageDraw.Draw(image)
- # crop out faces
- faces = [image.crop(rect) for rect in boxes]
- # put the cat on the boxes
- cat = Image.open("animal_1.png")
- resize_cat = cat.resize((150, 150), resample=Image.BICUBIC)
- resize_cat.show()
- for box in boxes:
- image.paste (resize_cat, box = None)
- return image, resize_cat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement