H
Hype Drip

How to train photos on macos to recognize faces

Author

Andrew Walker

Published Mar 29, 2026

iPhoto used to have an option to (re)scan for missing photos. That seems to be missing in photos. I recently downloaded all my high resolution photos to my iMac and would like to have it rescan for faces and prompt me for the name.

I would like the old feature back or a suggested work around. I have 50 GB of photos so manual effort is not preferred.

iMac with Retina 5K display, macOS Sierra (10.12.4), Photos application

Posted on Jul 13, 2017 10:53 AM

Helpful answers

I recently downloaded all my high resolution photos to my iMac and would like to have it rescan for faces and prompt me for the name.

Photos will scan all photos for faces exactly once – when you first import them to photos.This scanning happens in the background and only, when you are not using Photos.

You will see all newly recognized faces in Photos, if you open the People album and click the “Add +” button at the bottom of the People album. This will let you select recognized faces to add to the People Album and to name.

Or click the album of a named person to ope it. If Photos has found additional faces of the person, it will prompt you to confirm them.

Jul 13, 2017 11:08 AM

I hope there is a way to force a rescan that is less effort than moving around 50GB of data.

No as Léonie answered (very clearly IMHO)

Photos will scan all photos for faces exactly once

For feature requests tell Apple what you want – Product Feedback – Apple

Jul 13, 2017 11:17 AM

There’s more to the conversation

Loading page content

Page content loaded

I recently downloaded all my high resolution photos to my iMac and would like to have it rescan for faces and prompt me for the name.

Photos will scan all photos for faces exactly once – when you first import them to photos.This scanning happens in the background and only, when you are not using Photos.

You will see all newly recognized faces in Photos, if you open the People album and click the “Add +” button at the bottom of the People album. This will let you select recognized faces to add to the People Album and to name.

Or click the album of a named person to ope it. If Photos has found additional faces of the person, it will prompt you to confirm them.

Jul 13, 2017 11:08 AM

This I have read; however many of my photos have unrecognized faces in them. Clear and easy to identify. Previously iPhoto would rescan and find most of the missing faces.

Since I have over 50K photos, I hope there is a way to force a rescan that is less effort than moving around 50GB of data.

Jul 13, 2017 11:11 AM

I hope there is a way to force a rescan that is less effort than moving around 50GB of data.

No as Léonie answered (very clearly IMHO)

Photos will scan all photos for faces exactly once

For feature requests tell Apple what you want – Product Feedback – Apple

Jul 13, 2017 11:17 AM

This I have read; however many of my photos have unrecognized faces in them. Clear and easy to identify. Previously iPhoto would rescan and find most of the missing faces.

Are you sure that Photos has already finished the faces scan?

For 50k photos it can take several weeks to complete the initial scan.

You could wait for the High Sierra upgrade. That will change and improve the face recognition algorithm again and may detect more faces than already have been recognized.

Jul 13, 2017 11:18 AM

Since upgrading to High Sierra, there is no “Add +” button anymore in the People view in Photos, at least not on my laptop. Not sure where the unidentified faces are and how to access them.

Oct 2, 2017 1:50 AM

The album of all unidentified faces is no longer there. Photos will at first only add a few faces to the People album to get you started, faces of people that are occurring frequently in your photos.

If you want to add an additional person, start from a photo showing this person. Just type a name into the text field below the circle around a face and it will add a new person to the People album.

  • Click a photo, to view it enlarged.
  • If Photos found a face or you added a face manually, you will see a circle around the detected face.

The circles will only show, if you enable “Show faces names” in the “View” menu. You can switch them off again, with “Hide Faces Names”, to be able to see the photo properly.

To name further faces of the same person, open the album that has been added and click “Confirm additional faces”.

Oct 2, 2017 1:59 AM

Unfortunately, photos in High Sierra is a terrible update when it comes to face recognition. The older versions (both Photos and iPhotos) would auto-detect 99% of faces (with a few mistakes, power sockets, statues, etc.). It would then take 10 minutes to add the names and merge a few together. Job-done.

