INFORMATION GENERATION METHOD AND APPARATUS, ELECTRONIC DEVICE, AND COMPUTER READABLE MEDIUM
20230306602 · 2023-09-28
Inventors
Cpc classification
G06V40/00
PHYSICS
G06T7/143
PHYSICS
International classification
Abstract
An information generation method and apparatus, an electronic device, and a computer readable medium. The method comprises: generating a target region set on the basis of an obtained first target picture (201); selecting a target region satisfying a preset condition from the target region set as a candidate region to obtain a candidate region set (202); generating a second target picture on the basis of the candidate region set (203); and generating picture related information on the basis of the second target picture (204). Thus, effective extraction for a target region and further classification for the target region are achieved, so that an identification result of an image region is finer, and then the subsequent image processing technology has a promotion space.
Claims
1. An information generation method, comprising: generating a target region set based on an obtained first target picture; selecting a target region that meets a preset condition from the target region set as a candidate region to obtain a candidate region set; generating a second target picture based on the candidate region set; and generating picture related information based on the second target picture.
2. The method according to claim 1, wherein the first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
3. The method according to claim 1, wherein generating the target region set based on the obtained first target picture, comprises: determining, in response to determining that the first target picture contains the target region, location information of the target region; and segmenting, based on the location information of the target region, the target region from the first target picture by using a connected domain search method to obtain the target region set.
4. The method according to claim 3, wherein determining, in response to determining that the first target picture contains the target region, location information of the target region, comprises: inputting the first target picture into a pre-trained first deep neural network to obtain the location information of the target region in the first target picture.
5. The method according to claim 1, wherein generating the target region set based on the obtained first target picture, comprises: inputting the first target picture into a pre-trained second deep neural network to obtain the target region in the first target picture, so as to constitute the target region set.
6. The method according to claim 1, wherein selecting the target region that meets the preset condition from the target region set as the candidate region to obtain the candidate region set, comprises: determining a target parameter of each target region in the target region set; and selecting a predetermined number of target regions from the target region set as candidate regions according to a value of the target parameter corresponding to each target region from large to small to obtain a candidate region set.
7. The method according to claim 6, wherein, the target parameter comprises an area or a probability value.
8. The method according to claim 7, wherein determining the area of each target region in the target region set, comprises: determining the area of each target region in the target region set through a mode of dividing an interior of the target region or selecting a target point outside the target region.
9. The method according to claim 8, wherein determining the target parameter of each target region in the target region set, comprises: dividing, based on a preset dividing method, each target region in the target region set to obtain at least one sub-region set; determining, based on location information of each target region, an area of each sub-region in the sub-region set corresponding to each target region to obtain at least one sub-region area set; and summing the areas in the at least one sub-region area set to obtain the area of each target region.
10. The method according to claim 8, wherein determining the target parameter of each target region in the target region set, comprises: selecting the target point outside the target region in the first target picture; connecting the target point with each vertex of the target region to obtain a connecting polygon; determining an area of the connecting polygon; determining an area of a concave region of the target region; and performing differencing based on the area of the connecting polygon and the area of the concave region to obtain the area of the target region.
11. The method according to claim 8, wherein determining the target parameter of each target region in the target region set, comprises: performing feature extraction on each target region in the target region set to obtain a vector diagram of the target region, so as to constitute a vector diagram set; determining a confidence score between each vector diagram in the vector diagram set and a preset contrast vector diagram to obtain a confidence score set; and determining the confidence score corresponding to each target region as the probability value of the target region.
12. The method according to claim 8, wherein the preset condition comprises that a value of the area is greater than a first preset threshold or the probability value is greater than a second preset threshold.
13. The method according to claim 1, wherein generating the second target picture based on the candidate region set, comprises: mapping each candidate region in the candidate region set to a predetermined display picture box to obtain a mapping picture, and determining the mapping picture as the second target picture.
14. The method according to claim 1, wherein the picture related information comprises category information and key point information.
15. The method according to claim 14, wherein generating the picture related information based on the second target picture, comprises: inputting the second target picture into a pre-trained third deep neural network to obtain the picture related information of the second target picture.
16. The method according to claim 1, further comprising: pushing the picture related information to a target device with a display function, and controlling the target device to display the picture related information.
17. (canceled)
18. An electronic device, comprising: one or more processors; and a storage apparatus, storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement operations comprising: generating a target region set based on an obtained first target picture; selecting a target region that meets a preset condition from the target region set as a candidate region to obtain a candidate region set; generating a second target picture based on the candidate region set; and generating picture related information based on the second target picture.
19. A computer readable medium, storing a computer program, wherein the program implements operations when executed by a processor, the operations comprising: generating a target region set based on an obtained first target picture; selecting a target region that meets a preset condition from the target region set as a candidate region to obtain a candidate region set; generating a second target picture based on the candidate region set; and generating picture related information based on the second target picture.
20. The electronic device according to claim 18, wherein the first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
21. The electronic device according to claim 18, wherein generating the target region set based on the obtained first target picture, comprises: determining, in response to determining that the first target picture contains the target region, location information of the target region; and segmenting, based on the location information of the target region, the target region from the first target picture by using a connected domain search method to obtain the target region set.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0011] These and other features, advantages and aspects of embodiments of the present disclosure will become more apparent in conjunction with the accompanying drawings and with reference to the following specific embodiments. Throughout the accompanying drawings, identical or similar appended marks indicate identical or similar elements. It should be understood that the accompanying drawings are schematic and that the elements and components are not necessarily drawn to scale.
[0012]
[0013]
[0014]
[0015]
[0016]
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] Embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood, however, that the present disclosure may be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of protection of the present disclosure.
[0018] It is also noted that, for ease of description, only those portions of the accompanying drawings are shown that relate to the invention in question. The embodiments and the features in the embodiments of the present disclosure may be combined with each other without conflict.
[0019] It should be noted that the concepts of “first” and “second” mentioned in this disclosure are used only to distinguish between different devices, modules or units, and are not intended to define the order or interdependence of the functions performed by these devices, modules or units.
[0020] It should be noted that the modifications of “one” and “more than one” referred to in this disclosure are illustrative rather than limiting, and it should be understood by those skilled in the art to mean “one or more” unless the context clearly indicates otherwise.
[0021] The names of the messages or information interacted between the plurality of devices in this implementation of the disclosure are used for illustrative purposes only and are not intended to limit the scope of those messages or information.
[0022] The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023]
[0024] In the application scene of
[0025] It should be noted that the above computing device 101 may be hardware or software. When the computing device is the hardware, it may be implemented as a distributed cluster composed of a plurality of servers or terminal devices, and may also be implemented as a single server or a single terminal device. When the computing device is the software, it may be installed in the above listed hardware devices. It may be implemented as, for example, a plurality of software or software modules configured to provide distributed services, or it may also be implemented as single software or a single software module. No specific limitation is made here.
[0026] It should be understood that the number of the computing device in
[0027] Continue to refer to
[0029] In some embodiments, an executive body (such as the computing device 101 shown in
[0030] In some optional implementations of some embodiments, the above first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the above to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
[0031] In some optional implementations of some embodiments, the above executive body may input the above first target picture into a pre-trained first deep neural network to obtain the location information of the target region in the above first target picture.
[0032] In some optional implementations of some embodiments, the above first deep neural network may be trained by the following methods: first, the above executive body may obtain a training sample set, and a training sample in the above training sample set includes a sample picture and sample location information. Then, the above executive body may select the training sample from the above training sample set. Then, the sample picture in the selected training sample is taken as an input of an initial model, the sample location information corresponding to the above sample picture is taken as an expected output of the above initial model, and the above first deep neural network is obtained by training. The above initial model may be various neural networks that can obtain corresponding sample location information according to the above sample picture. Initial parameters are set in each layer of the above initial model, and the initial parameters may be continuously adjusted in a training process of the above first deep neural network. For example, a convolutional neural network (CNN).
[0033] In some optional implementations of some embodiments, the above first deep neural network includes a target region positioning network and a target region extraction network, the above target region positioning network is used for determining coordinates of the target region in the picture, and the above target region extraction network is used for extracting the target region based on the above coordinates. The above target region positioning network may adopt a target detection algorithm (Region-CNN and R-CNN). The above target region extraction network may adopt the following feature extraction algorithms: a support vector machine (SVM), a K nearest neighbor algorithm, a decision tree and naive bayes.
[0034] Step 202, a target region that meets a preset condition is selected from the target region set as a candidate region to obtain a candidate region set.
[0035] In some embodiments, the above executive body may select a target region with an area greater than a first preset threshold from the above target region set as the candidate region to obtain the candidate region set. The above executive body may also select a target region with a probability value greater than a second preset threshold from the above target region set as the candidate region to obtain the candidate region set. Here, the probability value may be a value used for representing a possibility that the target region is a nail region.
[0036] In some optional implementations of some embodiments, the above preset condition includes that a value of the area is greater than the first preset threshold or the probability value is greater than the second preset threshold.
[0037] Step 203, a second target picture is generated based on the candidate region set.
[0038] In some embodiments, the above executive body firstly may establish a plane rectangular coordinate system on a predetermined display plane. Then, the above executive body may map each candidate region in the candidate region set to the predetermined display plane according to the location information (such as coordinates) of the candidate region to obtain a mapping picture. Then, the above executive body may determine the above mapping picture as the second target picture.
[0039] Step 204, picture related information is generated based on the second target picture.
[0040] In some embodiments, the above executive body may generate the picture related information through the following steps: step 1, the above executive body may perform feature extraction on each candidate region displayed in the second target picture to obtain a feature of each candidate region, so as to generate a vector matrix; step 2, the above executive body may determine a similarity between the vector matrix of each candidate region and each preset contrast vector matrix in a preset contrast vector matrix set to obtain a similarity set of each candidate region; step 3, based on the similarity set of each candidate region, the above executive body may sort the similarity sets in an order of similarity from large to small to obtain a similarity sequence of each candidate region; step 4, the above executive body may select a similarity of a first location from the similarity sequence to obtain a first similarity set; step 5, the above executive body may determine category information of the preset contrast vector matrix corresponding to each similarity in the first similarity set as category information of each candidate region; step 6, the above executive body may input the above second target picture into a key point extraction network to obtain key point information of each candidate region in the above second target picture; and step 7, the above executive body may combine the category information and the key point information of each candidate region in the above second target picture to obtain the picture related information of the second target picture. Here, the similarity may be a score obtained by scoring a cosine distance between the vector matrix and the preset contrast vector matrix.
[0041] In some optional implementations of some embodiments, the above executive body may input the above second target picture into a pre-trained third deep neural network to obtain the picture related information.
[0042] In some optional implementations of some embodiments, the picture related information includes the category information and the key point information.
[0043] In some optional implementations of some embodiments, the above third deep neural network may include a category information generating network and a key point extraction network. The category information generating network includes a feature extraction network and a classifying network. Here, the feature extraction network is used for extracting the feature of the candidate region in the picture to generate the vector matrix, and the classifying network is used for classifying based on the above vector matrix to obtain the category information of the above candidate region. The key point extraction network is used for recognizing a key point in the second target picture to generate the key point information.
[0044] In some optional implementations of some embodiments, the above third deep neural network may be various neural networks that can obtain the category information and the key point information of the candidate region according to the second target picture. The above feature extraction network may adopt the following feature extraction algorithms: a support vector machine (SVM), a K nearest neighbor algorithm, a decision tree and naive bayes. The above classifying network may adopt linear discriminant analysis (LDA), a Gaussian classifier or a logical regression classifier. Here, categories may include, but not limited to at least one of the following: a thumb category, an index finger category, a middle finger category, a ring finger category and a little finger category. As an example, the category information may be that “this region belongs to the thumb”.
[0045] The method provided by some embodiments of the present disclosure realizes effective extraction of the target region in the first target picture. The target region displayed in the first target picture is further classified to generate the picture related information. A recognition result of the first target picture is more accurate, so that the subsequent image processing technology has room for improvement.
[0046] The information generation method of the present disclosure may further be applied to the technical field of virtual nail enhancement. For a nail picture provided by a user, a nail region in the nail picture is extracted, so that each nail region in the nail picture can be obtained. Then, a second nail picture containing each nail region may be generated, so that the user can use it as the material to make the next picture. By further classifying each nail region, picture related information containing category information and key point information of the nail regions is generated. It can help the user understand the categories of the nail regions, reduce the time for the user to judge the categories of the nail regions, and laterally improve the utilization efficiency of the extracted nail regions.
[0047] Continue to refer to
[0049] In some embodiments, an executive body (such as the computing device 101 shown in
[0050] Step 302, a target parameter of each target region in the target region set is determined.
[0051] In some embodiments, the above executive body may obtain an area of the target region through the following steps: step 1, the above executive body may obtain location information of each vertex of the above target region based on the location information of the target region obtained by above step 301; step 2, the above executive body may divide the above target region based on a preset dividing method, here, the preset dividing method may be to divide the target region into at least one triangle, and there is no overlap between the triangles; step 3, the above executive body may use a triangle area calculation method to calculate the area of each triangle based on the location information of each vertex of the above target region; and step 4, the above executive body may sum the obtained areas of the triangles to take a calculation result as the area of the above target region. Therefore, the above executive body may obtain the area of each target region in the target region set.
[0052] In some optional implementations of some embodiments, determining the area of each target region in the above target region set includes: the area of each target region in the above target region set is determined through a mode of dividing an interior of the target region or selecting a target point outside the above target region.
[0053] In some optional implementations of some embodiments, the above executive body may further obtain the area of the target region through the following steps: step 1, the above executive body may obtain location information of each vertex of the above target region based on the location information of the target region obtained by above step 301; step 2, the above executive body may connect each above vertex to determine a concave point of the above target region, here, the concave point may be a vertex of a reflex angle of the above target region; step 3, the above executive body may select a target point outside the target region from the first target picture; step 4, the above executive body may obtain location information of the target point; step 5, the above executive body may connect the target point with each vertex of the above target region sequentially to obtain a connecting polygon; step 6, the above executive body may divide the above connecting polygon based on the above preset dividing method to obtain at least one triangle; step 7, the above executive body may calculate the area of each triangle, sum the obtained areas of the triangles and take a calculation result as the area of the above connecting polygon; step 8, the above executive body may determine a region obtained by connecting the above target point with the concave point of the above target region and two vertices adjacent to the concave point as a concave region; step 9, the above executive body may use the above preset dividing method to calculate an area of the concave region; and step 10, the above executive body may determine an absolute value of a difference between the area of the above connecting polygon and the area of the above concave region as the area of the above target region.
[0054] In some embodiments, the above executive body may obtain the probability value of the target region through the following steps: step 1, the above executive body may perform feature extraction on each target region in the target region set to obtain a vector diagram of the target region, so as to constitute a vector diagram set; step 2, the above executive body may score a cosine distance between each vector diagram in the vector diagram set and a preset contrast vector diagram to obtain a cosine distance score; step 3, the above executive body may determine the cosine distance score as a confidence score of the vector diagram and the preset contrast vector diagram to obtain a confidence score set; and step 4, the above executive body may determine the confidence score corresponding to each target region as the probability value of the target region.
[0055] Specifically, in statistics, a confidence interval of a probability sample is an interval estimation on a certain population parameter of this sample. The confidence interval shows the degree to which a true value of this parameter has a certain probability to fall around a measurement result. The confidence interval gives a confidential degree of a measured value of the measured parameter, that is, the “certain probability” required previously. This probability is called a confidence level and is generally expressed in a form of a fraction.
[0056] Step 303, a predetermined number of target regions are selected from the target region set as candidate regions according to a value of the target parameter corresponding to each target region from large to small to obtain a candidate region set.
[0057] In some embodiments, the above executive body may select the predetermined number of target regions from the target region set as candidate regions in the order of areas from large to small. The above executive body may also select the predetermined number of target regions from the target region set as the candidate regions in an order of probability values from large to small.
[0058] In some optional implementations of some embodiments, the target regions with relatively small area values are screened out, and the regions with relatively large area values remain as the candidate regions. The generated second target picture can be more consistent with definition requirements. Screening out the target regions with relatively small probability values can make the generated second target picture more accurate.
[0059] Step 304, each candidate region in the candidate region set is mapped to a predetermined display picture box to obtain a mapping picture, and the mapping picture is determined as the second target picture.
[0060] In some embodiments, the above executive body firstly may calculate a relative distance and angle among all the candidate regions according to the location information of each candidate region. Then, the above executive body may map the candidate regions to the predetermined display picture box according to the relative distance and angle among all the candidate regions to obtain the mapping picture. Then, the above executive body may determine the above mapping picture as the second target picture. Here, a size of the above predetermined display picture box may be same as a size of the first target picture.
[0061] Step 305, picture related information is generated based on the second target picture.
[0062] In some embodiments, the specific implementation of step 305 and the resulting technical effects may refer to step 204 in those embodiments corresponding to
[0063] Step 306, the picture related information is pushed to a target device with a display function, and the target device is controlled to display the picture related information.
[0064] In some embodiments, the above executive body may push the picture related information to the target device with the display function, and control the target device to display the picture related information.
[0065] It can be seen from
[0066] Further referring to
[0067] As shown in
[0068] In some optional implementations of some embodiments, the above first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the above to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
[0069] In some optional implementations of some embodiments, the first generating unit 401 of the information generation apparatus 400 is further configured to: determine location information of the above target region in response to determining that the above first target picture contains the target region; and use a connected domain search method to segment the above target region from the above first target picture based on the location information of the above target region to obtain the above target region set.
[0070] In some optional implementations of some embodiments, determining, in response to determining that the above first target picture contains the target region, the location information of the above target region, includes: the above first target picture is input into a pre-trained first deep neutral network to obtain the location information of the target region in the above first target picture.
[0071] In some optional implementations of some embodiments, the first generating unit 401 of the information generation apparatus 400 is further configured to: input the above first target picture into a pre-trained second deep neural network to obtain the target region in the above first target picture, so as to constitute the target region set.
[0072] In some optional implementations of some embodiments, the selecting unit 402 of the information generation apparatus 400 is further configured to: determine a target parameter of each target region in the above target region set; and select a predetermined number of target regions from the above target region set as above candidate regions according to a value of the target parameter corresponding to each target region from large to small to obtain a candidate region set.
[0073] In some optional implementations of some embodiments, the above target parameter includes an area or a probability value.
[0074] In some optional implementations of some embodiments, determining the area of each target region in the above target region set includes: the area of each target region in the above target region set is determined through a mode of dividing an interior of the above target region or selecting a target point outside the above target region.
[0075] In some optional implementations of some embodiments, determining the target parameter of each target region in the above target region set, includes: based on a preset dividing method, each target region in the above target region set is divided to obtain at least one sub-region set; based on the location information of each target region, an area of each sub-region in the sub-region set corresponding to each target region is determined to obtain at least one sub-region area set; and the areas in the above at least one sub-region area set are summed to obtain the area of each target region.
[0076] In some optional implementations of some embodiments, determining the target parameter of each target region in the above target region set, includes: a target point outside the target region is selected in the above first target picture; the above target point is connected with each vertex of the above target region to obtain a connecting polygon; an area of the above connecting polygon is determined; an area of a concave region of the above target region is determined; and differencing is performed based on the area of the above connecting polygon and the area of the above concave region to obtain the area of the above target region.
[0077] In some optional implementations of some embodiments, determining the target parameter of each target region in the above target region set, includes: feature extraction is performed on each target region in the above target region set to obtain a vector diagram of the above target region, so as to constitute a vector diagram set; a confidence score of each vector diagram in the above vector diagram set and a preset contrast vector diagram to obtain a confidence score set; and the confidence score corresponding to each target region is determined as the probability value of the above target region.
[0078] In some optional implementations of some embodiments, the above preset condition includes that a value of the area is greater than a first preset threshold or the probability value is greater than a second preset threshold.
[0079] In some optional implementations of some embodiments, the second generating unit 403 of the information generation apparatus 400 is further configured to map each candidate region in the above candidate region set to a predetermined display picture box to obtain a mapping picture, and determine the above mapping picture as the above second target picture.
[0080] In some optional implementations of some embodiments, the above picture related information includes category information and key point information.
[0081] In some optional implementations of some embodiments, the third generating unit 404 of the information generation apparatus 400 is further configured to: input the above second target picture into a pre-trained third deep neural network to obtain the picture related information of the above second target picture.
[0082] In some optional implementations of some embodiments, the information generation apparatus 400 is further configured to push the above picture related information to a target device with a display function, and control the above target device to display the above picture related information.
[0083] It can be understood that all the units recorded in the apparatus 400 correspond to each step in the method described with reference to
[0084] Reference is made below to
[0085] As shown in
[0086] Typically, the following devices can be connected to the I/O interface 505: input device 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output device 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage device 508 including, for example, magnetic tapes, hard drives, etc.; and communication device 509. Communication device 509 may allow the electronic device 500 to communicate wirelessly or wired with other devices to exchange data. While
[0087] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the method shown in the flowchart. In some such embodiments, the computer program may be downloaded and installed from a network via a communication device 509, or from a storage device 508, or from a ROM 502. When this computer program is executed by processing device 501, it performs the above-described functions as defined in the methods of some embodiments of the present disclosure.
[0088] It is to be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the foregoing. The computer readable storage medium may be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrically connected with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, or any of the above. magnetic memory devices, or any suitable combination of the foregoing. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in combination with an instruction execution system, device, or device. And in some embodiments of the present disclosure, the computer readable signaling medium may include a data signal propagated in the baseband or as part of a carrier wave carrying a computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. Computer-readable signal medium can also be any computer-readable medium other than computer-readable storage media, the computer-readable signal medium can send, propagate or transmit the program for use by or in conjunction with the instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted by any suitable medium, including but not limited to: wire, fiber optic cable, RF (radio frequency), etc., or any suitable combination of the above.
[0089] In some implementations, the client, server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), inter-networks (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future developed networks.
[0090] The above-mentioned computer-readable medium may be contained in the above-mentioned device; or it may be separately present and not assembled into the electronic device. The above-mentioned computer readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to: generate a target area collection based on the acquired first target picture; select a target area meeting a predetermined condition from the target area collection as a candidate area to obtain a candidate area collection; generate a second target picture based on the candidate area collection; and generate picture-related information based on the based on the second target image, generating image related information.
[0091] Computer program code for performing the operations of some embodiments of the present disclosure can be written in one or more programming languages or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and also conventional procedural programming languages—such as “C” or the like. such as “C” language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
[0092] In the case involving a remote computer, the remote computer may be connected to the user computer via any kind of network—including a local area network (LAN) or wide area network (WAN)—or, alternatively, may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0093] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementations of the architecture, functionality, and operation of systems, methods, and computer program products in accordance with various embodiments of the present disclosure. At this point, each box in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some implementations as replacements, the functions indicated in the boxes may also occur in a different order than that indicated in the accompanying drawings. For example, two boxes represented one after the other can actually be executed in substantially parallel, and they can sometimes be executed in the opposite order, depending on the function involved. Note also that each box in the block diagram and/or flowchart, and the combination of boxes in the block diagram and/or flowchart, may be implemented with a dedicated hardware-based system that performs the specified function or operation, or may be implemented with a combination of dedicated hardware and computer instructions.
[0094] The units described in some embodiments of the present disclosure may be implemented by means of software or may be implemented by means of hardware. The units described may also be provided in a processor, for example, a processor may be described as comprising a first generation unit, a selection unit, a second generation unit, and a third generation unit. For example, the first generation unit may also be described as “a unit for generating a collection of target regions based on an acquired first target image”.
[0095] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, non-limitingly, exemplary types of hardware logic components that may be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0096] According to one or more embodiments of the present disclosure, provide an information generation method, comprising: generating a target region set based on an obtained first target picture; selecting a target region that meets a preset condition from the target region set as a candidate region to obtain a candidate region set; generating a second target picture based on the candidate region set; and generating picture related information based on the second target picture.
[0097] According to one or more embodiments of the present disclosure, the above-mentioned first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
[0098] According to one or more embodiments of the present disclosure, the above-mentioned generating the target region set based on the obtained first target picture, comprises: determining, in response to determining that the first target picture contains the target region, location information of the target region; and segmenting, based on the location information of the target region, the target region from the first target picture by using a connected domain search method to obtain the target region set.
[0099] According to one or more embodiments of the present disclosure, the above-mentioned determining, in response to determining that the first target picture contains the target region, location information of the target region, comprises: inputting the first target picture into a pre-trained first deep neural network to obtain the location information of the target region in the first target picture.
[0100] According to one or more embodiments of the present disclosure, the above-mentioned generating the target region set based on the obtained first target picture, comprises: inputting the first target picture into a pre-trained second deep neural network to obtain the target region in the first target picture, so as to constitute the target region set.
[0101] According to one or more embodiments of the present disclosure, the above-mentioned selecting the target region that meets the preset condition from the target region set as the candidate region to obtain the candidate region set, comprises: determining a target parameter of each target region in the target region set; and selecting a predetermined number of target regions from the target region set as candidate regions according to a value of the target parameter corresponding to each target region from large to small to obtain a candidate region set.
[0102] According to one or more embodiments of the present disclosure, the above-mentioned target parameter comprises an area or a probability value.
[0103] According to one or more embodiments of the present disclosure, the above-mentioned determining the area of each target region in the target region set, comprises: determining the area of each target region in the target region set through a mode of dividing an interior of the target region or selecting a target point outside the target region.
[0104] According to one or more embodiments of the present disclosure, the above-mentioned determining the target parameter of each target region in the target region set, comprises: dividing, based on a preset dividing method, each target region in the target region set to obtain at least one sub-region set; determining, based on location information of each target region, an area of each sub-region in the sub-region set corresponding to each target region to obtain at least one sub-region area set; and summing the areas in the at least one sub-region area set to obtain the area of each target region.
[0105] According to one or more embodiments of the present disclosure, the above-mentioned determining the target parameter of each target region in the target region set, comprises: selecting the target point outside the target region in the first target picture; connecting the target point with each vertex of the target region to obtain a connecting polygon; determining an area of the connecting polygon; determining an area of a concave region of the target region; and performing differencing based on the area of the connecting polygon and the area of the concave region to obtain the area of the target region.
[0106] According to one or more embodiments of the present disclosure, the above-mentioned determining the target parameter of each target region in the target region set, comprises: performing feature extraction on each target region in the target region set to obtain a vector diagram of the target region, so as to constitute a vector diagram set; determining a confidence score between each vector diagram in the vector diagram set and a preset contrast vector diagram to obtain a confidence score set; and determining the confidence score corresponding to each target region as the probability value of the target region.
[0107] According to one or more embodiments of the present disclosure, the above-mentioned preset condition comprises that a value of the area is greater than a first preset threshold or the probability value is greater than a second preset threshold.
[0108] According to one or more embodiments of the present disclosure, the above-mentioned generating the second target picture based on the candidate region set, comprises: mapping each candidate region in the candidate region set to a predetermined display picture box to obtain a mapping picture, and determining the mapping picture as the second target picture.
[0109] According to one or more embodiments of the present disclosure, the above-mentioned picture related information comprises category information and key point information.
[0110] According to one or more embodiments of the present disclosure, the above-mentioned generating the picture related information based on the second target picture, comprises: inputting the second target picture into a pre-trained third deep neural network to obtain the picture related information of the second target picture.
[0111] According to one or more embodiments of the present disclosure, the above-mentioned method further comprising: pushing the picture related information to a target device with a display function, and controlling the target device to display the picture related information.
[0112] According to one or more embodiments of the present disclosure, provide an information generation apparatus, comprising: a first generating unit, configured to generate a target region set based on an obtained first target picture; a selecting unit, configured to select a target region that meets a preset condition from the target region set as a candidate region to obtain a candidate region set; a second generating unit, configured to generate a second target picture based on the candidate region set; and a third generating unit, configured to generate picture related information based on the second target picture.
[0113] According to one or more embodiments of the present disclosure, the above-mentioned first target picture is a picture of a preset size intercepted from a to-be-intercepted picture, and the to-be-intercepted picture is a picture in which a nail region is determined to be displayed.
[0114] According to one or more embodiments of the present disclosure, the first generating unit of the information generation apparatus is further configured to: determine, in response to determining that the first target picture contains the target region, location information of the target region; and segment, based on the location information of the target region, the target region from the first target picture by using a connected domain search method to obtain the target region set.
[0115] According to one or more embodiments of the present disclosure, the above-mentioned determine, in response to determining that the first target picture contains the target region, location information of the target region, comprises: input the first target picture into a pre-trained first deep neural network to obtain the location information of the target region in the first target picture.
[0116] According to one or more embodiments of the present disclosure, the first generating unit of the information generation apparatus is further configured to: input the first target picture into a pre-trained second deep neural network to obtain the target region in the first target picture, so as to constitute the target region set.
[0117] According to one or more embodiments of the present disclosure, the selecting unit of the information generation apparatus is further configured to: determine a target parameter of each target region in the target region set; and select a predetermined number of target regions from the target region set as candidate regions according to a value of the target parameter corresponding to each target region from large to small to obtain a candidate region set.
[0118] According to one or more embodiments of the present disclosure, the above-mentioned target parameter comprises an area or a probability value.
[0119] According to one or more embodiments of the present disclosure, the above-mentioned determine the area of each target region in the target region set, comprises: determine the area of each target region in the target region set through a mode of dividing an interior of the target region or selecting a target point outside the target region.
[0120] According to one or more embodiments of the present disclosure, the above-mentioned determine the target parameter of each target region in the target region set, comprises: divide, based on a preset dividing method, each target region in the target region set to obtain at least one sub-region set; determine, based on location information of each target region, an area of each sub-region in the sub-region set corresponding to each target region to obtain at least one sub-region area set; and summing the areas in the at least one sub-region area set to obtain the area of each target region.
[0121] According to one or more embodiments of the present disclosure, the above-mentioned determine the target parameter of each target region in the target region set, comprises: select the target point outside the target region in the first target picture; connect the target point with each vertex of the target region to obtain a connecting polygon; determine an area of the connecting polygon; determine an area of a concave region of the target region; and perform differencing based on the area of the connecting polygon and the area of the concave region to obtain the area of the target region.
[0122] According to one or more embodiments of the present disclosure, the above-mentioned determine the target parameter of each target region in the target region set, comprises: perform feature extraction on each target region in the target region set to obtain a vector diagram of the target region, so as to constitute a vector diagram set; determine a confidence score between each vector diagram in the vector diagram set and a preset contrast vector diagram to obtain a confidence score set; and determine the confidence score corresponding to each target region as the probability value of the target region.
[0123] According to one or more embodiments of the present disclosure, the above-mentioned preset condition comprises that a value of the area is greater than a first preset threshold or the probability value is greater than a second preset threshold.
[0124] According to one or more embodiments of the present disclosure, the above-mentioned generate the second target picture based on the candidate region set, comprises: map each candidate region in the candidate region set to a predetermined display picture box to obtain a mapping picture, and determine the mapping picture as the second target picture.
[0125] According to one or more embodiments of the present disclosure, the above-mentioned picture related information comprises category information and key point information.
[0126] According to one or more embodiments of the present disclosure, the third generating unit of the information generation apparatus is further configured to: input the second target picture into a pre-trained third deep neural network to obtain the picture related information of the second target picture.
[0127] According to one or more embodiments of the present disclosure, the information generation apparatus is further configured to: push the picture related information to a target device with a display function, and control the target device to display the picture related information.
[0128] The above description is only a description of some preferred embodiments of the present disclosure and of the technical principles employed. It should be understood by those skilled in the art that the scope of the invention covered by the embodiments of the present disclosure is not limited to technical solutions resulting from a particular combination of the above technical features, but should also cover other technical solutions resulting from any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are interchangeable with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.