Warning, /documentation/digikam-doc/main_window/people_view.rst is written in an unsupported language. File is not indexed.

0001 .. meta::
0002    :description: digiKam Main Window People View
0003    :keywords: digiKam, documentation, user manual, photo management, open source, free, learn, easy, faces, detection, recognition, management, deep-learning, people
0004 
0005 .. metadata-placeholder
0006 
0007    :authors: - digiKam Team
0008 
0009    :license: see Credits and License page for details (https://docs.digikam.org/en/credits_license.html)
0010 
0011 .. _people_view:
0012 
0013 People View
0014 -----------
0015 
0016 As long as you are not just taking pictures from machines or stars or something like that, Face Management might be an interesting feature for you (even with a machine there might be a human being operating it). In digiKam it consists of two tasks: **Face Detection** and **Face Recognition**.
0017 
0018 The face management workflow allows you to detect and recognize people in your photographs. Both features use a deep learning neural network in background. **Face Detection** allows digiKam to detect faces in your images. This step is required before being able to recognize faces. **Face Recognition** will automatically recognize people in your images, but it needs few items already trained for a same face name to be able to recognize new ones.
0019 
0020 .. important::
0021 
0022    To run properly, the face management needs the deep-learning models to download at the first run of digiKam. See :ref:`the Quick Start section <quick_start>` for details.
0023 
0024 .. _face_detection:
0025 
0026 Face Detection
0027 ~~~~~~~~~~~~~~
0028 
0029 The first step is to have digiKam finding all those pics that show faces not even knowing yet who's face it is. To prepare that process you click on **People** tab from left sidebar. On the bottom you have a settings view with a drop down menu where you can choose between:
0030 
0031     - **Skip Images Already Scanned**: choose this option if you haven't scanned yet or if the last scan yielded good results but you would like to scan new images.
0032 
0033     - **Scan Again And Merge Results**: choose this option if the results of the previous scan weren't accurate. This would re-scan all images again, and is time consuming.
0034 
0035     - **Clear Unconfirmed Results And Rescan**: remove all faces registered in database with no name and process again an analysis.
0036 
0037     - **Clear all Previous Results and Rescan**: remove all previous faces registered in database and process again an analysis.
0038 
0039 .. figure:: images/mainwindow_faces_settings1.webp
0040     :alt:
0041     :align: center
0042 
0043     The digiKam Face Management Workflow View
0044 
0045 The first option you would choose if you didn't scan yet or if you did with a satisfying result but added new photographs since then or if you already improved a search result, e.g. by removing face tags which obviously don't show a face. The second you would choose if you want the images already scanned to be included in the next scan. The third is more interesting in the context of Face Recognition since **Unconfirmed results** means face tags that don't have a name assigned to them yet.
0046 
0047 After the Face Scan is complete, you should see a new tag **Unknown** where the results of the face scan will appear. You may now manually identify a few of these faces and then proceed for face recognition. At least a minimum of **5 similar faces tagged** in different images must be trained for an automatic recognition workflow.
0048 
0049 .. note::
0050 
0051    In the **Settings** tab, you can also decide if you want to scan for face detection or for faces recognition.
0052 
0053 The **Settings** tab has another tab to tune where to search for new faces. You can make a selection of albums or tags to process the detection.
0054 
0055 .. figure:: images/mainwindow_faces_settings2.webp
0056     :alt:
0057     :align: center
0058 
0059     The digiKam Face Management Search-In View
0060 
0061 The last tab from the settings view allows to tune advanced configuration, as the accuracy used to identify a face in image, the deep-learning model to use for the faces workflow, and the ability to use all CPU core while computing.
0062 
0063 .. figure:: images/mainwindow_faces_settings3.webp
0064     :alt:
0065     :align: center
0066 
0067     The digiKam Face Management Settings View
0068 
0069 .. note::
0070 
0071    The deep-learning YOLO v3 model is more powerful but it's time and CPU consuming. Only turn on this option if you hardware can supports intensive computations. It's only used for face detection, especially to detect very small faces, blurry faces, or group photos with many faces.
0072 
0073 .. tip::
0074 
0075    Due to technical limitations under Windows, the multi-cores support with a Mysql/MariaDB database will not provide good performances. We recommend to use a SQlite database instead.
0076 
0077 For the task we are talking about you check **Detect Faces**, of course. Since face detection is a time-consuming task you better don't hit **Scan** right away, rather **Options**. An additional area will fold out organized with three tabs. In **Search-In** you can confine the scan to certain albums or tags. In **Settings** you can adjust the **Face Accuracy** with a balance between **Sensitivity** and **Specificity** that suits your needs. A higher specificity implies higher accuracy, however this results in a smaller set of results. Under Advanced you will find two check-boxes. The first is explained by the text above it. The second is for face recognition, see next chapter.
0078 
0079 Once you have chosen your options carefully you click **Scan** and after a while, depending on the scope of your selection, the result will be presented in the Image Area. In the Tags list of the Left Sidebar you will see the People branch of your tag tree. You will see the whole scan result only if the topmost tag **People** is selected. In the tree you will see a new virtual tag called **Unknown** which will show all those images where faces are recognized but not yet connected to a person. If you just scanned for the first time you will find the whole result also here.
0080 
0081 .. figure:: videos/mainwindow_faces_detection.webp
0082     :width: 600px
0083     :alt:
0084     :align: center
0085 
0086     Screencast of digiKam Faces Detection Process Running Over Collections and Populating the Database
0087 
0088 Note that the thumbnails presented here are not showing the whole image. They show the area of the image where the scan algorithm put down a **Face Tag**. You can see that if you click on the thumbnail. In the preview that opens you will see the whole image with all the face tags on them.
0089 
0090 .. |icon_showfacetags| image:: images/mainwindow_icon_showfacetags.webp
0091 
0092 If you don't see them, click the people button |icon_showfacetags| in the upper left corner of the preview. If there is more than one face tag on the image it will also be represented by more than one thumbnail. This is the case with the screenshot above take in preview mode.
0093 
0094 .. figure:: images/mainwindow_face_tag_editor_iconview.webp
0095     :alt:
0096     :align: center
0097 
0098     The digiKam Face Tags Edit From Icon-View
0099 
0100 If it really is a face the field labeled **Who Is This?** comes into play. Here you can either type in the name of an existing People tag out of your tag tree or use the drop down function to show your tag tree and select a tag. With **Confirm** you can save that to the database. If it was the only face tag (left) the image will disappear from the **Unknown** selection and you will find it once you select either the **People** tag or one of the tags you assigned to one of the face tags in that image.
0101 
0102 The list of detection samples below come from a huge collection of photo scanned with the Yolo v3 deep-learning model.
0103 
0104 ==== =========================================================== =============================================
0105  ID  Face Detected Samples                                       Comments
0106 ==== =========================================================== =============================================
0107  01  .. figure:: images/mainwindow_face_detection_sample_01.webp An under-exposed face
0108         :width: 64px
0109         :alt:
0110         :align: center
0111 ---- ----------------------------------------------------------- ---------------------------------------------
0112  02  .. figure:: images/mainwindow_face_detection_sample_02.webp A closed dog face
0113         :width: 64px
0114         :alt:
0115         :align: center
0116 ---- ----------------------------------------------------------- ---------------------------------------------
0117  03  .. figure:: images/mainwindow_face_detection_sample_03.webp A blured child face
0118         :width: 64px
0119         :alt:
0120         :align: center
0121 ---- ----------------------------------------------------------- ---------------------------------------------
0122  04  .. figure:: images/mainwindow_face_detection_sample_04.webp A non human face
0123         :width: 64px
0124         :alt:
0125         :align: center
0126 ---- ----------------------------------------------------------- ---------------------------------------------
0127  05  .. figure:: images/mainwindow_face_detection_sample_05.webp A very blured and partial face
0128         :width: 64px
0129         :alt:
0130         :align: center
0131 ---- ----------------------------------------------------------- ---------------------------------------------
0132  06  .. figure:: images/mainwindow_face_detection_sample_06.webp A rotated face
0133         :width: 64px
0134         :alt:
0135         :align: center
0136 ---- ----------------------------------------------------------- ---------------------------------------------
0137  07  .. figure:: images/mainwindow_face_detection_sample_07.webp A covered face with a hood
0138         :width: 64px
0139         :alt:
0140         :align: center
0141 ---- ----------------------------------------------------------- ---------------------------------------------
0142  08  .. figure:: images/mainwindow_face_detection_sample_08.webp An aside face
0143         :width: 64px
0144         :alt:
0145         :align: center
0146 ---- ----------------------------------------------------------- ---------------------------------------------
0147  09  .. figure:: images/mainwindow_face_detection_sample_09.webp An under-exposed and partial face
0148         :width: 64px
0149         :alt:
0150         :align: center
0151 ---- ----------------------------------------------------------- ---------------------------------------------
0152  10  .. figure:: images/mainwindow_face_detection_sample_10.webp A false positive detection
0153         :width: 64px
0154         :alt:
0155         :align: center
0156 ---- ----------------------------------------------------------- ---------------------------------------------
0157  11  .. figure:: images/mainwindow_face_detection_sample_11.webp A puppy's mouth
0158         :width: 64px
0159         :alt:
0160         :align: center
0161 ---- ----------------------------------------------------------- ---------------------------------------------
0162  12  .. figure:: images/mainwindow_face_detection_sample_12.webp A face covered by a racket
0163         :width: 64px
0164         :alt:
0165         :align: center
0166 ==== =========================================================== =============================================
0167 
0168 The screenshots **02** and **11** have been chosen because they show one important feature: the algorithm is able to find animal faces, and this is not a false positive, except if you want to see only human faces on your collection of course.
0169 
0170 The screenshot **10** is another example shows one important issue: the algorithm will find inevitably details in an image that resemble a face but are actually something else. That's what the **Remove** button is for. It will remove the face tag from the photograph and if it is the only face tag (left) the photograph will disappear from the scan result.
0171 
0172 The screenshots **01**, **03**, **05**, **08**, **09**, and **12** can be considered as non faces, or be prevented by reducing the **Accuracy** of detection in face management **Settings** view. But these examples prove the capability of algorithm to detect faces in critical shots conditions.
0173 
0174 The screenshots **04** and **10** are definitively false positive results.
0175 
0176 In the context menu of the preview there are two more items related to face tags: **Add A Face Tag** and **Clear All Faces** on this image.
0177 
0178 .. _face_recognition:
0179 
0180 Face Recognition
0181 ~~~~~~~~~~~~~~~~
0182 
0183 Assigning People tags to face tags is an important prerequisite to Face Recognition. Very obviously digiKam can only recognize faces if it has something to compare with. So it's up to you to show it the ropes, which means in this case to tell digiKam: This is Lara, this is Juan, this is Peter and so forth. For that you would, after performing a Face Detection as described in the previous article, typically select the **Unknown** tag on the Left Sidebar, click on a thumbnail and click, if necessary, on the Show Face Tags button |icon_showfacetags|.
0184 
0185 .. figure:: images/mainwindow_faces_tag_assigned_iconview.webp
0186     :alt:
0187     :align: center
0188 
0189     The digiKam Face Management Icon-View With Multiple Selection of Similar Faces to Tag With The Same **Agnès** Name
0190 
0191 Now you should see the face tags of that photograph. Those which have a people (or other) tag already assigned will simply show the name of that tag. The others, showing **Unknown** faces, will show a field and two buttons as in the screenshot of the previous article. In the field labeled **Who Is This?** you can either type in the name of an existing People tag out of your tag tree or use the drop down function to show your tag tree and select a tag. With **Confirm** you can save that to the database.
0192 
0193 .. figure:: images/mainwindow_faces_tag_confirmed_iconview.webp
0194     :alt:
0195     :align: center
0196 
0197     The digiKam Face Management Icon-View With a Confirmed Set of 12 Faces Using **Agnès** Name
0198 
0199 .. note::
0200 
0201     If you use the context menu item **Assign Tag** instead of the procedure described above that will not assign a face tag. It will assign an ordinary tag and it will assign it to the whole image.
0202 
0203 If a face tag is confirmed and thus showing only the name of the tag but not the buttons to remove, edit or confirm it, but you need this buttons because e.g. it's wrong and you want to edit or remove it, just double-click on the name and the buttons will re-appear.
0204 
0205 Once you have a tag assigned to a few photographs you can have digiKam looking if it can find more photographs showing the same face. To prepare that process you click **Scan Collection For Faces** but this time you select **Recognize Faces**.
0206 
0207 .. important::
0208 
0209     To be able to recognize a new face automatically, a minimum of 5 similar faces tagged in different images need to be previously trained to the deep-learning engine using manual face management workflow.
0210 
0211 To start the Face Recognition you click **Scan Collection For Faces** button. The process will tag every recognized face with the appropriate People tag out of your tag tree and the corresponding thumbnail will disappear from the **Unknown** tag selection.
0212 
0213 .. figure:: images/mainwindow_faces_tag_recognized_iconview.webp
0214     :alt:
0215     :align: center
0216 
0217     The digiKam Face Management Icon-View With New Recognized Automatically Faces as **Agnès** Name
0218 
0219 Face Recognition is faster than Face Detection but it still makes sense to click **Settings** and confine the scan to certain albums or tags in the Albums tab, e.g. to the **Unknown** tag. In the **Settings** tab we can play with the balance between speed and accuracy and two check-boxes. The first is explained by the text above it.
0220 
0221 .. note::
0222 
0223     Face recognition only works well with faces that have been automatically detected by digiKam, not with manually drawn face rectangles or faces from other programs.
0224 
0225 In case of unsatisfying results it might be helpful to use **Clear And Rebuild All Training Data**. One reason can be that there are too many face tags assigned to a person which shows this person in a way that doesn't really help the search algorithm, e.g. with sunglasses, blurred, unusual colors, carnival make up, dark shaded areas in the face, baby/kid/adult photographs mixed... Another reason to use that option can be false face recognition due to a wrong accuracy value in the **Settings** tab.
0226 
0227 .. figure:: images/mainwindow_faces_tag_validate_iconview.webp
0228     :alt:
0229     :align: center
0230 
0231     The digiKam Face Management Icon-View With New Recognized Faces to Confirm as **Agnès** Name
0232 
0233 To complete the recognition process, you will need to **Confirm** the new recognized faces. By applying the properties, new faces will be moved to the face tag definitively.
0234 
0235 The results of facial recognition appear in the form of unconfirmed results. These results will show up in the **Unconfirmed** tag, as well as in the tag of the person suggested for each face. Hovering over unconfirmed faces will display a few options:
0236 
0237     - The **Confirm** button allows you to confirm the suggestion. This would assign the suggested name to the face.
0238 
0239     - Use the **Reject** button, if the suggestion is incorrect. This would move the face back to **Unknown**.
0240 
0241     - Use the **Delete** button, if the suggestion is not a face. This will remove the face region from the database.
0242 
0243 About the face categorization and sorting, faces will appear by default categorized based on their name. You may change this behavior, by going to :menuselection:`View --> Separate Items`. Note that using a different categorization order will lead to **Confirmed** and **Unconfirmed** faces appearing mixed with one another. To change this behaviour you may modify the sorting order within each category by going to :menuselection:`View --> Sort Items --> By Face Type`.
0244 
0245 To improve results of face recognition, apart from using the settings mentioned previously, face results may also be improved by rebuilding the training data. This may be done through :menuselection:`Tools --> Maintenance --> Detect And Recognize Faces -> Clear And Rebuild All Training Data`.
0246 
0247 .. _manual_face_tagging:
0248 
0249 Manual Face Tagging
0250 ~~~~~~~~~~~~~~~~~~~
0251 
0252 digiKam allows for either manual face tagging.
0253 
0254 For more information about automatic face tagging using digiKam's face recognition engine see :ref:`the previous section <face_recognition>` of this manual.
0255 
0256 You can tag people manually by different way:
0257 
0258 - From **Preview Mode**: click on **Add a Face Tag** icon or select option on context menu, as highlighted on the screenshot below.
0259 
0260     .. figure:: images/mainwindow_addfacetag.webp
0261         :alt:
0262         :align: center
0263 
0264         The digiKam Manual Face Tagging From Context Menu
0265 
0266     And then draw a rectangle around the face while holding left mouse button followed by entering the person's name and pressing :kbd:`Enter` key. If you press :kbd:`Esc` key, this will leaves the person's name editor.
0267 
0268     .. figure:: images/mainwindow_face_region.webp
0269         :alt:
0270         :align: center
0271 
0272         The digiKam Manual Face Tagging Editor
0273 
0274     .. note::
0275 
0276         Instead of clicking on **Add A Face Tag** icon you can draw a face region while holding :kbd:`Ctrl` key.
0277 
0278     The **Preview Mode** context menu include also two other options to use during manual face tagging:
0279 
0280         - **Scan For Faces**: this option will call the face detection algorithm to set face areas automatically over the image. The faces are assigned by default to **Unknown** in the database. The last used **Faces Detection** settings will configure the process. If faces are found, you can edit manually the face name as explained previously.
0281 
0282         - **Show Face Tags**: this show the face areas visible and switch automatically in edit mode when mouse move over the areas.
0283 
0284 - From Left Sidebar **People** tab: use drag and drop between icon-view and face-tags tree-view. Select items labeled **Unknown** that you want to assign a face-tag. Perform a move with the mouse to the **People** items hierarchy. A pop-up menu will appears to confirm face assignment.
0285 
0286     .. figure:: videos/mainwindow_faces_drag_drop.webp
0287         :width: 600px
0288         :alt:
0289         :align: center
0290 
0291         Screencast of Manual Faces Assignment Using Drag And Drop
0292 
0293 - From keyboard shortcut: you can assign a magic key to a face-tag and quickly uses the keyboard to switch on the face-tag name to selected items.
0294 
0295     .. figure:: images/mainwindow_face_tag_properties.webp
0296         :alt:
0297         :align: center
0298 
0299         The digiKam Face Tag Properties Dialog With a Keyboard Shortcut Assigned
0300 
0301 - From The **Unknown** tag from **People** view: to manually identify a face, hover on any **Unknown** face from icon-view and use the text box to give it a name. This will lead to the creation of a face tag in case a person of that name doesn't exist already. For best results identify at least 4 faces for each person you want the scan to recognize.
0302 
0303     .. figure:: videos/mainwindow_face_tagging.webp
0304         :alt:
0305         :align: center
0306 
0307         Screencast of Manual Face Tagging From Icon-View
0308 
0309     .. note::
0310 
0311         In the :ref:`Miscs Behavior <behavior_settings>` view of the configuration dialog, an option can be turned on to only populate the tags tree-view with the face tags assigned to a face while you enter a name.
0312 
0313 In case there's a face you don't wish to be recognized, you can mark it as ignored. This leads to the creation of a new **Ignored** tag, you can later unmark the face if needed.
0314 
0315     .. figure:: images/mainwindow_faces_tag_ignored_iconview.webp
0316         :alt:
0317         :align: center
0318 
0319         A Face Marked as **Ignored** From Icon-View