The new Photos recognises about 80% of faces, but only shows them in the ‘people’ tab if it finds 15 or more photos of what it thinks is the same person. I just don’t have that many photos of all my friends and family! I can see this setting in a file called “faceWorkerState.plist” but when I change it, some process just changes it back.

I’ve managed to get something approaching a full library of people by making 16 duplicates of the entire library and letting Photos wade through that for a week, then spending the 10 minutes as above to add names and merge. Then deleting the duplicates. The whole process takes about 2 weeks with a library of 3K photos.

A complete pain in the rear to restore functionality that worked pretty well just one version ago.

При первом открытии приложения «Фото» оно сканирует медиатеку и ищет на фотографиях людей. По завершении сканирования Вы можете открыть альбом «Люди», просмотреть фотографии по изображенным на них людям и назначить имена людям, которых нашло приложение «Фото». Когда Вы импортируете новые фотографии в медиатеку, приложение «Фото» сопоставляет их с людьми, которых Вы обозначили. Вы также можете обозначить людей на фотографиях вручную.

Просмотр людей в медиатеке

В приложении «Фото» на Mac нажмите «Люди» в боковом меню.

Избранные Вами люди отображаются в больших квадратах вверху окна. Чтобы пометить человека как избранного, нажмите кнопку «Избранное» на фотографии. Можно также перетянуть человека в область избранного вверху или перетянуть его за пределы области.

Дважды нажмите лицо, чтобы просмотреть фотографии этого человека.

How to train photos on macos to recognize faces

Чтобы просматривать все фотографии или только лица, нажмите кнопку «Фото» или «Лица» в панели инструментов. Чтобы просмотреть все или только выбранные фотографии с человеком, нажмите «Показать еще» или «Показать все» вверху области «Фото».

Выполните одно из следующих действий.

Добавление имени человека на фотографиях. Нажмите «Добавить имя» в панели инструментов, введите имя и нажмите клавишу Return (или выберите имя, появившееся в процессе ввода). Если люди определены неверно, нажмите фотографию, удерживая клавишу Control, затем выберите «Эта фотография не содержит [имя]» или «Это не [имя]».

Просмотр и подтверждение других фотографий этого человека. Если приложение «Фото» нашло другие фотографии этого человека и Вам нужно их проверить, на панели инструментов отображается сообщение. Нажмите кнопку «Просмотр», чтобы проверить фотографии и подтвердить, что на них изображен тот же человек. Затем нажмите «Готово». Если отображается сообщение, прокрутите до нижнего края и нажмите «Подтвердить другие фотографии». Когда приложение «Фото» отображает соответствующе лицо, нажмите «Да», чтобы подтвердить личность человека. Нажмите «Готово», чтобы завершить просмотр соответствующих лиц.

Выбор фотографии в качестве ключевой фотографии для представления всех фотографий человека. Когда на экране показаны миниатюры человека, нажмите фотографию при нажатой клавише Control, затем выберите «Сделать фото титульным». (Если для просмотра открыта отдельная фотография, нельзя сделать ее ключевой, нажав фотографию при нажатой клавише Control.)

Просмотр фотографий на карте. Прокрутите вниз до раздела «Места», а затем дважды нажмите миниатюру фотографии, чтобы увидеть место ее съемки.

Обозначение человека как избранного. Прокрутите до нижнего края и нажмите «Отметить этого человека». Нажмите «Удалить отметку», чтобы убрать человека из списка избранных.

Создание воспоминания из фотографий человека. Прокрутите до нижнего края и нажмите «Добавить в Воспоминания».

Указание имен людей, которых определило приложение «Фото»

В приложении «Фото» на Mac нажмите «Люди» в боковом меню.

Нажмите кнопку «Имя» на фотографии человека, для которого Вы хотите указать имя, затем введите имя и нажмите Return (или выберите имя, показанное в процессе ввода).

Имя назначается всем фотографиям в группе. Чтобы переименовать человека на фотографиях, нажмите его имя и введите новое имя.

Объединение фотографий человека в одну группу

Если Вы обнаружили, что несколько групп фотографий относятся к одному и тому же человеку, эти группы можно объединить.

