Method for identifying a person based on a user photo and electronic device
Patent Information
- Application Number
- CN202410790151.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2044-06-18
Smart Images

Figure CN121214477B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method and electronic device for recognizing people based on user photos. Background Technology
[0002] Most electronic devices, such as smartphones and tablets, have photo and video recording functions, and more and more users are using these devices to capture photos and videos to record life's moments. As the number of photos increases, some electronic devices can summarize and categorize them, generating albums or videos on specific themes, thus providing users with a better experience. Summary of the Invention
[0003] This application provides a method and electronic device for identifying people based on user photos, which improves the accuracy of person recognition.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0005] In the first aspect, a method for identifying people based on user photos is provided and applied to electronic devices. The method includes: the electronic device obtaining N first person IDs from the user photo, where the N first person IDs correspond to N first persons, and each of the N first persons has multiple social relationships with other people in the user photo; N≥1, and N is a positive integer.
[0006] Then, the electronic device determines the target person ID from N first person IDs and identifies the person corresponding to the target person ID as the target person; wherein, the target person satisfies one or more of the following conditions: the gender of the target person is the same as the gender of the user pre-stored by the electronic device, the age of the target person matches the age of the user pre-stored by the electronic device, and the target person has established social relationships with multiple social circles; the target person identified by the electronic device is used to display a photo containing the target person on the screen of the electronic device after the electronic device receives the user's first operation.
[0007] Based on the first aspect, the electronic device first obtains N first-person IDs from the user's photo. The N first-person IDs correspond to the first person having multiple social relationships with others in the user's photo, indicating that the first person is likely to be the target person (for example). That is, the electronic device first identifies N first-person IDs that may be the owner of the device, and then identifies the target person ID that meets the conditions from the N first-person IDs, and identifies the person corresponding to the target person ID as the owner of the device. Since the conditions include one or more of the following: the gender of the target person is the same as the gender of the user, the age of the target person matches the age of the user, and the target person has established social relationships with multiple social circles, the accuracy of identifying the person (i.e., the owner of the device) can be improved.
[0008] Furthermore, since the target person identified by the electronic device is used to display a photo of the target person on the screen of the electronic device after the electronic device receives the user's first operation, the human-computer interaction experience can be improved.
[0009] In one possible implementation of the first aspect, the electronic device obtains N first person IDs from the user's photo, including: the electronic device obtains multiple sets of first persons from the user's photo; each set of first persons includes multiple person IDs; the electronic device determines whether the person corresponding to the multiple person IDs included in any set of first persons is a first person, thereby obtaining N first person IDs; or, the electronic device sequentially determines whether the person corresponding to the multiple person IDs included in each set of first persons is a first person, thereby obtaining N first person IDs.
[0010] In this implementation, the electronic device determines whether the person corresponding to multiple person IDs included in any first person set is the first person, so as to obtain N first person IDs, which can further reduce device power consumption; the electronic device sequentially determines whether the person corresponding to multiple person IDs included in each first person set is the first person, so as to obtain N first person IDs, which can improve the accuracy of the electronic device in determining the target person ID.
[0011] In one possible implementation of the first aspect, the first set of people includes x person IDs, where x is a positive integer; the electronic device determines whether the person corresponding to the multiple person IDs included in the first set of people is the first person, including: the electronic device iterates through each person ID in the x person IDs, removes the i-th person ID, and determines the first parameter corresponding to the first set of people; wherein, the first parameter is used to indicate the independence of the person IDs included in the first set of people from having social relationships with others after removing the i-th person ID; i∈[1,x]; if the first parameter is less than or equal to the first threshold, the electronic device determines that the person corresponding to the removed i-th person ID is the first person.
[0012] In this implementation, by iterating through each character ID in x character IDs, removing the i-th character ID, and then determining whether it is the first character based on the first parameter corresponding to the first character set, the accuracy of determining the first character can be improved.
[0013] In one possible implementation of the first aspect, the electronic device obtains multiple sets of first people from user photos, including: the electronic device generating multiple image sets based on photos in the user photos; wherein the shooting time interval between any two photos in the same image set does not exceed a preset interval, and the distance difference between the shooting positions of any two photos does not exceed a preset distance; the electronic device obtains the person IDs corresponding to the people included in the multiple image sets to obtain multiple image set sets; the electronic device merges image set sets with the same person ID in the multiple image set sets to obtain multiple sets of first people.
[0014] In this implementation, since the shooting time interval between any two photos in the same image set does not exceed a preset interval, and the distance difference between the shooting positions of any two photos does not exceed a preset distance, that is, multiple people in the same image set have taken photos at the same time and in the same position, multiple sets of first people are obtained based on the image set, which facilitates the improvement of the accuracy of subsequent identification of the device owner.
[0015] In one possible implementation of the first aspect, the electronic device determines the target person ID from N first person IDs and identifies the person corresponding to the target person ID as the target person, including: when N=1, if the gender of the person corresponding to the first person ID is the same as the user's gender and the age of the person corresponding to the first person ID matches the user's age, the electronic device identifies the first person ID as the target person ID and identifies the person corresponding to the target person ID as the target person.
[0016] Optionally, when N≥2, the electronic device determines M second person IDs from N first person IDs; where the gender of each second person ID in the M second person IDs is the same as the user's gender, and the age of the corresponding person matches the user's age; M≥1, M<N, and M is a positive integer; the electronic device determines the target person ID from the M second person IDs and identifies the person corresponding to the target person ID as the target person.
[0017] In one possible implementation of the first aspect, the electronic device determines the target person ID from M second person IDs and identifies the person corresponding to the target person ID as the target person, including: when M=1, if the number of circles with which the person corresponding to the second person ID has established social relationships with the social circle exceeds a preset threshold, the electronic device identifies the second person ID as the target person ID and identifies the person corresponding to the target person ID as the target person; when M≥2, the electronic device identifies the second person ID with the largest number of circles with established social relationships among the M second person IDs as the target person ID and identifies the person corresponding to the target person ID as the target person.
[0018] In this implementation, the electronic device first determines M second-person IDs, and the person corresponding to these M second-person IDs is most likely to be the owner of the device. Then, the electronic device identifies the owner of the device based on the number of social circles that have established social relationships with the M second-person IDs, thereby improving the accuracy of owner identification.
[0019] In one possible implementation of the first aspect, the method further includes: an electronic device acquiring multiple sets of second persons; wherein the multiple sets of second persons are sets of persons obtained by removing N first person IDs from multiple sets of first persons; and the electronic device merging the sets of second persons with the same ID from the multiple sets of second persons to obtain multiple social circles.
[0020] In this implementation, clustering circles in the manner described above can improve the accuracy of the social circles obtained through clustering.
[0021] In one possible implementation of the first aspect, the electronic device merges multiple sets of second persons with the same person ID to obtain multiple social circles. This includes: the electronic device merging multiple sets of second persons with the same person ID, the merged set of second persons corresponding to a second parameter; wherein the second parameter is used to indicate the independence of social relationships between the persons whose person IDs are included in the merged set and others; if the second parameter is less than or equal to a second threshold, the electronic device retains the merged set of second persons; the electronic device uses the result of the previous merge to continue merging two sets of second persons with the same person ID until the number of sets after the previous merge is the same as the number of sets after the current merge, then the loop stops to obtain multiple social circles.
[0022] In this implementation, the accuracy of the social circles obtained by clustering can be further improved through the above iterative method.
[0023] In a second aspect, an electronic device is provided, which has the functions described in any one of the first aspects above. These functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions.
[0024] Thirdly, an electronic device is provided, comprising: a memory and one or more processors; the memory stores computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the electronic device performs the method described in any one of the first aspects.
[0025] Fourthly, a chip system is provided for use in an electronic device, the chip system comprising: at least one processor and an interface for receiving instructions and transmitting them to the at least one processor; the at least one processor executes instructions to cause the electronic device to perform the method described in any one of the first aspects.
[0026] Fifthly, a computer-readable storage medium is provided that stores instructions which, when executed on a computer, cause the computer to perform the method described in any one of the first aspects.
[0027] In a sixth aspect, a computer program product containing instructions is provided, which, when run on a computer, enables the computer to perform the method described in any one of the first aspects above.
[0028] The technical effects of any of the implementation methods in the second to sixth aspects mentioned above can be referred to the technical effects of different implementation methods in the first aspect, and will not be elaborated here. Attached Figure Description
[0029] Figure 1 A scenario diagram provided for an embodiment of this application;
[0030] Figure 2 This is another scenario illustration provided for an embodiment of this application;
[0031] Figure 3 This application provides a schematic diagram of the movement trajectory of a device owner.
[0032] Figure 4 A flowchart illustrating a method for identifying people based on user photos, provided in an embodiment of this application;
[0033] Figure 5 A flowchart illustrating another method for identifying people based on user photos provided in this application embodiment;
[0034] Figure 6 A schematic diagram of a person-social circle provided for an embodiment of this application;
[0035] Figure 7 A schematic diagram of a social circle provided for an embodiment of this application;
[0036] Figure 8 A flowchart illustrating another method for identifying people based on user photos provided in this application embodiment;
[0037] Figure 9 A flowchart illustrating another method for identifying people based on user photos provided in this application embodiment;
[0038] Figure 10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0039] Figure 11 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0040] The method for recognizing people based on user photos provided in this application can be applied to electronic devices such as smartphones, personal digital assistants (PDAs), laptops, tablets, handheld computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, PDAs, and augmented reality (AR) / virtual reality (VR) devices. This application does not impose any special limitations on the specific form of the electronic device.
[0041] It should be noted that, in the embodiments of this application, user photos can be saved in the phone's gallery application, the phone's photo album application, or other applications used for saving user photos, without limitation. The name of the application used for saving user photos is not limited; the aforementioned gallery application, photo album application, etc., can also have other names, which will not be elaborated here. The following embodiments all illustrate the example of user photos being saved in the gallery application.
[0042] The following uses a mobile phone as an example to introduce the scenarios involved in the embodiments of this application.
[0043] Scenario 1: Generating a specific themed album in a photo gallery application.
[0044] In some embodiments, the gallery app may provide the ability to generate albums with different themes. For example, in response to a user opening the gallery app, the phone displays... Figure 1 The interface 101 shown includes a control 102, which displays a photo album containing multiple themes after receiving a user's operation. The name of the control 102 can be anything such as "Moments," "Highlights," or "Memories," and is not limited in scope. Figure 1 The following example illustrates the concept of control 102 named "Moment". Optionally, in response to user interaction with control 102, the phone displays... Figure 1The interface 103 shown includes multiple themed albums. For example, interface 103 includes an album themed "Me", an album themed "My Children", and an album themed "Happy Chinese New Year". Of course, in actual implementation, interface 103 may also include more or fewer themed albums than shown, or include albums with other themes, such as "Weekend Time", etc., and there is no limit to the number of albums.
[0045] Optionally, the phone can select photos containing "Me" from the gallery app to create a "Me" album. Similarly, the phone can select photos containing "My Children" from the gallery app to create a "My Children" album. Likewise, the phone can select photos taken during the Spring Festival period from the gallery app to create a "Happy Chinese New Year" album. Alternatively, the phone can select photos taken on a weekend from the gallery app to create a "Weekend Moments" album.
[0046] It should be noted that, in this embodiment of the application, "I" can be used to refer to the owner of the phone, that is, the person who uses the phone. "My child" can be used to refer to the owner's child.
[0047] Scene 2: Smartly integrated scenes.
[0048] Among these, "Smart Video Creation" refers to a mobile phone that supports voice control. It can capture the user's voice through a microphone, retrieve corresponding photos from a photo library app based on the user's voice input, and generate a video. Optionally, in the Smart Video Creation scenario, the phone can also perform functions such as dialogue with the user.
[0049] It should be noted that the name of the "Smart Screen" may differ between different manufacturers' phones. For example, the aforementioned "Smart Screen" could also be called Smart Assistant, Smart Application, Voice Assistant, etc., without restriction.
[0050] For example, once voice control is enabled, the phone can receive voice input from the user, including instructions for the phone owner. In response to the voice, the phone retrieves a photo containing the owner from the gallery app and displays it on the phone's screen. Optionally, the phone can also generate a video containing the owner based on the photo and display it on the phone's screen to improve the human-computer interaction experience.
[0051] To conserve power and prevent accidental activation, the phone can respond to a preset word (or wake-up word, such as "Hello, YOYO") entered by the user to activate the voice control function. Alternatively, the phone can respond to a preset operation entered by the user to activate the voice control function. Optionally, this preset operation could be turning on a preset switch in the human-computer interaction interface; or, this preset operation could be an operation on the power button (or power button) (such as a long press).
[0052] In some embodiments, after the phone is woken up, it can receive voice input from the user and execute the corresponding command in response to the voice. Once the phone has executed the command, or if the phone has been woken up for more than a preset duration (e.g., 8 seconds), the phone disables voice control and stops receiving voice input from the user. If the user wants to control the phone via voice again, they need to wake the phone up again to enable voice control, and only then can the phone receive voice input from the user again. In other words, after the phone is woken up, it enters a "short reception" state, during which it can receive voice input from the user for a period of time (e.g., 8 seconds).
[0053] In other embodiments, the phone supports entering a continuous dialogue scenario after being woken up, allowing users to engage in ongoing conversations. For example, when the phone is connected to the network, it will continue recording audio after each response to user-inputted voice, without requiring the user to repeatedly wake the phone up. The continuous dialogue can only be exited by the user disabling the voice control function. This avoids the need for repeated phone wake-ups, improving both the user experience and the efficiency of human-computer interaction.
[0054] Optionally, the mobile phone receives voice input 'a' from the user, where voice input 'a' includes information instructing the phone owner. For example, voice input 'a' could be "Generate a video from my photos". Optionally, after receiving voice input 'a', the mobile phone can recognize voice input 'a' to identify 'I' as the phone owner. For example, when voice input 'a' matches keywords included in the phone owner database, the mobile phone recognizes 'I' as the phone owner. For instance, keywords in the phone owner database include 'me', 'myself', 'myself', etc., and the 'me' included in voice input 'a' matches the keyword 'me' in the phone owner database, therefore the mobile phone can recognize 'I' as the phone owner.
[0055] Optionally, the phone can also perform semantic understanding on voice 'a'. Voice 'a' doesn't need to be completely identical to the database, as long as the semantics are similar or close. That is, voice 'a' matches the database, but doesn't have to be exactly the same. For example, voice 'a' includes the word "I," and the keywords in the phone owner's database include "myself," "myself," and "myself." Since "I" has the same semantic meaning as "myself," "myself," and "myself," they match. Therefore, the phone can recognize that "I" is information indicating the phone owner, thus determining that "I" is used to instruct the phone owner.
[0056] Optionally, after receiving voice input 'a' from the user, the mobile phone can recognize and parse voice 'a' to identify "I" as an instruction to the phone owner. For example, after receiving voice 'a', the mobile phone uses automatic speech recognition (ASR) technology to convert the user's speech into text, and then uses natural language understanding (NLU) technology to perform intent recognition on the converted text, thereby identifying "I" as an instruction to the phone owner.
[0057] In some embodiments, in a smart display scenario, the phone can display [the following information] after being woken up: Figure 2 The interface 201 shown is used to display the dialogue content between the mobile phone and the user during a continuous conversation. Optionally, interface 201 includes a prompt message 202, which prompts the user that the mobile phone has entered a continuous conversation scenario. For example, the prompt message 202 could be "Welcome". Optionally, interface 201 also includes a prompt icon 203, which prompts the user that the mobile phone has entered continuous audio recording mode. For example, the prompt icon 203 could be a microphone icon or a robot audio recording icon, etc., without limitation.
[0058] For example, during the process of the mobile phone receiving voice input from the user, the mobile phone displays... Figure 2 The interface 204 shown is used to notify the user that the microphone is recording sound. Optionally, such as... Figure 2 As shown, interface 204 includes a notification icon 205, which consists of gradually decreasing transparent circles displayed horizontally along the path of notification icon 203, used to notify the user that the microphone is recording sound. Optionally, text information corresponding to voice 'a' is also displayed above notification icon 205.
[0059] For example, the mobile phone receives a user's voice input "a". In response to voice "a", the mobile phone displays interface 206, which includes text information corresponding to voice "a". For example, the text information could be "Generate a video from my photos". Accordingly, in response to voice "a", the mobile phone recognizes "I" in voice "a" to indicate the owner. Then, the mobile phone selects a photo containing the owner from the gallery application and displays it on interface 206. Optionally, before displaying the photo containing the owner, the mobile phone can also display the response information for voice "a". For example, the response information could be "Okay, the following materials have been found for you". This can further enhance the human-computer interaction experience.
[0060] For example, interface 206 also includes control 1 and control 2. Control 1 is used to trigger the phone to display all photos containing the owner's photos, and control 2 is used to trigger the phone to generate a video based on the photos containing the owner's photos. Optionally, such as... Figure 2 As shown, the name of control 1 could be, for example, "View All," and the name of control 2 could be, for example, "Generate Video." In response to the user's operation on control 2, the phone displays interface 207, which includes a thumbnail of video a. Video a is generated by the phone based on a photo containing the phone's owner. Optionally, interface 207 includes control 3, which is used to trigger the phone to play video a.
[0061] As can be seen, in the scenarios involved in this application embodiment, the mobile phone needs to identify various people in the photos stored in the gallery application. For example, the mobile phone needs to identify the phone owner, the phone owner's children, the phone owner's spouse, the phone owner's parents, etc., without limitation. Subsequently, in the application of the above scenarios, the mobile phone can directly obtain photos containing the corresponding people from the gallery application to improve the human-computer interaction experience.
[0062] Taking the identification of the phone owner corresponding to a person in a photo gallery application as an example, in some embodiments, the phone can identify the phone owner corresponding to a person in a photo gallery application based on the owner's movement trajectory. For example, such as... Figure 3 As shown, this application provides a method for tracking the movement trajectory of a mobile phone owner. The owner carries the phone while traveling, and the owner's movement trajectory is essentially the same as the phone's movement trajectory; the two are equivalent. The owner's movement trajectory can be determined by the spatial location of the phone at different points in time. Based on this, as... Figure 3 As shown, the mobile phone can determine the owner's home and workplace locations through automated learning based on the owner's movement trajectory. Optionally, the mobile phone can also determine other locations, such as restaurants, shopping malls, and tourist attractions, based on the owner's movement trajectory through automated learning, without limitation.
[0063] Furthermore, the phone identifies the owner of the photos in the gallery app based on the shooting location and time, as well as the owner's home and workplace locations. However, some phone users (i.e., the owners) do not have a fixed workplace, and some photos in the gallery app were taken a long time ago, which limits the effectiveness of this method for identifying the owner.
[0064] In other embodiments, the phone can calculate the intimacy between any two people in a photo based on the shooting time and location of the photo in the gallery application, and identify the person whose shooting time and location are most evenly distributed as the phone owner. However, this solution has limited applicability. For example, some phone users do not take photos frequently due to work or other reasons; instead, their spouses or children often use the user's phone to take photos, resulting in the person whose shooting time and location are evenly distributed not being the actual phone owner.
[0065] Based on this, embodiments of this application provide a method for identifying people based on a photo gallery application, which can improve the accuracy of identifying people (such as the owner of a device) and make the applicability of person identification more comprehensive. This method can be executed by electronic devices that support voice interaction, such as mobile phones, tablets, and smartwatches; it can also be executed by chips, chip systems, or processors capable of implementing this method; or it can be executed by logic modules or software capable of implementing all or part of the functions of electronic devices, without limitation. The following embodiments use a mobile phone as the execution subject to provide a detailed description of the solution for identifying people based on a photo gallery application provided in this application.
[0066] Figure 4 This is a flowchart illustrating a method for identifying people based on an image library application, provided as an embodiment of this application. Figure 4 As shown, the method includes:
[0067] S301. The mobile phone obtains N first-person IDs from the Gallery application.
[0068] Among them, N first person IDs correspond to N first persons, and each of the N first persons has multiple social relationships with others in the photo library application; N≥1, and N is a positive integer.
[0069] In this embodiment, the first person corresponding to the N first person IDs can also be called a "super user," "super person," "central person," etc., without limitation. Here, the first person refers to a person who has social relationships with other people in the gallery application.
[0070] It is understandable that most photos saved in a phone's gallery app are either photos of the phone owner themselves or photos of people with whom the owner has a certain social relationship, such as photos of the owner's children or spouse. In other words, in this embodiment, since the first person has multiple social relationships with others in the gallery app, it is highly likely that the first person corresponding to the N first person IDs obtained by the phone from the gallery app is the phone owner.
[0071] In some embodiments, the mobile phone obtains N first-person IDs from the gallery application, including: the mobile phone obtains multiple first-person sets from the gallery application, and each of the multiple first-person sets includes multiple person IDs. That is, a first-person set refers to a set of multiple person IDs.
[0072] It should be noted that a person ID refers to a unique identifier for a person; that is, one person ID can be used to identify a person. The person ID can be represented as tag_id, person_id, etc., without restriction. The following example uses person_id as an illustration; for ease of explanation, person_id can be simplified to p.
[0073] For example, multiple sets of first characters may include: character set 1 = {p0, p1, p2}, character set 2 = {p0, p3}, character set 3 = {p1, p3}, character set 4 = {p0, p1, p4}, character set 5 = {p0, p1, p4, p5}, etc. The above are merely examples of multiple sets of first characters and do not constitute a limitation on this application.
[0074] Optionally, the mobile phone obtains multiple sets of first-person images from the gallery application, including: the mobile phone generates multiple image sets based on photos in the gallery application; wherein the shooting time interval between any two photos in the same image set does not exceed a preset interval, and the distance difference between the shooting positions of any two photos does not exceed a preset distance.
[0075] For example, in a photo gallery application, the phone sorts photos according to the shooting time of each photo. For every two photos, the phone determines the shooting time interval between them. If the shooting time interval does not exceed a preset interval, the phone groups the two photos into the same album. Conversely, if the shooting time interval exceeds the preset interval, the phone groups the two photos into different albums.
[0076] After grouping the two photos into the same image set based on their shooting time, the phone determines the distance difference between the shooting locations of the two photos. If the distance difference does not exceed a preset distance, the phone keeps the two photos in the same image set. Conversely, if the distance difference exceeds a preset distance, the phone groups the two photos into different image sets.
[0077] Based on the above method, after the mobile phone generates multiple image sets, since each image set includes multiple photos, each photo corresponds to at least one person, and each person corresponds to a person ID, the mobile phone can obtain the person IDs corresponding to the people included in each image set to obtain multiple image set collections. In other words, each image set in the multiple image set collections refers to a collection of multiple person IDs.
[0078] For example, multiple atlas sets may include: atlas set 1 = {p0, p1, p2}, atlas set 2 = {p0, p1, p2}, atlas set 3 = {p0, p3}, atlas set 4 = {p1, p3}, atlas set 5 = {p0, p1, p4}, atlas set 6 = {p0, p1, p4, p5}, etc. The above are merely examples of multiple atlas sets and do not constitute a limitation on this application.
[0079] After obtaining multiple image sets, the phone merges image sets with the same person ID from these sets to obtain multiple first person sets. For example, since image set 1 and image set 2 contain the same person ID, they can be merged to obtain the aforementioned person set 1.
[0080] In some embodiments, after the mobile phone obtains multiple sets of first people from the gallery application, the mobile phone determines whether the person corresponding to the multiple person IDs included in any set of first people is the first person, thereby obtaining N first person IDs. For example, the mobile phone can determine whether the person corresponding to the multiple person IDs (i.e., p0, p1, p2) included in person set 1 is the first person, thereby obtaining N first person IDs; or, the mobile phone can determine whether the person corresponding to the multiple person IDs (i.e., p0, p3) included in person set 2 is the first person, thereby obtaining N first person IDs; of course, the mobile phone can also determine whether the person corresponding to the person in person set 3, person set 4, or person set 5 is the first person, thereby obtaining N first person IDs, which will not be elaborated further.
[0081] Alternatively, the phone sequentially checks whether the person corresponding to the multiple person IDs included in each of the multiple first person sets is the first person, thereby obtaining N first person IDs. Taking the above five person sets as an example, the phone sequentially checks whether the person corresponding to the multiple person IDs (i.e., p0, p1, p2) included in person set 1 is the first person, whether the person corresponding to the multiple person IDs (i.e., p0, p3) included in person set 2 is the first person, whether the person corresponding to the multiple person IDs (i.e., p1, p3) included in person set 3 is the first person, whether the person corresponding to the multiple person IDs (i.e., p0, p1, p3, p4) included in person set 4 is the first person, and whether the person corresponding to the multiple person IDs (i.e., p0, p1, p4, p5) included in person set 5 is the first person, thereby obtaining N first person IDs.
[0082] In some embodiments, such as Figure 5As shown, the first set of people includes x person IDs. The mobile phone determines whether the person corresponding to any of the multiple person IDs in the first set is the first person by: traversing each of the x person IDs, removing the i-th person ID, and determining the first parameter corresponding to the first set of people; if the first parameter is less than or equal to a first threshold, the mobile phone determines that the person corresponding to the removed i-th person ID is the first person. Conversely, if the first parameter is greater than the first threshold, the mobile phone determines that the person corresponding to the removed i-th person ID is not the first person; i∈[1, x].
[0083] The first parameter indicates the independence of social relationships between the individuals corresponding to the i-th individual IDs in the first set of individuals and others. It should be noted that the fewer connections the i-th individual ID has with other individuals outside the first set of individuals, the larger the first parameter; conversely, the more connections the i-th individual ID has with other individuals outside the first set of individuals, the smaller the first parameter.
[0084] Optionally, the first parameter can be represented by the following expression:
[0085] Where AtomicVal represents the first parameter, len(Setx) represents the number of character IDs included in the first character set, and CoCnt(i,j) represents the number of times the i-th character ID and the corresponding character of the j-th character ID co-occur. Co-occurrence refers to the number of times the i-th character ID and the corresponding character of the j-th character ID appear in the same character set.
[0086] Here, the j-th character ID refers to the character ID in any character set other than the first character set.
[0087] Taking multiple sets of characters, including the aforementioned set 1 = {p0, p1, p2}, set 2 = {p0, p3}, set 3 = {p1, p3}, set 4 = {p0, p1, p3, p4}, and set 5 = {p0, p1, p4, p5}, as an example, for example, in set 1 = {p0, p1, p2}, for p0 in set 1, the co-occurrence count of p0 and p3 is 1, the co-occurrence count of p0 and p4 is 2, and the co-occurrence count of p0 and p5 is 1. Then, the total number of times the character ID (p0) in set 1 co-occurs with the character ID outside set 1 (i.e., the j-th character ID, such as p3, p4, p5) is 1 + 2 + 1 = 4.
[0088] Correspondingly, for p1 in character set 1, the co-occurrence count of p1 and p3 is 1, the co-occurrence count of p1 and p4 is 2, and the co-occurrence count of p1 and p5 is 1. Therefore, the total number of times that character ID (p1) in character set 1 co-occurs with character IDs outside character set 1 (i.e., the j-th character ID, such as p3, p4, p5) is 1+2+1=4.
[0089] Correspondingly, for p2 in character set 1, the co-occurrence count of p2 and p3 is 0, the co-occurrence count of p2 and p4 is 0, and the co-occurrence count of p2 and p5 is 0. Therefore, the total number of times character ID (p2) in character set 1 co-occurs with character IDs outside character set 1 (i.e., the j-th character ID, such as p3, p4, p5) is 0.
[0090] Thus, the total number of times each character ID in character set 1 co-occurs with any other character ID outside of character set 1 is 8. In other words, the number of times each character in character set 1 = {p0, p1, p2} co-occurs with each character in other character sets is 8.
[0091] Based on this, for the character set 1 = {p0, p1, p2}, i.e., x = 3, then when i = 1, after removing the first character ID (i.e., p0), as shown in the above example, the co-occurrence frequency of each character in character set 1 = {p1, p2} with each character in other character sets is 4. Therefore, after removing the character ID (such as p0), the first parameter corresponding to character set 1 is 4 / 8 = 0.5.
[0092] Accordingly, when i=2, after removing the second character ID (i.e., p1), as shown in the above example, the number of times each character in character set 1 = {p0, p2} co-occurs with each character in other character sets is 4. Therefore, after removing the character ID (such as p1), the first parameter corresponding to character set 1 is 4 / 8 = 0.5.
[0093] Accordingly, when i = 3, after removing the third character ID (i.e., p2), as shown in the above example, the number of times each character in character set 1 = {p0, p1} co-occurs with each character in other character sets is 8. Therefore, after removing the character ID (such as p2), the first parameter corresponding to character set 1 is 8 / 8 = 1.
[0094] Based on the above, assuming the first threshold is 0.5, then for the set of people 1 = {p0, p1, p2}, the phone can determine that the people corresponding to p0 and p1 are the first person (or super user). In other words, after removing p0 and p1, the co-occurrence frequency between each person in set 1 and each person in other sets decreases significantly. This indicates that the connection between each person in set 1 and each person in other sets (which can be understood as people outside the sets, i.e., external people) is mainly due to the existence of p0 and p1. Therefore, the people corresponding to p0 and p1 are highly likely to be the phone owner, and thus, the people corresponding to p0 and p1 can be identified as the first person.
[0095] It should be noted that the above example uses a first threshold of 0.5 as an illustration. Of course, the first threshold can be other values, depending on the actual implementation, and is not limited thereto. For example, the first threshold can also be 0.3 or 0.4, etc.
[0096] Understandably, in one example, the phone determines whether the person corresponding to multiple person IDs in any set of people is the first person. For example, after determining whether the person corresponding to the three person IDs in set 1 is the first person, the phone stops determining the person corresponding to the person IDs in other sets of people. In another example, the phone sequentially determines whether the person corresponding to multiple person IDs in each set of people is the first person. For example, after determining whether the person corresponding to the three person IDs in set 1 is the first person, the phone sequentially determines the person corresponding to the person IDs in sets 2, 3, 4, and 5. The specific implementation process can be referred to the above embodiments, and will not be repeated here.
[0097] Using the above method, after determining whether the multiple IDs in the first person set correspond to the first person, the mobile phone uses the ID of the person corresponding to the first person as the first person ID, thus obtaining N first person IDs.
[0098] S302. The mobile phone determines the target person ID from N first person IDs and identifies the person corresponding to the target person ID as the target person.
[0099] Among them, the target person meets one or more of the following conditions: the gender of the target person is the same as the gender of the users pre-stored on the mobile phone; the age of the target person matches the age of the users pre-stored on the mobile phone; the target person has established social relationships with multiple social circles.
[0100] Optionally, the user's gender and age pre-stored on the phone are learned by the phone based on the user's usage habits. For example, the phone learns this information from the user's usage records of applications (apps) installed on the phone.
[0101] Optionally, matching the target person's age with the user's age includes: the target person's age being the same as the user's age; or, the difference between the target person's age and the user's age being within a certain range, etc., without restriction. Alternatively, the user's age is within a certain age range, and the target person's age is within that range.
[0102] In some embodiments, when N=1, that is, when the mobile phone determines a first person ID, if the gender of the person corresponding to the first person ID is the same as the user's gender and the age of the person corresponding to the first person ID matches the user's age, the mobile phone determines the first person ID as the target person ID and determines the person corresponding to the target person ID as the target person (such as the owner of the phone; the following will use the target person as the owner of the phone for illustration).
[0103] It should be noted that, in order to improve the accuracy of the identified owner, this embodiment of the application only identifies the person corresponding to the first person ID as the owner if the gender of the person corresponding to the first person ID is the same as the user's gender and the age of the person corresponding to the first person ID matches the user's age. Optionally, if the gender of the person corresponding to the first person ID is different from the user's gender, or if the age of the person corresponding to the first person ID does not match the user's age, the phone can stop the owner identification process.
[0104] In other embodiments, when N≥2, the phone determines M second-person IDs from N first-person IDs. Each of the M second-person IDs corresponds to a person whose gender matches the user's gender, and whose age matches the user's age; M≥1, M<N, and M is a positive integer. In other words, the phone selects M second-person IDs from the N first-person IDs whose corresponding persons have the same gender and age as the user, and these M second-person IDs have the highest probability of corresponding to the phone owner.
[0105] Then, the mobile phone determines the target person ID from the M second person IDs, and identifies the person corresponding to the target person ID as the owner of the phone.
[0106] Optionally, when M=1, if the number of social circles where the person corresponding to the second person ID has established a social relationship exceeds a preset threshold, the electronic device will identify the second person ID as the target person ID and identify the person corresponding to the target person ID as the device owner.
[0107] Optionally, when M≥2, the mobile phone will identify the second person ID with the most social relationships among the M second person IDs as the target person ID, and identify the person corresponding to the target person ID as the target person.
[0108] In this context, "social circle" refers to the circle in which a user interacts with others; that is, the scope of a user's social interactions. Based on this concept, people in a mobile photo gallery app can form different circles based on whether they have taken photos with the user, such as the user's colleagues' circle, friends' circle, family circle, and the user's children's classmates' circle. In other words, the user is connected to all or most of these circles. For example, after obtaining the social circle, the user can be identified based on the social circle and added to the social circle graph, thus obtaining... Figure 6 The diagram shown illustrates the relationship between the device owner and their social circle.
[0109] For example, Figure 6 In the relationship diagram of the phone owner and their social circle shown, circles represent people, such as the phone owner, their child, their spouse, and their colleagues. A line connecting two circles indicates a connection between the two people, such as having taken a photo together.
[0110] In some embodiments, the mobile phone can rely on community detection technology to perform circle clustering to obtain at least one social circle. The result of community detection is multiple communities, each community corresponding to a social circle, and each social circle includes at least one person. For example, such as... Figure 7 As shown, community discovery technology clusters each person into a specific circle, thus obtaining at least one social circle.
[0111] Optionally, community detection can be performed using the Louvain algorithm to obtain at least one social circle. Alternatively, community detection can also be performed using the Leiden algorithm.
[0112] In other embodiments, the mobile phone can also perform circle clustering based on the aforementioned multiple sets of first persons to obtain multiple social circles. For example, the mobile phone removes N first person IDs from the multiple sets of first persons to obtain multiple sets of second persons. Then, the mobile phone merges the sets of second persons that contain the same person ID to obtain multiple social circles.
[0113] Taking the aforementioned sets of first characters as an example: character set 1 = {p0, p1, p2}, character set 2 = {p0, p3}, character set 3 = {p1, p3}, character set 4 = {p0, p1, p3, p4}, character set 5 = {p0, p1, p4, p5}, and N first character IDs including p0 and p1, after removing p0 and p1, the resulting sets of second characters can include: character set 1a = {p2}, character set 2a = {p3}, character set 3a = {p3}, character set 4a = {p3, p4}, character set 5a = {p4, p5}.
[0114] It can be seen that character sets 2a, 3a, and 4a share the same character ID (p3). Therefore, character sets 2a, 3a, and 4a can be merged to obtain a social circle = {p3, p4}. Correspondingly, the merged social circle {p3, p4} shares the same character ID (p4) with character set 5a. Therefore, social circle {p3, p4} can be merged with character set 5a to obtain a social circle = {p3, p4, p5}. Based on this embodiment, the social circle obtained by the mobile phone includes {p2} and {p3, p4, p5}.
[0115] Optionally, the mobile phone merges multiple sets of second people with the same person ID and determines a second parameter corresponding to the merged set of second people. If the second parameter is less than or equal to a second threshold, the mobile phone uses the merged set of second people as a social circle to obtain multiple social circles. The second parameter indicates the independence of social relationships between the person IDs included in the merged set of second people and others.
[0116] For example, such as Figure 8 As shown, the mobile phone can use an iterative loop to merge two sets of second people with the same person ID to obtain multiple social circles. For example, the iterative process includes: the mobile phone merges two sets of second people with the same person ID and determines a second parameter corresponding to the merged set; if the second parameter is less than or equal to a second threshold, the merged set is retained. The mobile phone uses the result of the previous merge to continue merging two sets of second people with the same person ID until the number of sets after the previous merge is the same as the number of sets after the current merge, at which point the loop stops.
[0117] Optionally, if the second parameter is greater than the second threshold, the two sets of second characters to be merged are cancelled.
[0118] Taking multiple sets of second characters including {p2}, {p3}, {p3}, {p3, p4}, and {p4, p5} as an example, the set of second characters obtained after the first iteration includes {p2}, {p3}, {p3, p4}, and {p4, p5}, meaning that the first iteration merges the two {p3} sets together. It should be noted that if the character IDs corresponding to the two sets of second characters are exactly the same, then the second parameter does not need to be calculated after merging, and the merged result is directly retained.
[0119] Accordingly, the second set of characters obtained after the second loop includes: {p2}, {p3, p4}, and {p4, p5}, meaning that {p3} and {p3, p4} are merged together in the second iteration. For example, {p3} co-occurs 3 times with character IDs outside this set, {p3, p4} co-occurs 1 time with character IDs outside this set, and the merged set {p3, p4} co-occurs 1 time with character IDs outside this set. Therefore, the second parameter is 1 / 4 = 0.25. Assuming the second threshold is 1.2, since the second parameter (0.25) is less than the second threshold (1.2), the merged set is retained, i.e., the second set of characters obtained after the second loop is retained. Furthermore, the phone uses the second set of characters obtained after the second loop to continue merging two second sets of characters that have the same character ID.
[0120] For example, the second set of characters obtained after the third iteration includes {p2} and {p3, p4, p5}, meaning that {p3, p4} and {p4, p5} are merged together in the third iteration. For example, {p3, p4} has a co-occurrence count of 1 with a character ID outside this set, and {p4, p5} has a co-occurrence count of 1 with a character ID outside this set. However, the merged set {p3, p4, p5} has a co-occurrence count of 0 with a character ID outside this set. Therefore, the second parameter is 0 / 2 = 0, which is less than the second threshold. Thus, the merged set is retained, i.e., the second set of characters obtained after the third iteration is retained. Furthermore, the phone uses the second set of characters obtained after the third iteration to continue merging two second sets of characters that have the same character ID.
[0121] Based on the above, if the second parameter corresponding to the merged set is less than the second threshold, it means that the connections between the people whose IDs correspond to others in the merged set have not increased, indicating that the people whose IDs correspond to others in the merged set belong to the same social circle. Thus, through the above iterative process, the mobile phone can perform circle clustering, thereby obtaining multiple social circles.
[0122] In some embodiments, it is assumed that the M second person IDs include p0 and p1, p0 has 3 social circles with which it has established social relationships, and p1 has 5 social circles with which it has established social relationships. Therefore, the person corresponding to p1 can be identified as the owner of the device.
[0123] In summary, using the solution of this application embodiment, the mobile phone first identifies multiple first-person IDs. The first person corresponding to these multiple first-person IDs has various social relationships with others in the gallery application, indicating a high probability that the first person corresponding to these multiple first-person IDs is the phone owner. Based on this, the mobile phone performs circle clustering, dividing the people in the gallery application into multiple social circles. The first person among the multiple first-person IDs who has established social relationships with the most social circles is identified as the phone owner. This improves the accuracy of identifying the phone owner and enhances the applicability of the solution.
[0124] In some embodiments of this application, after the mobile phone identifies the owner, it can further identify individuals with close relationships to the owner, such as the owner's children, spouse, and parents. The following example of a mobile phone identifying the owner's child exemplifies this technical solution.
[0125] For example, such as Figure 9 As shown, the process of identifying the owner's child includes:
[0126] S1. The mobile phone identifies multiple third-party IDs.
[0127] The third-person ID corresponds to a person whose age falls within a preset age range. For example, the preset age range is 0 to 15 years old. In other words, the phone filters out person IDs aged 0 to 15 from the photo library application, thus obtaining multiple third-person IDs.
[0128] S2. The mobile phone counts the characteristics of the person corresponding to each third-party person ID among multiple third-party person IDs.
[0129] The characteristics of the person include: the number of times they took photos at home, the total number of photos taken, the number and proportion of times they appeared when the owner was traveling, the number and proportion of times they appeared when the owner was playing, and the number of times they appeared in the target image set.
[0130] It should be noted that the number of photos taken at home can be the number of times they appear in the first photo set, and the photo set type for the first photo set is "Home". The total number of photos can be the number of all photo sets. The number and proportion of photos taken while the owner is traveling refers to the number and proportion of photos taken by the owner while traveling that include a third-party ID; similarly, the number and proportion of photos taken while the owner is playing refers to the number and proportion of photos taken by the owner while playing that include a third-party ID. "Traveling" refers to the owner traveling outside the province, such as traveling while on a business trip in another province. "Playing" refers to the owner playing within the province, such as strolling around the owner's neighborhood.
[0131] In addition, the target set refers to a set of images in which only two adults appear, and these two adults are of the opposite sex and are of similar age.
[0132] S3: The mobile phone selects multiple fourth-person IDs from multiple third-person IDs.
[0133] Specifically, the fourth person ID corresponds to a person whose number of photos taken in the following preset scenarios exceeds a threshold. The number of photos taken in the preset scenarios = number of photos taken at home + number of times the user appeared while traveling * 2 + number of times the user appeared while playing. The threshold is not specifically limited and is set according to actual usage; for example, the threshold could be 5.
[0134] S4. The mobile phone determines the target ID from multiple fourth-person IDs.
[0135] Among them, the number of times the target ID corresponds to the person in the preset scene is the highest among all the fourth person IDs.
[0136] Optionally, if the phone does not contain photos from the preset scenarios mentioned above, the fourth person ID with the most total photos taken will be used as the target ID.
[0137] S5. The mobile phone determines the ratio of each fourth person's ID to the target ID.
[0138] For example, the ratio is the ratio of the number of times the fourth person's ID is photographed in the preset scene to the number of times the target ID is photographed in the preset scene.
[0139] For example, the ratio = (number of times the fourth person ID corresponds to the person taking photos at home + number of times the owner appears while traveling * 2 + number of times the owner appears while playing) / (number of times the target ID corresponds to the person taking photos at home + number of times the owner appears while traveling * 2 + number of times the owner appears while playing).
[0140] S6. The mobile phone identifies the person whose fourth person ID has a ratio greater than the threshold as the owner's child.
[0141] The threshold is not specifically limited and is subject to the actual setting.
[0142] Based on the above, the mobile phone can use the aforementioned scheme to identify the phone owner based on photos in the gallery application, and then identify the owner's children based on the identified owner. Optionally, after identifying the owner and the owner's children, the mobile phone can also save information related to the photos containing the owner's photos, as well as information related to the photos containing the owner's children.
[0143] For example, information related to the owner's photo may include one or more of the following: person ID, tags, age, gender, shooting time, shooting location, confidence level, etc.
[0144] The tags can be referred to as options, types, etc., without limitation; tags can be used to indicate the identifier of the person corresponding to the person ID, for example, tags can be "owner", "child", "spouse" or "parents", etc.; the tags can be identified by the mobile phone using the scheme provided in the embodiments of this application, and the specifics can be referred to the above embodiments, which will not be repeated here. Confidence can be understood as reliability, that is, the accuracy of the tags of the person IDs corresponding to the people identified by the mobile phone.
[0145] Correspondingly, information including photos of the owner's child can be found in the above embodiments, and will not be repeated here.
[0146] After the phone saves information including the owner's photos, for example, in conjunction with the above... Figure 1 and Figure 2 In the scenario shown, for example, when the user's voice includes information indicating the owner of the phone, the phone can obtain the person ID corresponding to the tag "owner" from the gallery application, and based on the person ID corresponding to "owner", obtain all photos containing the owner from the gallery application and display them on the phone's screen. The specific process can be referred to the above embodiments, and will not be repeated here.
[0147] The above embodiments, using a mobile phone as an example, provide a detailed description of the method for identifying people based on a photo gallery application provided in this application. This method can be applied to an electronic device 100 having the following structure.
[0148] refer to Figure 10 This is a hardware structure diagram of an electronic device provided in an embodiment of this application. Figure 10As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a positioning module 181, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0149] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0150] Processor 110 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0151] In some embodiments, the processor 110 can perform tasks such as identifying the owner, voice interaction, and identifying social relationships with the owner.
[0152] The charging management module 140 receives charging input from a charger, which can be either a wireless or wired charger. The power management module 141 connects to the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0153] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0154] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include one or more filters, switches, power amplifiers, low-noise amplifiers (LANs), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the demodulated signal and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functions of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0155] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices within one or more communication processing modules. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0156] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0157] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0158] Electronic device 100 can perform shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP processes data fed back from the camera 193. For example, when taking a picture, the shutter is opened, light is transmitted through the lens to the camera's photosensitive element, the light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into a visible image. The ISP can also perform algorithmic optimization of image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature. In some embodiments, the ISP can be integrated into the camera 193.
[0159] Camera 193 is used to capture images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device may include one or N cameras 193, where N is a positive integer greater than 1.
[0160] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0161] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing by running the instructions stored in internal memory 121. For example, processor 110 can display different content on display screen 194 in response to an operation to unfold display screen 194 by executing instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phone book, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0162] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, such as music playback and recording.
[0163] Buttons 190 include a power button and volume buttons. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button inputs and generate key signal inputs related to user settings and function control of electronic device 100. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with electronic device 100. Electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1.
[0164] It should be noted that the contents described in the various embodiments of this application can be used to explain the technical solutions in other embodiments of this application. The technical features described in each embodiment can also be applied in other embodiments, and new solutions can be formed by combining the technical features in other embodiments. This application only provides an exemplary list of several embodiments for illustration and does not mean that this application is limited thereto.
[0165] This application provides an electronic device that may include a memory, one or more processors, and a display screen. The memory stores computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device performs the various functions or steps performed by the mobile phone in the above embodiment. The structure of the electronic device can be referred to the above. Figure 10 The structure of the electronic device 100 shown.
[0166] This application also provides a chip system for use in electronic devices. For example... Figure 11 As shown, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 can be one of the embodiments described above. Figure 10 The processor 110 is shown. Based on this, the interface circuit 1102 can be, for example, an interface circuit between the processor 110 and external memory; or an interface circuit between the processor 110 and internal memory.
[0167] The processor 1101 and interface circuit 1102 described above can be interconnected via a line. For example, interface circuit 1102 can be used to receive signals from other devices (e.g., the memory of electronic device 100). As another example, interface circuit 1102 can be used to send signals to other devices (e.g., processor 1101). Exemplarily, interface circuit 1102 can read instructions stored in memory and send those instructions to processor 1101. When the instructions are executed by processor 1101, the electronic device can perform the various functions or steps performed by the mobile phone in the above embodiments. Of course, the chip system may also include other discrete components, and this application embodiment does not specifically limit this.
[0168] This application also provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiments.
[0169] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the mobile phone in the above method embodiments.
[0170] It should be noted that the terms "first" and "second," etc., in the embodiments and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more.
[0171] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0172] It should be understood that in this application, "at least one (item)" means one or more. "More than one" means two or more. "At least two (items)" means two or three or more. "And / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple. Both "...when" and "if" indicate that a corresponding action will be taken under certain objective circumstances. They are not time limits, nor do they require a judgment action to be taken when the action is taken, nor do they imply any other limitations.
[0173] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0174] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules according to the system, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0175] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0176] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0177] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.
[0178] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0179] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for identifying people based on user photos, characterized in that, When applied to electronic devices, the method includes: The electronic device obtains multiple first person sets from the user's photos; each of the multiple first person sets includes multiple person IDs; wherein, the first person set includes x person IDs; x is a positive integer; The electronic device iterates through each of the x person IDs, removes the i-th person ID, and determines the first parameter corresponding to the first person set; wherein, the first parameter is used to indicate the independence of the social relationship between the person IDs included in the first person set and others after removing the i-th person ID; i∈[1, x]; If the first parameter is less than or equal to the first threshold, the electronic device determines that the person corresponding to the removed i-th person ID is the first person, and obtains N first person IDs; The electronic device determines the target person ID from the N first person IDs and identifies the person corresponding to the target person ID as the target person. The target person identified by the electronic device is used to display a photo of the target person on the screen of the electronic device after the electronic device receives the user's first operation.
2. The method according to claim 1, characterized in that, The electronic device acquires multiple sets of first persons from user photos, including: The electronic device generates multiple image sets based on the photos in the user's photos; wherein, the shooting time interval between any two photos in the same image set does not exceed a preset interval, and the distance difference between the shooting positions of any two photos does not exceed a preset distance; The electronic device obtains the character IDs corresponding to the characters included in the multiple image sets to obtain multiple image set collections; The electronic device merges image sets with the same person ID from the multiple image sets to obtain the multiple first person sets.
3. The method according to claim 1 or 2, characterized in that, The electronic device determines the target person ID from the N first person IDs, and identifies the person corresponding to the target person ID as the target person, including: When N=1, if the gender of the person corresponding to the first person ID is the same as the gender of the user, and the age of the person corresponding to the first person ID matches the age of the user, the electronic device will determine the first person ID as the target person ID and determine the person corresponding to the target person ID as the target person.
4. The method according to claim 1 or 2, characterized in that, The electronic device determines the target person ID from the N first person IDs, and identifies the person corresponding to the target person ID as the target person, including: When N≥2, the electronic device determines M second person IDs from the N first person IDs; wherein, the gender of the person corresponding to each of the M second person IDs is the same as the gender of the user, and the age of the person corresponding to the second person ID matches the age of the user; M≥1, M<N, and M is a positive integer; The electronic device determines the target person ID from the M second person IDs and identifies the person corresponding to the target person ID as the target person.
5. The method according to claim 4, characterized in that, The electronic device determines the target person ID from the M second person IDs, and identifies the person corresponding to the target person ID as the target person, including: When M=1, if the number of social circles where the person corresponding to the second person ID has established a social relationship with the social circle exceeds a preset threshold, the electronic device will determine the second person ID as the target person ID and determine the person corresponding to the target person ID as the target person. When M≥2, the electronic device determines the second person ID with the most social relationships with the social circle among the M second person IDs as the target person ID, and determines the person corresponding to the target person ID as the target person.
6. The method according to any one of claims 1, 2, or 5, characterized in that, The method further includes: The electronic device acquires multiple sets of second characters; wherein, the multiple sets of second characters are the sets of characters obtained by removing the N first character IDs from the multiple sets of first characters; The electronic device merges the sets of second persons with the same person ID from the multiple sets of second persons to obtain multiple social circles.
7. The method according to claim 6, characterized in that, The electronic device merges the sets of second persons with the same person ID from the multiple sets of second persons to obtain multiple social circles, including: The electronic device merges the second sets of persons with the same person ID from the multiple second sets of persons, and the merged second set of persons corresponds to a second parameter; wherein, the second parameter is used to indicate the independence of the social relationships between the persons whose person IDs are included in the merged second set of persons; If the second parameter is less than or equal to the second threshold, the electronic device retains the merged second set of people; The electronic device uses the result of the previous merge to continue merging two sets of second persons with the same person ID until the number of sets after the previous merge is the same as the number of sets after the current merge, then stops the loop to obtain the multiple social circles.
8. An electronic device, characterized in that, include: Memory and one or more processors; The memory stores computer program code, which includes computer instructions; when the computer instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1-7.
9. A chip system, characterized in that, The chip system, used in electronic devices, includes: At least one processor and an interface; The interface is used to receive instructions and transmit them to the at least one processor; the at least one processor executes the instructions to cause the electronic device to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, include: Computer instructions; When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Electronic equipment and information processing method thereof
CN107944052A