CN110688516A - Image retrieval method, image retrieval device, computer equipment and storage medium - Google Patents
Image retrieval method, image retrieval device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110688516A CN110688516A CN201910949093.5A CN201910949093A CN110688516A CN 110688516 A CN110688516 A CN 110688516A CN 201910949093 A CN201910949093 A CN 201910949093A CN 110688516 A CN110688516 A CN 110688516A
- Authority
- CN
- China
- Prior art keywords
- image
- target
- person
- data cluster
- attribute
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/53—Querying
- G06F16/535—Filtering based on additional data, e.g. user or group profiles
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Processing Or Creating Images (AREA)
Abstract
The application relates to an image retrieval method, an image retrieval device, a computer device and a storage medium. The method comprises the following steps: acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person; searching in a first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in a second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images; determining at least one target image identifier from a plurality of said first image identifiers and/or a plurality of said second image identifiers. The embodiment of the invention stores and retrieves the image characteristics and the structural attributes by using a proper platform, thereby achieving the optimization of speed and precision and improving the efficiency and the accuracy of screening.
Description
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image retrieval method and apparatus, a computer device, and a storage medium.
Background
With the development of deep learning algorithms and artificial neural network theories, the application field of the face recognition technology is wider and wider. Among them, the face recognition technology is a very important technical means in the field of public security.
In the related technology, a large number of cameras are installed in a city to capture faces, and face images of people of interest are compared with captured face images through a face recognition technology to obtain face images similar to the people of interest. And finally, screening the retrieved face images by the staff.
However, the number of retrieved face images is huge, and the manual screening of the retrieved face images is not only inefficient and time-consuming, but also not highly accurate.
Disclosure of Invention
In view of the above, it is necessary to provide an image retrieval method, an apparatus, a computer device and a storage medium capable of improving the screening efficiency and accuracy.
In a first aspect, an embodiment of the present invention provides an image retrieval method, where the method includes:
acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person;
searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
at least one target image identifier is determined from the plurality of first image identifiers and/or the plurality of second image identifiers.
In one embodiment, the first data cluster is a distributed cache ignite cluster, and the second data cluster is a distributed solr cluster.
In one embodiment, before searching in the first data cluster according to the first image feature to obtain the plurality of first image identifiers, the method further includes:
acquiring a second image characteristic of a second reference image of the target person and/or a second person attribute of the target person;
searching in a preset image database according to the second image characteristics and/or the second person attributes to obtain a plurality of candidate images which are similar to the second reference image and/or meet the second person attributes;
and storing the image identification and the image characteristic of each candidate image into a first data cluster correspondingly, and storing the image identification and the character attribute of each candidate image into a second data cluster correspondingly.
In one embodiment, the searching in the first data cluster according to the first image feature to obtain the plurality of first image identifiers includes:
calculating the similarity between each image feature in the first data cluster and the first image feature;
selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small;
determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature;
the searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifiers includes:
matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes;
and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
In one embodiment, the determining at least one target image identifier according to the plurality of first image identifiers and/or the plurality of second image identifiers includes:
and searching the same image identifier in the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier.
In one embodiment, the obtaining the first image feature of the first reference image of the target person and the first person attribute of the target person includes:
receiving a first reference image and/or a first person attribute sent by a terminal;
and performing feature extraction on the first reference image to obtain a first image feature.
In one embodiment, after determining the at least one target image identifier according to the plurality of first image identifiers and/or the plurality of second image identifiers, the method further includes:
and sending the target image identifier to the terminal so that the terminal can display the target image according to the target image identifier.
In a second aspect, an embodiment of the present invention provides an image retrieval apparatus, including:
the first acquisition module is used for acquiring first image characteristics of a first reference image of a target person and first person attributes of the target person;
the searching module is used for searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
and the target image identification determining module is used for determining at least one target image identification according to the plurality of first image identifications and/or the plurality of second image identifications.
In one embodiment, the first data cluster is a distributed cache ignite cluster, and the second data cluster is a distributed solr cluster.
In one embodiment, the apparatus further comprises:
a second obtaining module, configured to obtain a second image feature of a second reference image of the target person and/or a second person attribute of the target person;
the retrieval module is used for retrieving in a preset image database according to the second image characteristics and/or the second person attributes to obtain a plurality of candidate images which are similar to the second reference image and/or meet the second person attributes;
and the storage module is used for correspondingly storing the image identification and the image characteristic of each candidate image into the first data cluster and correspondingly storing the image identification and the character attribute of each candidate image into the second data cluster.
In one embodiment, the search module is specifically configured to calculate similarity between each image feature in the first data cluster and the first image feature; selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small; determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature; matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes; and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
In one embodiment, the target image identifier determining module is specifically configured to search for the same image identifier from among the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier.
In one embodiment, the first obtaining module is specifically configured to receive a first reference image and/or a first person attribute sent by a terminal; and performing feature extraction on the first reference image to obtain a first image feature.
In one embodiment, the apparatus further comprises:
and the target image identifier sending module is used for sending the target image identifier to the terminal so that the terminal can display the target image according to the target image identifier.
In a third aspect, an embodiment of the present invention provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps in the method when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the method.
The image retrieval method, the image retrieval device, the computer equipment and the storage medium are used for acquiring the first image characteristics of the first reference image of the target person and/or the first person attribute of the target person; searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; at least one target image identifier is determined from the plurality of first image identifiers and/or the plurality of second image identifiers. According to the embodiment of the invention, the image characteristics of the candidate image are stored and retrieved by using the platform suitable for characteristic storage and retrieval, and the structural attributes of the candidate image are stored and retrieved by using the platform suitable for attribute storage and retrieval, so that the optimization of speed and precision is achieved. Moreover, retrieval is carried out according to multiple dimensions such as image characteristics and character attributes, and the screening accuracy is improved.
Drawings
FIG. 1 is a diagram of an exemplary environment in which an image retrieval method may be implemented;
FIG. 2 is a flow diagram illustrating an exemplary image retrieval method;
FIG. 3 is a flowchart illustrating the steps of obtaining a plurality of first image identifiers and a plurality of second image identifiers in one embodiment;
FIG. 4 is a flowchart illustrating an image retrieval method according to another embodiment;
FIG. 5 is a block diagram showing the configuration of an image search device according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The image retrieval method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a terminal 01 and a server 02, and the terminal 01 communicates with the server 02 through a network. The terminal 01 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 02 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, an image retrieval method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
In this embodiment, the first reference image may be a face image of a target person. Specifically, a face image of a target person is selected from a plurality of face images stored in advance, and the face image is subjected to image recognition through a neural network to obtain a first image feature of the face image. The first person attribute of the target person can be obtained according to the image recognition result, and the first person attribute sent by the terminal can also be received.
Wherein the character attributes may include at least one of appearance, wear, age, and gender. For example, the person attributes include height, weight, jacket color, pants color, whether glasses are worn, and the like. The embodiment of the invention does not limit the attributes of the characters in detail, and can be set according to the actual situation.
In this embodiment, the first data cluster stores image identifiers and image features of a plurality of candidate images, and after the first image feature is obtained, the first image feature is searched for from the first data cluster. And if the image characteristics of a plurality of candidate images which are consistent with the first image characteristics are found, taking the image identification of the found candidate images as the first image identification. The image features can be N-dimensional coordinates of the face image mapped to the N-dimensional space, namely the image features can be a string of characters, so that the first data cluster is a distributed cache ignite cluster, and rapid retrieval of the image features is supported. The ignite is a distributed database, a cache and a processing platform which take a memory as a center; it can process transaction, analysis and stream load in PB level data at the speed of memory level.
The second data cluster stores the image identification and the person attribute of each candidate image, and after the first person attribute of the target person is obtained, the first person attribute of the target person is searched from the second data cluster. And if the character attributes of a plurality of candidate images which are consistent with the first character attribute of the target character are found, taking the image identifier of the found candidate image as a second image identifier. The person attribute can be structured information, so that the second data cluster is a distributed solr cluster, the storage problem of a large amount of structured information can be solved, and full-text retrieval is supported. Solr is an open source enterprise search platform of Apache Lucene project, and the main functions of the search platform comprise full text retrieval, hit marking, facet search, dynamic clustering, database integration and processing of rich texts such as Word and PDF; solr is highly scalable, providing distributed search and index replication.
In this embodiment, if a plurality of first image identifiers are obtained, the plurality of first image identifiers are determined as target image identifiers; if the plurality of second image identifications are obtained, determining the plurality of second image identifications as target image identifications; if a plurality of first image identifications and a plurality of second image identifications are obtained, the plurality of first image identifications and the plurality of second image identifications can be used as target image identifications, and the intersection of the plurality of first image identifications and the plurality of second image identifications can also be used as target image identifications. The embodiment of the present invention is not limited in detail, and may be set according to actual situations.
In the image retrieval method, a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person are obtained; searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; at least one target image identifier is determined from the plurality of first image identifiers and/or the plurality of second image identifiers. According to the embodiment of the invention, the image characteristics of the candidate image are stored and retrieved by using the platform suitable for characteristic storage and retrieval, and the structural attributes of the candidate image are stored and retrieved by using the platform suitable for attribute storage and retrieval, so that the optimization of speed and precision is achieved. Moreover, retrieval is carried out according to multiple dimensions such as image characteristics and character attributes, and the screening accuracy is improved.
In another embodiment, as shown in fig. 3, this embodiment relates to an optional process of obtaining a plurality of first image identifiers and a plurality of second image identifiers. On the basis of the embodiment shown in fig. 2, the step 102 may specifically include the following steps:
In this embodiment, euclidean distances between each image feature in the first data cluster and the first image feature may be calculated, and cosine similarities between each image feature in the first data cluster and the first image feature may also be calculated. The embodiment of the invention does not limit the similarity calculation mode in detail, and can be set according to the actual situation.
In this embodiment, after the similarity between each image feature in the first data cluster and the first image feature is obtained, the image features are sorted according to the sequence of the similarity from large to small, and a preset number of image features with high similarity are used as target image features. For example, if the preset number is 5, 5 image features having a high similarity are set as the target image features. The preset number is not limited in detail in the embodiment of the invention, and can be set according to actual conditions.
In this embodiment, since each image feature in the first data cluster has a corresponding relationship with the image identifier, after the target image feature is obtained, the image identifier corresponding to the target image feature may be obtained according to the corresponding relationship, and the image identifier corresponding to the target image feature is used as the first image identifier.
And 204, matching the attributes of the persons in the second data cluster with the attributes of the first person to obtain a plurality of matched target person attributes.
In this embodiment, full-text fuzzy matching may be performed on each attribute in the second data cluster and the first attribute. Specifically, a keyword of the first person attribute is extracted, an edit distance between each person attribute in the second data cluster and the extracted keyword is calculated, and a person attribute with the edit distance conforming to a preset edit distance is used as a target person attribute. For example, if the first person attribute of the target person is that a yellow jacket is worn and the extracted keyword is yellow, the target person attribute including yellow shirt, yellow short sleeve, and the like can be obtained according to the edit distance. The extraction keywords can be extracted according to a preset keyword table, and can also be extracted in an entity identification mode. The embodiment of the invention does not limit the keyword extraction mode in detail, and can be set according to the actual situation.
Each attribute in the second data cluster may also be matched exactly to the first attribute. Specifically, the edit distance between each person attribute in the second data cluster and the first person attribute is calculated, and the person attribute with the edit distance meeting the preset edit distance is used as the target person attribute.
The editing distance may include at least one of a pinyin editing distance and a vocabulary editing distance. The embodiment of the invention does not limit the preset editing distance in detail and can be set according to the actual situation.
In this embodiment, since each person attribute in the second data cluster has a corresponding relationship with the image identifier, after the target person attribute is obtained, the image identifier corresponding to the target person attribute may be obtained according to the corresponding relationship, and the image identifier corresponding to the target person attribute is used as the second image identifier.
The steps of obtaining the first image identifier and the steps of obtaining the second image identifier are not limited in sequence, and can be set according to actual conditions.
In the process of obtaining the plurality of first image identifications and the plurality of second image identifications, calculating the similarity between each image characteristic in the first data cluster and the first image characteristic; selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small; determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature; matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes; and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image. By the embodiment of the invention, the candidate images are searched for the second time, so that the screening efficiency is improved; in addition, the secondary search is carried out from multiple dimensions such as image characteristics, character attributes and the like, and the screening accuracy is improved.
In another embodiment, as shown in fig. 4, this embodiment relates to an alternative process of image retrieval. On the basis of the embodiment shown in fig. 2, the method may specifically include the following steps:
step 301 obtains a second image feature of a second reference image of the target person and/or a second person attribute of the target person.
In this embodiment, a second reference image of the target person is obtained, and the second reference image is modeled, that is, each pixel in the second reference image is mapped to an N-dimensional space, so as to obtain a second image feature. The second reference image may be the same as the first reference image or different from the first reference image. The embodiment of the present invention is not limited in detail, and may be set according to actual situations.
The manner of obtaining the second person attribute may be the same as the manner of obtaining the first person attribute, and details thereof are not repeated herein.
In this embodiment, an image database is preset, and a large number of captured face images are stored in the image database. And after the second reference image is obtained, retrieving in the image database according to the second image characteristics of the second reference image. Specifically, the similarity between the second image feature and the image features of the face images in the image database is calculated, and a plurality of candidate images with the similarity meeting the preset similarity are obtained.
And/or after the second person attribute is obtained, searching in the image database according to the second person attribute. Specifically, the second person attribute is matched with the person attributes stored in the image database, so that a plurality of candidate images meeting the second person attribute are obtained.
In this embodiment, the image feature may be a string of characters, so that the first data cluster may adopt a distributed cache ignite cluster, thereby supporting fast retrieval of the image feature. The person attribute can be structured information, so that the second data cluster can adopt a distributed Solr cluster, the storage problem of a large amount of structured information can be solved, and full-text retrieval is supported.
In this embodiment, the terminal receives a first reference image selected by a user, and sends the first reference image to the server. The server receives a first reference image sent by the terminal, and performs feature extraction on the first reference image by adopting a neural network to obtain first image features of the first reference image.
And/or the terminal receives a first person attribute of a target person input by a user and sends the first person attribute to the server; the server receives the first person attribute sent by the terminal.
In practical application, a user browses candidate images on a terminal, a first reference image can be selected from the candidate images, and a first person attribute can also be known from the candidate images. If the user finds the side image of the target person after browsing a plurality of candidate images, the side image of the target person can be used as the first reference image. The candidate images may be retrieved according to the known attributes of the target person, so that when the user finds other attributes of the target person after browsing a plurality of candidate images, the newly found attributes of the target person may be used as the first attributes of the target person. Further search conditions may be obtained by browsing the candidate images for performing a secondary search based on the candidate images to further narrow the target image.
And step 306, selecting a preset number of target image features from the first data cluster according to the sequence of the similarity from large to small.
And 308, matching the attributes of the persons in the second data cluster with the attributes of the first person to obtain a plurality of matched target person attributes.
In this embodiment, after obtaining the plurality of first image identifiers, the first image identifiers may be used as target image identifiers; after obtaining a plurality of second image identifiers, the second image identifiers may be used as target image identifiers; after the plurality of first image identifiers and the plurality of second image identifiers are obtained, the intersection of the plurality of first image identifiers and the plurality of second image identifiers can be taken, that is, the same image identifier is searched, so that the target image identifier is obtained.
For example, if the plurality of first images are identified as A, B, C and the plurality of second images are identified as B, C, D, the same image identifications as B and C can be obtained, i.e., B and C are target image identifications.
And 311, sending the target image identifier to the terminal, so that the terminal can display the target image according to the target image identifier.
In this embodiment, after the target image identifier is obtained, the target image identifier may be sent to the terminal. After receiving the target image identifier, the terminal selects a target image from a preset image database according to the target image identifier, and then displays the target image.
In the image retrieval method, the server acquires a second image feature of a second reference image and/or a second person attribute of a target person from the terminal, then retrieves the second image feature and/or the second person attribute in a preset image database according to the second image feature and/or the second person attribute to obtain a plurality of candidate images which are similar to the second reference image and/or meet the second person attribute, then correspondingly stores the image identification and the image feature of each candidate image into a first data cluster, and correspondingly stores the image identification and the person attribute of each candidate image into a second data cluster. Then, the server receives a first reference image and/or a first person attribute sent by the terminal to obtain a first image feature of the first reference image; searching a plurality of first image identifications from the first data cluster according to the first image characteristics, and/or searching a plurality of second image identifications from the second data cluster according to the first person attributes; after obtaining a plurality of first image identifiers, the first image identifiers may be used as target image identifiers; after obtaining a plurality of second image identifiers, the second image identifiers may be used as target image identifiers; searching the same image identifier in the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier; and finally, the target image identifier is sent to the terminal so that the terminal can display the target image according to the target image identifier. According to the embodiment of the invention, the server retrieves the second reference image of the concerned person to obtain a large number of candidate images, and then retrieves the second reference image and the first person attribute of the concerned person according to the first reference image and the first person attribute of the concerned person input by the staff, so that the screening efficiency is improved, and the manpower is saved; and the screening accuracy can be improved.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Furthermore, at least a portion of the steps in FIGS. 2-4 may include multiple sub-steps or multiple stages, for example, only one set of steps is included in steps 305-307 and 308-309. These sub-steps or stages are not necessarily performed at the same time, but may be performed at different times, and the order of performing these sub-steps or stages is not necessarily sequential, but may be performed alternately or in alternation with other steps or at least a part of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided an image retrieval apparatus including:
a first obtaining module 401, configured to obtain a first image feature of a first reference image of a target person and/or a first person attribute of the target person;
a searching module 402, configured to search in the first data cluster according to the first image feature to obtain a plurality of first image identifiers; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
a target image identifier determining module 403, configured to determine at least one target image identifier according to the plurality of first image identifiers and/or the plurality of second image identifiers.
In one embodiment, the first data cluster is a distributed cache ignite cluster, and the second data cluster is a distributed solr cluster.
In one embodiment, the apparatus further comprises:
a second obtaining module, configured to obtain a second image feature of a second reference image of the target person and/or a second person attribute of the target person;
the retrieval module is used for retrieving in a preset image database according to the second image characteristics and/or the second person attributes to obtain a plurality of candidate images which are similar to the second reference image and/or meet the second person attributes;
and the storage module is used for correspondingly storing the image identification and the image characteristic of each candidate image into the first data cluster and correspondingly storing the image identification and the character attribute of each candidate image into the second data cluster.
In one embodiment, the searching module 402 is specifically configured to calculate similarity between each image feature in the first data cluster and the first image feature; selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small; determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature; matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes; and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
In one embodiment, the target image identifier determining module 403 is specifically configured to search for the same image identifier from the multiple first image identifiers and the multiple second image identifiers to obtain at least one target image identifier.
In one embodiment, the first obtaining module 401 is specifically configured to receive a first reference image and/or a first person attribute sent by a terminal; and performing feature extraction on the first reference image to obtain a first image feature.
In one embodiment, the apparatus further comprises:
and the target image identifier sending module is used for sending the target image identifier to the terminal so that the terminal can display the target image according to the target image identifier.
For specific limitations of the image retrieval apparatus, reference may be made to the above limitations of the image retrieval method, which are not described herein again. The modules in the image retrieval device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing image retrieval data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image retrieval method.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person;
searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
at least one target image identifier is determined from the plurality of first image identifiers and/or the plurality of second image identifiers.
In one embodiment, the first data cluster is a distributed cache ignite cluster, and the second data cluster is a distributed solr cluster.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a second image characteristic of a second reference image of the target person and/or a second person attribute of the target person;
searching in a preset image database according to the second image characteristics and/or the second person attributes to obtain a plurality of candidate images which are similar to the second reference image and/or meet the second person attributes;
and storing the image identification and the image characteristic of each candidate image into a first data cluster correspondingly, and storing the image identification and the character attribute of each candidate image into a second data cluster correspondingly.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
calculating the similarity between each image feature in the first data cluster and the first image feature;
selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small;
determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature;
matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes;
and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and searching the same image identifier in the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a first reference image and/or a first person attribute sent by a terminal;
and performing feature extraction on the first reference image to obtain a first image feature.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and sending the target image identifier to the terminal so that the terminal can display the target image according to the target image identifier.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person;
searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in a second data cluster according to the second person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
at least one target image identifier is determined from the plurality of first image identifiers and/or the plurality of second image identifiers.
In one embodiment, the computer program when executed by the processor further performs the steps of:
calculating the similarity between each image feature in the first data cluster and the first image feature;
selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small;
determining a first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier of the candidate image and the image feature;
matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes;
and determining a second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and searching the same image identifier in the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a first reference image and/or a first person attribute sent by a terminal;
and performing feature extraction on the first reference image to obtain a first image feature.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and sending the target image identifier to the terminal so that the terminal can display the target image according to the target image identifier.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. An image retrieval method, characterized in that the method comprises:
acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person;
searching in a first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in a second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
determining at least one target image identifier from a plurality of said first image identifiers and/or a plurality of said second image identifiers.
2. The method of claim 1, wherein the first data cluster is a distributed cache ignite cluster and the second data cluster is a distributed solr cluster.
3. The method of claim 1, wherein prior to finding the plurality of first image identifiers in the first data cluster based on the first image features, the method further comprises:
acquiring a second image characteristic of a second reference image of the target person and/or a second person attribute of the target person;
retrieving in a preset image database according to the second image feature and/or the second person attribute to obtain a plurality of candidate images similar to the second reference image and/or satisfying the second person attribute;
and storing the image identification and image characteristic correspondence of each candidate image into the first data cluster, and storing the image identification and character attribute correspondence of each candidate image into the second data cluster.
4. The method of claim 1, wherein the finding in the first data cluster according to the first image feature to obtain a plurality of first image identifiers comprises:
calculating the similarity between each image feature in the first data cluster and the first image feature;
selecting a preset number of target image features from the first data cluster according to the sequence of similarity from large to small;
determining the first image identifier corresponding to each target image feature according to the corresponding relation between the image identifier and the image feature of the candidate image;
the searching in the second data cluster according to the first person attribute to obtain a plurality of second image identifiers includes:
matching each person attribute in the second data cluster with the first person attribute to obtain a plurality of matched target person attributes;
and determining the second image identifier corresponding to each target character attribute according to the corresponding relation between the image identifier and the character attribute of the candidate image.
5. The method according to claim 1, wherein determining at least one target image identifier from a plurality of the first image identifiers and/or a plurality of the second image identifiers comprises:
and searching the same image identifier in the plurality of first image identifiers and the plurality of second image identifiers to obtain at least one target image identifier.
6. The method of any of claims 1-5, wherein obtaining the first image characteristic of the first reference image of the target person and/or the first person attribute of the target person comprises:
receiving the first reference image and/or the first person attribute sent by a terminal;
and performing feature extraction on the first reference image to obtain the first image feature.
7. The method according to claim 6, wherein after said determining at least one target image identifier from a plurality of said first image identifiers and/or a plurality of said second image identifiers, the method further comprises:
and sending the target image identifier to the terminal so that the terminal can display a target image according to the target image identifier.
8. An image retrieval apparatus, characterized in that the apparatus comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first image characteristic of a first reference image of a target person and/or a first person attribute of the target person;
the searching module is used for searching in the first data cluster according to the first image characteristics to obtain a plurality of first image identifications; and/or searching in a second data cluster according to the first person attribute to obtain a plurality of second image identifications; the first data cluster stores image identifications and image characteristics of a plurality of candidate images, and the second data cluster stores image identifications and person attributes of the candidate images;
and the target image identification determining module is used for determining at least one target image identification according to the plurality of first image identifications and/or the plurality of second image identifications.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910949093.5A CN110688516A (en) | 2019-10-08 | 2019-10-08 | Image retrieval method, image retrieval device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910949093.5A CN110688516A (en) | 2019-10-08 | 2019-10-08 | Image retrieval method, image retrieval device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110688516A true CN110688516A (en) | 2020-01-14 |
Family
ID=69111589
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910949093.5A Pending CN110688516A (en) | 2019-10-08 | 2019-10-08 | Image retrieval method, image retrieval device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110688516A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111581421A (en) * | 2020-04-30 | 2020-08-25 | 京东方科技集团股份有限公司 | Image retrieval method, image retrieval device, and image retrieval system |
CN112241684A (en) * | 2020-09-16 | 2021-01-19 | 四川天翼网络服务有限公司 | Face retrieval distributed computing method and system |
CN114528321A (en) * | 2022-01-25 | 2022-05-24 | 北京三快在线科技有限公司 | Data retrieval method and device, electronic equipment and readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107451208A (en) * | 2017-07-12 | 2017-12-08 | 北京潘达互娱科技有限公司 | A kind of data search method and device |
CN108334644A (en) * | 2018-03-30 | 2018-07-27 | 百度在线网络技术(北京)有限公司 | Image-recognizing method and device |
CN108664526A (en) * | 2017-04-01 | 2018-10-16 | 华为技术有限公司 | The method and apparatus of retrieval |
CN109800269A (en) * | 2018-12-13 | 2019-05-24 | 中国平安财产保险股份有限公司 | Data managing method, device, computer equipment and storage medium |
CN110019870A (en) * | 2017-12-29 | 2019-07-16 | 浙江宇视科技有限公司 | The image search method and system of image cluster based on memory |
US20190236095A1 (en) * | 2018-01-26 | 2019-08-01 | Walmart Apollo, Llc | Automatic personalized image-based search |
-
2019
- 2019-10-08 CN CN201910949093.5A patent/CN110688516A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108664526A (en) * | 2017-04-01 | 2018-10-16 | 华为技术有限公司 | The method and apparatus of retrieval |
CN107451208A (en) * | 2017-07-12 | 2017-12-08 | 北京潘达互娱科技有限公司 | A kind of data search method and device |
CN110019870A (en) * | 2017-12-29 | 2019-07-16 | 浙江宇视科技有限公司 | The image search method and system of image cluster based on memory |
US20190236095A1 (en) * | 2018-01-26 | 2019-08-01 | Walmart Apollo, Llc | Automatic personalized image-based search |
CN108334644A (en) * | 2018-03-30 | 2018-07-27 | 百度在线网络技术(北京)有限公司 | Image-recognizing method and device |
CN109800269A (en) * | 2018-12-13 | 2019-05-24 | 中国平安财产保险股份有限公司 | Data managing method, device, computer equipment and storage medium |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111581421A (en) * | 2020-04-30 | 2020-08-25 | 京东方科技集团股份有限公司 | Image retrieval method, image retrieval device, and image retrieval system |
WO2021219117A1 (en) * | 2020-04-30 | 2021-11-04 | 京东方科技集团股份有限公司 | Image retrieval method, image retrieval device, image retrieval system and image display system |
CN111581421B (en) * | 2020-04-30 | 2024-06-04 | 京东方科技集团股份有限公司 | Image retrieval method, image retrieval device, and image retrieval system |
US12026192B2 (en) | 2020-04-30 | 2024-07-02 | Boe Technology Group Co., Ltd. | Image retrieval method, image retrieval devices, image retrieval system and image display system |
CN112241684A (en) * | 2020-09-16 | 2021-01-19 | 四川天翼网络服务有限公司 | Face retrieval distributed computing method and system |
CN114528321A (en) * | 2022-01-25 | 2022-05-24 | 北京三快在线科技有限公司 | Data retrieval method and device, electronic equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110765275B (en) | Search method, search device, computer equipment and storage medium | |
CN110457680B (en) | Entity disambiguation method, device, computer equipment and storage medium | |
CN109063108B (en) | Search ranking method and device, computer equipment and storage medium | |
CN108874992B (en) | Public opinion analysis method, system, computer equipment and storage medium | |
CN109033386B (en) | Search ranking method and device, computer equipment and storage medium | |
CN110377558B (en) | Document query method, device, computer equipment and storage medium | |
CN109086394B (en) | Search ranking method and device, computer equipment and storage medium | |
CN108334632B (en) | Entity recommendation method and device, computer equipment and computer-readable storage medium | |
US20180165370A1 (en) | Methods and systems for object recognition | |
US8498455B2 (en) | Scalable face image retrieval | |
CN108664595B (en) | Domain knowledge base construction method and device, computer equipment and storage medium | |
CN111078971A (en) | Screening method, device, terminal and storage medium for resume files | |
CN111177405A (en) | Data search matching method and device, computer equipment and storage medium | |
CN112651236B (en) | Method and device for extracting text information, computer equipment and storage medium | |
CN109800346B (en) | Text matching method and device, computer equipment and storage medium | |
CN110362798B (en) | Method, apparatus, computer device and storage medium for judging information retrieval analysis | |
CN113254687B (en) | Image retrieval and image quantification model training method, device and storage medium | |
US20160283564A1 (en) | Predictive visual search enginge | |
CN110880006A (en) | User classification method and device, computer equipment and storage medium | |
CN110688516A (en) | Image retrieval method, image retrieval device, computer equipment and storage medium | |
US11645478B2 (en) | Multi-lingual tagging for digital images | |
CN111507285A (en) | Face attribute recognition method and device, computer equipment and storage medium | |
CN112528022A (en) | Method for extracting characteristic words corresponding to theme categories and identifying text theme categories | |
CN112685475A (en) | Report query method and device, computer equipment and storage medium | |
CN111737548A (en) | Click verification code identification method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200114 |
|
RJ01 | Rejection of invention patent application after publication |