В приложении «Фото» на Mac нажмите «Люди» в боковом меню.

Выберите группы фотографий, которые хотите объединить.

Нажмите одну группу, удерживая клавишу Control, затем выберите «Объединить [количество] человек».

Определение и добавление имен людей на фотографиях вручную

Некоторые фотографии могут содержать людей, имена которых не добавлены автоматически. Можно добавить имена этих людей вручную.

В приложении «Фото» на Mac дважды фотографию, чтобы открыть ее.

Выполните одно из следующих действий:

Нажмите «Вид» > «Показать имена людей». Нажмите имя (или нажмите «без имени») под лицом, введите имя и нажмите клавишу Return (или выберите имя, появившееся в процессе ввода).

Нажмите кнопку информации на панели инструментов. Нажмите кнопку «Добавить» , при необходимости перетяните кружок на лицо, нажмите поле «Имя», введите имя и нажмите клавишу Return.

Для обозначения нескольких лиц на фотографии нажмите кнопку добавления несколько раз. Чтобы удалить добавленное имя, нажмите кнопку удаления на фотографии человека.

Чтобы не показывать имена людей на фотографиях, выберите «Вид» > «Скрыть имена людей».

Удаление всех фотографий человека в альбоме «Люди»

Когда Вы удаляете человека из альбома «Люди», исходные фотографии не удаляются из медиатеки.

В приложении «Фото» на Mac нажмите «Люди» в боковом меню.

Выполните одно из следующих действий:

Нажмите человека, удерживая клавишу Control, затем выберите «Удалить этого человека». Нажмите «Удалить из альбома “Люди”».

Дважды нажмите человека, затем прокрутите вниз и нажмите «Удалить из альбома “Люди”».

The Photos app recognizes the faces of people in your photos and groups them together. You can name the people in your photos, mark your favorites, and more.

Here’s how it works

The Photos app scans your photos to help you quickly recognize the people, scenes, and objects within the photos. Depending on the number of photos that you have, you can watch a Memory movie of them. And when you have iCloud Photos turned on, the people you favorite or name stay up to date across your Apple devices.

Find someone in the People album

The Photos app organizes the images of the people in the People album. You’ll see a face thumbnail for each person your device recognizes. To find someone in your People album:

  1. Open the Photos app.
  2. Tap the Albums tab.
  3. Tap the People album.

If you named a person in the Photos app, you can also find them under the Search tab. Just tap Search , then type the person’s name.

Add someone to the People album

  1. Open a photo of the person that you want to add.
  2. Tap the Info button , then tap the face of the person with a question mark.
  3. Tap Tag With Name and type the person’s name or tap the name if it shows up.
  4. Tap Next, then tap Done.

Put a name to a face

Photos suggests names from your Contacts, but you can manually add a name to someone that’s already in your People album: Here’s how:

How to train photos on macos to recognize faces

  1. Open the People album, then tap the thumbnail of the person that you want to name.
  2. Tap Add Name at the top of the screen.
  3. Type the person’s name or select their name if it shows up.
  4. Tap Next, then tap Done.

Merge photos of the same person

Sometimes the same person is identified in more than one group within your People album. To merge all of the photos under one group:

  1. Go to the People album and tap Select.
  2. Select the people that you want to merge.
  3. Tap Merge near the bottom of the screen.
  4. Tap Yes to confirm the merge.

Use “Feature Less” in the People album

With iOS 14 and later, you can have the Photos app suggest certain people less frequently. This adjusts the way the Photos app curates your Memories, Featured photos, and the photos that you see in the Photos widget — so you see less photos of these people. Here’s how:

How to train photos on macos to recognize faces

  1. Open the People album and tap the person’s thumbnail.
  2. Tap the More button in the upper-right corner.
  3. Tap “Feature [Name] Less.”
  4. Select an option, like Feature This Person Less or Never Feature this Person, then tap Confirm.

If you choose to feature someone less, you’ll have to reset your Memories settings in order to see that person again in the People album. Go to Settings > Photos, tap Reset Suggested Memories, then tap Reset to confirm.

Instead of suggesting someone less, you can remove them from the People album. Just follow steps 1-2 and tap “Remove [name] from People.” You can add them back whenever you want.

Favorite people

Mark the People that you access the most as a Favorite so that it’s easier to find them. If you haven’t set any Favorites yet, you’ll see the Favorite button on the photos. To favorite someone, just tap the Favorite button .

How to train photos on macos to recognize faces

You can also tap the person’s thumbnail, tap the More button , then tap “Add [Name] to Favorites.” To favorite multiple people at once, tap Select, tap each person that you want to favorite, then tap Favorite at the bottom of the People album.

Change a thumbnail photo

Photos automatically assigns a face thumbnail for each person it recognizes. If you want to use a different photo for someone’s thumbnail, you can change it from their photo collection screen. Here’s how:

How to train photos on macos to recognize faces

  1. Open the People album, then tap the person.
  2. Tap Select, then tap Show Faces to focus on just the person’s face in each photo.
  3. Tap the photo that you want to use.
  4. Tap the Share button , then tap Make Key Photo.

Fix mixed-up names and faces

If you notice that there’s a photo of someone in a collection that’s misidentified, you can remove it. Here’s how:

  1. In the People album, tap the person.
  2. Tap Select, then tap Show Faces to focus on just the person’s face in each photo.
  3. Tap each photo that isn’t of the person.
  4. Tap the Share button , then tap “This is Not [Name].”

Get the locations and outlines of each person’s eyes, nose, mouth and chin.

Identify faces in pictures

Recognize who appears in each photo.

You can even use this library with other Python libraries to do real-time face recognition:

See this example for the code.

Installation

Requirements

  • Python 3.3+ or Python 2.7
  • macOS or Linux (Windows not officially supported, but might work)

Installing on Mac or Linux

First, make sure you have dlib already installed with Python bindings:

Then, install this module from pypi using pip3 (or pip2 for Python 2):

Installing on Raspberry Pi 2+

Installing on Windows

While Windows isn’t officially supported, helpful users have posted instructions on how to install this library:

Installing a pre-configured Virtual Machine image

  • Download the pre-configured VM image (for VMware Player or VirtualBox).

Usage

Command-Line Interface

Next, you need a second folder with the files you want to identify:

Adjusting Tolerance / Sensitivity
More Examples
Speeding up Face Recognition

If you are using Python 3.4 or newer, pass in a --cpus parameter:

You can also pass in --cpus -1 to use all CPU cores in your system.

Python Module

Automatically find all the faces in an image

You can also opt-in to a somewhat more accurate deep-learning-based face detection model.

Automatically locate the facial features of a person in an image
Recognize faces in images and identify who they are

Python Code Examples

All the examples are available here.

Face Detection

  • Find faces in a photograph
  • Find faces in a photograph (using deep learning)
  • Find faces in batches of images w/ GPU (using deep learning)

Facial Features

  • Identify specific facial features in a photograph
  • Apply (horribly ugly) digital make-up

Facial Recognition

How Face Recognition Works

Caveats

  • The face recognition model is trained on adults and does not work very well on children. It tends to mix up children quite easy using the default comparison threshold of 0.6.

Deployment to Cloud Hosts (Heroku, AWS, etc)

Common Issues

Issue: Illegal instruction (core dumped) when using face_recognition or running examples.

Issue: RuntimeError: Unsupported image type, must be 8bit gray or RGB image. when running the webcam examples.

Solution: Your webcam probably isn’t set up correctly with OpenCV. Look here for more.

Issue: MemoryError when running pip2 install face_recognition

Issue: AttributeError: 'module' object has no attribute 'face_recognition_model_v1'

Solution: The version of dlib you have installed is too old. You need version 19.7 or newer. Upgrade dlib.

Issue: Attribute Error: 'Module' object has no attribute 'cnn_face_detection_model_v1'

Solution: The version of dlib you have installed is too old. You need version 19.7 or newer. Upgrade dlib.

Issue: TypeError: imread() got an unexpected keyword argument 'mode'

Solution: The version of scipy you have installed is too old. You need version 0.17 or newer. Upgrade scipy.

How to train photos on macos to recognize faces

Photos on the Mac does a great job of picking out faces, and if you’ve gone through and categorized the folks you know, it’s a handy feature for finding snapshots of your great-aunt Mabel (or whoever) without having to scroll by date. But sometimes, Photos doesn’t recognize that there’s even a person in an image you took. In that case, you’ll need to manually add that picture to a person’s “Faces” album, but luckily, it’s pretty simple to do. For this, you’ll start with the uncategorized image.

How to train photos on macos to recognize faces

I can tell that Photos doesn’t recognize who’s in the picture because when I click the “i” icon in the toolbar to get info on the image…

…I find that there aren’t any faces listed.

How to train photos on macos to recognize faces

What I’ll do, then, is click the “Add Faces” plus button within that info window. Doing so will place a “Click to Name” circle on my image.

How to train photos on macos to recognize faces

I’ll drag that circle until it’s around my friend’s face, and if I need to, I can click and drag the little white dot on the side to make the circle larger or smaller.

How to train photos on macos to recognize faces

When it’s in position, I’ll do as the circle suggests and click the box to name the person. As I start typing, suggestions from my already existing faces will appear, and I can select the right one to identify the fun dude in the picture.

How to train photos on macos to recognize faces

After I’ve assigned the correct face to the photo, going back to its info window will show me what I’ve done! His face will appear there, and the picture I just categorized will appear within his “Faces” album, too.

How to train photos on macos to recognize faces

I do like using this feature, really—it’s certainly better than having to go through and pick out all of the images of one person and manually drop them into an album!—and I’m glad that there’s a way to fix it when Photos doesn’t recognize someone. Or maybe I just need to have friends that make fewer silly expressions so their faces are more recognizable.

I’m just playing with openCV and I made python programs that can recognize when there is a face in a picture, and if the face is trained in the database, they know the name of the person. With openCV this is quiet easy.

I loved google-picasa because it had virtual folders for your friends and relatives. For example in the folder “daddy” you found all pictures with your daddy. This feature was great.

Maybe it is possible to integrate this into XNView?

Re: recognizing faces and people

Post by xnview » Thu Feb 15, 2018 2:36 pm

Re: recognizing faces and people

Post by schultzter » Fri Mar 02, 2018 4:18 pm

Facial recognition would be awesome. It’s something I would happily pay for!

I loved XnViewMP when I used it on my Linux desktop (but that computer has died and gone). More than digikam and Shotwell.

I haven’t had much time for organising my photos lately, but before I do I need to find something with facial recognition (or at least detection then I can add the names). On Windows or Linux.

I’ve tried Mylio and MAGIX. Mylio looks great and has an amazing sync system, truly innovative. MAGIX is meh but at least has facial recog.

Unfortunately Mylio is subscription based beyond the free limit and that just doesn’t work for me. I plan to keep my photos forever so that means paying the subscription FOREVER.

I would only be willing to buy the software outright, one-time payment (paying again for major updates is fine). And I would gladly support XnView. Facial recognition is critical though. So is hierarchical tags, an efficient UI (keyboard short cuts for everything and not too many levels), and support for removable drives (i.e.: store the photos and database on the drive and don’t freak out when the drive isn’t there – a solution like Mylio’s would be awesome but I guess that’s their thing).

XnView for Chrome OS where all the photos and data are on USB or a local NAS or media server

By Charlie Sorrel • 1:00 pm, April 5, 2019

How to train photos on macos to recognize facesPhotos app is usually pretty good at recognizing people.
Photo: Charlie Sorrel/Cult of Mac

The Photos app’s Faces feature is fantastic. It does a pretty good job of gathering all the pictures of a person together, for both browsing and search. And it’s really easy to add new faces to the list. But what about managing those faces? What if the Photos app’s AI added some photos of a stranger into the photos of your husband?

It’s easy to tell your iPhone or iPad that a photo does not contain the person it thinks it does. Unfortunately, it’s a real pain to find the setting you need to tweak.

Today we’ll see how to tell the Photos app that a mistakenly recognized face is not actually that person after all. We’ll also see how to set a key photo, so you can pick the main image that represents that person in the overall album view.

How to tell Photos it recognized the wrong person

How to train photos on macos to recognize faces

This is the regular Faces management menu, accessed by tapping the three-dot icon.
Photo: Cult of Mac

First, open up the Photos app and tap the Albums tab. Then tap the People & Places album. You’ll see all the faces that Photos has compiled. Tap on a face to see all the photos of that person. If one of those photos is of someone else, here’s how to correct it.

How to train photos on macos to recognize faces

First, tap Select. Then, tap the incorrect photo. Then, tap the Share arrow. You can only get here via the Select option.
Photo: Cult of Mac

How to train photos on macos to recognize faces

This brings up the regular iOS share sheet. Scroll sideways on the bottom (black-and-white) row of icons until you find a button called Not This Person. Tap it, and the photo will be removed from that person’s album. When in Select mode, you can toggle between a wide view and a close-up Faces view.
Photo: Cult of Mac

The tricky part here is that you must first tap the Select button, and then tap the photos(s) that you want to remove. You can’t just select a single photo by tapping it and sharing it. If you do, you won’t see the Not This Person icon in the share sheet. The setting is so hidden that you might want to bookmark this post, because you’ll have forgotten the trick the next time you need it.

How to set a key frame photo for Faces

Now that all the photos of that person are correct, let’s pick a favorite image to be the key photo. This photo will show up anywhere that a thumbnail of that person is used in the Photos app. To select the picture you want, tap Select again while viewing that person’s album. Then tap the photo you want to use as a key photo, tap the Share arrow, and then tap the Make Key Photo.

It’s a pain, but at least you only have to do it once.

Pro tip for power users

To make this easier in the future, you can long-press and drag the two buttons — Not This Person and Make Key Photo — across to the far left of the share sheet. This puts them first in the list whenever you activate it.

But because these buttons only appear in a very specific circumstance, putting them at the beginning will not affect any other share sheet organization you may have done.

This tip works anywhere, too. Any time you have an app-specific set of share options, you can move them to the front of the queue without spoiling your regular share-sheet order.

My MacBook keeps merging two people in photos when they are not the same person. Every time I say they’re not the same person or by renaming one and I close the application and go back and they’ve merged AGAIN and I have to go through and under do it all. Ive googled a lot to see how to stop it but can’t find it. It just automatically merges them. Please help.

MacBook Pro 15”, macOS 10.14

Posted on Jun 8, 2019 4:18 PM

When I had a similar problem, I used new names for the two merged people, not the names from their contact cards but nick names. When I corrected a misnamed face, I used the new name.

  • When fixing incorrectly named faces, start by collecting all photos with wrong faces in an album, so you can quickly find back to these photos.
  • In the View menu in Photos enable “Show Faces names”. Then you will see circles around the faces, with a name tag below the face.
  • Open the People album for the person, then reject the wrong name with “This is not . ” in the People album.
  • Now open the photo you just rejected and view it enlaged. The faces circle should now show “Unnamed”. Do not directly type a name into the unnamed field.
  • Swipe up on the photo to see the faces thumbnails below the photo .
  • Click the thumbnail for the person you want to rename to open the unnamed People album.
  • If you see a wrong name below a face, do not change the name directly, There may be more than photo linked to this unnamed face. if all faces are the same person, type a name into the name fiels. if tehre are again mixed faces, reject the incorrectly merged faces again, then enter a name for the remining correct faces.
  • Do the same for all faces you rejected.

Never enter a name for a face, without checking how many faces thumbnails are bound to this this face byopening the people album for the faces thumbnail. And do not use “Confirm additional faces”, while you are trying to fix merged faces.

Posted on Jun 9, 2019 12:26 PM

All replies

Loading page content

Page content loaded

When I had a similar problem, I used new names for the two merged people, not the names from their contact cards but nick names. When I corrected a misnamed face, I used the new name.

  • When fixing incorrectly named faces, start by collecting all photos with wrong faces in an album, so you can quickly find back to these photos.
  • In the View menu in Photos enable “Show Faces names”. Then you will see circles around the faces, with a name tag below the face.
  • Open the People album for the person, then reject the wrong name with “This is not . ” in the People album.
  • Now open the photo you just rejected and view it enlaged. The faces circle should now show “Unnamed”. Do not directly type a name into the unnamed field.
  • Swipe up on the photo to see the faces thumbnails below the photo .
  • Click the thumbnail for the person you want to rename to open the unnamed People album.
  • If you see a wrong name below a face, do not change the name directly, There may be more than photo linked to this unnamed face. if all faces are the same person, type a name into the name fiels. if tehre are again mixed faces, reject the incorrectly merged faces again, then enter a name for the remining correct faces.
  • Do the same for all faces you rejected.

Never enter a name for a face, without checking how many faces thumbnails are bound to this this face byopening the people album for the faces thumbnail. And do not use “Confirm additional faces”, while you are trying to fix merged faces.

Jun 9, 2019 12:26 PM

I have experienced the same issue. I have worked out what seems to be a solution. My solution is derives from basic knowledge of Artificial Neural Networks (ANNs) combined with basic understanding of Apple’s user interface. I think understanding the underlying reasoning may help in applying the solution.

Photos will combine two people if its ANN models for the two are sufficiently similar. This function can be an advantage. One example is when photos creates multiple groups of similar unnamed faces, which turn out to be all the same person. Another example is if you have inadvertently created two named Persons, which are the same person. (If you have used different versions of the person’s name the People will have to be combined by other methods.) In both of these examples Photos’ people-sorting ANN will recognize that the separate groups should be combined, and do so.

In the problem you describe, Photos’ people-sorting ANN model does not distinguish between the two people. The ANN needs to be modified to become able to make this distinction. Adding such an ability to an ANN requires training the ANN on known data sets. For Photos to distinguish between Person1 and Person2 requires training on known data sets for each Person. To do so I speculate based on general knowledge of Apple user interface principles. This speculation seems validated because the method works.

One speculation is that the ANN trains on the set of photos that is selected. A group of photos can be selected by choosing the Person, and then clicking either Show More or Show Summary, and then further restricted to the thumbs displayed, which can be changed by scrolling.

A second speculation is that the intensity of training is reflected in the cpu usage of Photos seen in Activity Monitor.

Based on the above background, here is how to get Photos to keep two people separate.

Launch Activity Monitor, click the cpu tab, then %cpu. If necessary, click %cpu again so the column is sorted with highest cpu use visible at the top. Keep this window visible and monitor cpu use by Photos as you do the next steps. In Photos, open one Person, click Show More and Faces. Manually inspect the face thumbs to be sure all are the correct person. I believe the faces which are actually visible on your screen are the primary data set being used to train Photos. The cpu use shown in Activity Monitor indicates the intensity of training; as Photos becomes fully trained on this data set, cpu use will tend towards zero. If your data set is large enough that not all elements are shown, scroll to reveal more. Photos cpu use will increase as it trains on the new data, then drop as training on the new data is completed. Continue through your entire set of faces for this person.

Repeat the above steps for the second person.

Now Photos should have fairly well defined models for each of the two separate People, and be able to classify new photos correctly, mostly. However, Photos’ ANN modeling is dynamic and ever-changing. It’s the same ANN being trained if you use one Person’s faces, the other Person’s faces, or all the faces in your library. When you focus training on one person as described above, the same ANN modifications which enhance recognition of that person may degrade the ability to recognize all other faces. Some manual review and correction of incorrect face assignments is required. Otherwise, incorrectly assigned faces will be used to train the ANN incorrectly, resulting in more incorrect assignments and increasing error.

These steps work pretty well for me, although often requiring reiteration. I think the method makes sense, as described. Still, this process is being developed. Please let us know how works for you. Feedback may help refine the method.

You can also read a translated version of this file in Chinese 简体中文版 or in Korean 한국어 or in Japanese 日本語.

Recognize and manipulate faces from Python or from the command line with the world’s simplest face recognition library.

Built using dlib’s state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.38% on the Labeled Faces in the Wild benchmark.

This also provides a simple face_recognition command line tool that lets you do face recognition on a folder of images from the command line!

Find faces in pictures

Find all the faces that appear in a picture:

How to train photos on macos to recognize faces

Find and manipulate facial features in pictures

Get the locations and outlines of each person’s eyes, nose, mouth and chin.

How to train photos on macos to recognize faces

Finding facial features is super useful for lots of important stuff. But you can also use it for really stupid stuff like applying digital make-up (think ‘Meitu’):

How to train photos on macos to recognize faces

Identify faces in pictures

Recognize who appears in each photo.

How to train photos on macos to recognize faces

You can even use this library with other Python libraries to do real-time face recognition:

See this example for the code.

User-contributed shared Jupyter notebook demo (not officially supported):

  • Python 3.3+ or Python 2.7
  • macOS or Linux (Windows not officially supported, but might work)

Installing on Mac or Linux

First, make sure you have dlib already installed with Python bindings:

Then, make sure you have cmake installed:

brew install cmake

Finally, install this module from pypi using pip3 (or pip2 for Python 2):

Alternatively, you can try this library with Docker, see this section.

If you are having trouble with installation, you can also try out a pre-configured VM.

Installing on an Nvidia Jetson Nano board

  • Jetson Nano installation instructions
    • Please follow the instructions in the article carefully. There is current a bug in the CUDA libraries on the Jetson Nano that will cause this library to fail silently if you don’t follow the instructions in the article to comment out a line in dlib and recompile it.

    Installing on Raspberry Pi 2+

    Installing on FreeBSD

    Installing on Windows

    While Windows isn’t officially supported, helpful users have posted instructions on how to install this library:

    Installing a pre-configured Virtual Machine image

    • Download the pre-configured VM image (for VMware Player or VirtualBox).

    When you install face_recognition , you get two simple command-line programs:

    • face_recognition – Recognize faces in a photograph or folder full for photographs.
    • face_detection – Find faces in a photograph or folder full for photographs.

    face_recognition command line tool

    The face_recognition command lets you recognize faces in a photograph or folder full for photographs.

    First, you need to provide a folder with one picture of each person you already know. There should be one image file for each person with the files named according to who is in the picture:

    How to train photos on macos to recognize faces

    Next, you need a second folder with the files you want to identify:

    How to train photos on macos to recognize faces

    Then in you simply run the command face_recognition , passing in the folder of known people and the folder (or single image) with unknown people and it tells you who is in each image:

    There’s one line in the output for each face. The data is comma-separated with the filename and the name of the person found.

    An unknown_person is a face in the image that didn’t match anyone in your folder of known people.

    face_detection command line tool

    The face_detection command lets you find the location (pixel coordinatates) of any faces in an image.

    Just run the command face_detection , passing in a folder of images to check (or a single image):

    It prints one line for each face that was detected. The coordinates reported are the top, right, bottom and left coordinates of the face (in pixels).

    Adjusting Tolerance / Sensitivity

    If you are getting multiple matches for the same person, it might be that the people in your photos look very similar and a lower tolerance value is needed to make face comparisons more strict.

    You can do that with the –tolerance parameter. The default tolerance value is 0.6 and lower numbers make face comparisons more strict:

    If you want to see the face distance calculated for each match in order to adjust the tolerance setting, you can use –show-distance true :

    If you simply want to know the names of the people in each photograph but don’t care about file names, you could do this:

    Speeding up Face Recognition

    Face recognition can be done in parallel if you have a computer with multiple CPU cores. For example, if your system has 4 CPU cores, you can process about 4 times as many images in the same amount of time by using all your CPU cores in parallel.

    If you are using Python 3.4 or newer, pass in a –cpus parameter:

    You can also pass in –cpus -1 to use all CPU cores in your system.

    You can import the face_recognition module and then easily manipulate faces with just a couple of lines of code. It’s super easy!

    Automatically find all the faces in an image

    See this example to try it out.

    You can also opt-in to a somewhat more accurate deep-learning-based face detection model.

    Note: GPU acceleration (via NVidia’s CUDA library) is required for good performance with this model. You’ll also want to enable CUDA support when compliling dlib .

    See this example to try it out.

    If you have a lot of images and a GPU, you can also find faces in batches.