CN112395441A - Object retrieval method and device - Google Patents
Object retrieval method and device Download PDFInfo
- Publication number
- CN112395441A CN112395441A CN201910750904.9A CN201910750904A CN112395441A CN 112395441 A CN112395441 A CN 112395441A CN 201910750904 A CN201910750904 A CN 201910750904A CN 112395441 A CN112395441 A CN 112395441A
- Authority
- CN
- China
- Prior art keywords
- image
- attribute information
- attribute
- image features
- similarity
- 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
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000012545 processing Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
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/53—Querying
- G06F16/532—Query formulation, e.g. graphical querying
-
- 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
Abstract
The application discloses an object retrieval method, and belongs to the field of data retrieval. The method comprises the following steps: acquiring an object retrieval statement, wherein the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition; determining image features corresponding to the attribute information meeting the attribute conditions in the attribute information and the image features of each object stored in the database server, and taking the image features as image features to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; and feeding back the object retrieval statement based on the attribute information corresponding to the second image feature. By the method and the device, the object can be effectively retrieved.
Description
Technical Field
The present application relates to the field of data retrieval technologies, and in particular, to a method and an apparatus for object retrieval.
Background
With the progress of society, people's attention to the society is not limited to economy and high-speed development of science and technology, and more people pay more attention to public security. Management departments are increasing the strength of building a safe society, and therefore, a method for rapidly searching the identity of an object is urgently needed.
Disclosure of Invention
The embodiment of the application provides an object retrieval method. The technical scheme of the method is as follows:
in a first aspect, a method for object retrieval is provided, the method comprising:
acquiring an object retrieval statement, wherein the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition;
determining image features corresponding to the attribute information meeting the attribute conditions in the attribute information and the image features of each object stored in the database server, and taking the image features as image features to be compared;
determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared;
and feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
Optionally, the object retrieval statement further carries a feedback number N;
after determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition, the method further includes:
sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small;
the feeding back the object retrieval statement based on the attribute information corresponding to the second image feature includes:
and feeding back the object retrieval statement based on the attribute information corresponding to the N second image features.
Optionally, the object retrieval statement further carries a feedback attribute item;
the feeding back the object retrieval statement based on the attribute information corresponding to the N second image features includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target equipment.
Optionally, the object retrieval statement is a statement generated based on structured query language SQL.
Optionally, the attribute condition is an attribute condition corresponding to at least one search attribute item;
the determining, in the attribute information and the image features of each object stored in the database server, an image feature corresponding to the attribute information that satisfies the attribute condition as an image feature to be compared includes:
acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in a disk of the database server through a Central Processing Unit (CPU) of the database server, and sending the image characteristics of each object and the attribute information corresponding to the retrieval attribute item to a Graphic Processing Unit (GPU) of the database server;
determining the image characteristics corresponding to the attribute information meeting the attribute conditions through the GPU, and using the image characteristics as the image characteristics to be compared;
the determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition includes:
determining, by the GPU, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition among the image features to be compared;
the sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, includes:
sorting the second image features according to the sequence of the similarity from large to small through the GPU, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, determining object identifications corresponding to the N second image features, and sending the object identifications to the CPU;
the sending, to the target device, attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to target equipment through the CPU.
Optionally, the attribute condition is an attribute condition corresponding to at least one search attribute item;
the determining, in the attribute information and the image features of each object stored in the database server, an image feature corresponding to the attribute information that satisfies the attribute condition as an image feature to be compared includes:
acquiring, by the CPU, image features of each object, attribute information corresponding to the search attribute item, and attribute information corresponding to the feedback attribute item from the attribute information and the image features of each object stored in the disk;
the determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition includes:
determining, by the CPU, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition among the image features to be compared;
the sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, includes:
sorting the second image features according to the sequence of the similarity from large to small through the CPU, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, and determining object identifications corresponding to the N second image features;
the sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target device includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to target equipment through the CPU.
In a second aspect, there is provided a database server, wherein the computer device comprises a processor and a memory, wherein:
the processor is used for acquiring an object retrieval statement, wherein the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition; determining image features corresponding to the target attribute information meeting the attribute conditions in the attribute information and the image features of each object stored in the memory, and taking the image features as image features to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; and feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
Optionally, the object retrieval statement further carries a feedback number N;
the processor is further configured to:
sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small; and feeding back the object retrieval statement based on the attribute information corresponding to the N second image features.
Optionally, the object retrieval statement further carries a feedback attribute item;
the processor is configured to:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target equipment.
Optionally, the object retrieval statement is a statement generated based on structured query language SQL.
Optionally, the processor includes a central processing unit CPU and a graphics processing unit GPU, the memory is a disk, and the attribute condition is an attribute condition corresponding to at least one search attribute item;
the CPU is used for acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in the disk of the database server, and sending the image characteristics of each object and the attribute information corresponding to the retrieval attribute item to the GPU;
the GPU is used for determining the image characteristics corresponding to the attribute information meeting the attribute conditions as the image characteristics to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, determining object identifications corresponding to the N second image features, and sending the object identifications to the CPU;
and the CPU is used for sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identification to the target equipment.
Optionally, the processor includes a CPU, and the attribute condition is an attribute condition corresponding to at least one search attribute item;
the CPU is used for acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in the disk; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, and determining object identifications corresponding to the N second image features; and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to target equipment.
In a fourth aspect, there is provided a computer readable storage medium having stored therein at least one instruction which is loaded and executed by the processor to implement the method of object retrieval as described in the first aspect above.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the database server obtains the object retrieval statement, and then, the image feature corresponding to the attribute information meeting the attribute condition can be determined from the attribute information and the image feature of each object stored in the database server and is used as the image feature to be compared. And comparing each image feature to be compared with the first image feature to obtain corresponding feature similarity, and determining a second image feature meeting the image feature similarity condition. Finally, the object retrieval statement can be fed back according to the attribute information corresponding to the second image characteristic, and the object retrieval purpose can be effectively achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flowchart of a method for object retrieval according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for object retrieval according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for object retrieval according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a database server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, in the embodiment of the present application, a target device may be a mobile phone, a notebook, a desktop, a server, and the like on a user side, the target device may directly establish communication with a database server, the target device may directly send an object retrieval statement to the database server, and the database server performs retrieval and feeds back the retrieval statement to the target device according to the object retrieval statement.
Fig. 2 is a flowchart of object retrieval according to an embodiment of the present disclosure. Referring to fig. 2, the embodiment includes:
The object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition.
In implementation, a user may perform feature extraction on an obtained image of an object to be retrieved in advance, where the obtained image feature of the object to be retrieved is a first image feature, and the first image feature information may be a binary feature. Then, the retrieval condition may be determined according to the actual requirement, and the retrieval condition may generally include an image feature similarity condition and an attribute condition, for example, the image feature similarity condition may be that the image feature similarity is greater than 0.98, and for a case that the object to be retrieved is a person, the attribute condition may include a basic attribute similar to the person: sex, age, native place, etc., such as sex male, age greater than 40.
The target device is configured with a database API (Application Programming Interface), and the target device may send an object search statement to the database server through the database API, where the object search statement includes the determined first image feature and search condition. And the database server receives the object retrieval statement sent by the target equipment.
In implementation, the database server may store the attribute information and image features of each object in the form of a table, and for each object, the table may include the attribute information and image features of the object, such as name, gender, native place, identification number, and the like. The database server may determine, from the attribute information and the image features of each object stored in the database server, an image feature corresponding to the attribute information that satisfies the attribute condition as an image feature to be compared.
And 203, determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared.
In implementation, after determining the image features to be compared, the database server calculates the similarity between the image features to be compared and the first image features carried in the object retrieval statement. For example, the image feature is a binary feature, and then the similarity may be the difference product of two binary data. And determining a second image feature meeting the image feature similarity condition.
Optionally, the user may specify the number of feedback to be obtained as required, that is, the number of feedback N may be carried in the object retrieval statement, and after the second image features are determined, the second image features may be sorted according to a descending order of similarity, and the N second image features may be selected from the sorted second image features according to a descending order of similarity.
In an implementation, the database server may sort the similarity of each second image feature to the first image feature in an order from major to minor. And selecting the corresponding second image features with the similarity rank N at the top.
And step 204, feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
In implementation, the database server may feed back all the determined attribute information corresponding to the second image feature satisfying the image feature similarity condition to the target device. For example, the attribute information stored in the database server includes name, age, native place, identification number, and sex, and these pieces of information of the second image feature can be fed back to the target device at the time of feedback. In addition, the database server may feed back some of them to the target device.
Optionally, the user may specify, according to a requirement, which attribute items the user wants to obtain, that is, the object retrieval statement further carries the feedback attribute items, and accordingly, the processing in step 204 may be as follows: and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the second image characteristic to the target device.
In implementation, the feedback attribute items generally required by the user may generally be names, ages, native places, and the like, and when feeding back the object retrieval statement, the database server may only feed back the attribute information corresponding to the feedback attribute items in the attribute information corresponding to the second image feature to the target device for the user to view.
In addition, the user may also specify the feedback attribute item while specifying the feedback number N, and then the above processing may be: and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target device.
Optionally, when the user uses the database server to perform object retrieval, the object retrieval statement sent by the target device may be a statement generated based on SQL (Structured Query Language). The following exemplarily enumerates an object retrieval statement "select name, address, time, and similarity (" face model ") as similarity from table similarity >0.98 and" seq "by similarity limit 1" generated based on SQL, where name, address, and time are feedback attribute items name, native place, and age, face model is a first image feature, similarity >0.98 represents an image feature similarity condition in the retrieval condition, and "seq" 1 represents that an attribute condition in the retrieval condition is male (corresponding 0 may represent female, and certainly, different definitions are in the database, 1 may also be female, and 0 is male), and similarity limit 1 represents a feedback number 1, that is, information corresponding to a second image feature having the highest similarity to the first image feature is fed back. Based on this, when the user searches for the object, the user can directly add the required search condition in the statement, the search condition of each time can be different, and the database server does not need to make any change because the statement is a structured standard statement.
When executing the object search statement, the database server may adopt a CPU (Central Processing Unit) operation mode or a GPU (Graphics Processing Unit) operation mode, and which mode to use may be set by a technician according to actual conditions.
Fig. 3 is a flowchart of object retrieval according to an embodiment of the present disclosure. In this embodiment, the database server is in the GPU operation mode. Referring to fig. 3, the embodiment includes:
step 301, the target device sends an object search statement to the database server.
The object retrieval statement carries a first image feature and a retrieval condition, wherein the retrieval condition comprises an image feature similarity condition, an attribute condition, a feedback number N and a feedback attribute item. The object retrieval statement may be a statement written based on the above-described SQL.
Step 302, the CPU in the database server obtains the object retrieval statement and parses the optimized object retrieval statement.
In implementation, after acquiring the object search statement, the CPU analyzes and optimizes the object search statement. For the optimization of the object retrieval statement, a retrieval optimizer may be used, the query optimizer being a computational cost-based optimizer that analyzes a plurality of candidate retrieval plans for a given retrieval condition and estimates the computational cost of each candidate retrieval plan, thereby selecting a retrieval plan with the lowest computational cost for execution. For example, the sequence of the retrieval conditions is adjusted according to a preset rule, the retrieval conditions in the obtained object retrieval statement are male sex with similarity greater than 0.98, obviously, if the retrieval is performed according to the sequence of the retrieval conditions, the first image features are firstly calculated, the similarity between the first image features and the image features of all objects stored in the database server is calculated, and male sex is retrieved, so that the calculation resources are obviously wasted, the retrieval conditions can be optimized to be male sex with similarity greater than 0.98, namely the image features corresponding to male sex are retrieved, and then the similarity between the image features and the first image features is further calculated, so that the calculation resources are obviously saved.
Step 303, the CPU obtains the image features of each object, the attribute information corresponding to the search attribute item, and the attribute information corresponding to the feedback attribute item from the attribute information and the image features of each object stored in the disk of the database server.
In implementation, when acquiring data from the disk, the CPU may acquire only image features of each object, attribute information corresponding to the search attribute item, and attribute information corresponding to the feedback attribute item, without acquiring all data. For example, if the attribute items include name, gender, age, native place, and the like, and the search attribute item in the search condition is only gender, then only information corresponding to the gender of the attribute item of each object may be acquired for the attribute information. In addition, it should be further described herein that, during one retrieval, the CPU obtains from the disk and loads the image features of each object, the attribute information corresponding to the retrieval attribute item, and the attribute information corresponding to the feedback attribute item into the memory of the CPU, and for the subsequent retrieval, the CPU may determine whether it is necessary to obtain the attribute information from the disk again according to the retrieval attribute item and the feedback attribute item retrieved this time, and if the retrieval attribute item and the feedback attribute item of two times are the same, it is not necessary to obtain the attribute information from the disk again, and if the retrieval attribute item and the feedback attribute item of two times are different, it is possible to obtain the attribute information corresponding to the attribute item that is not loaded in the memory from the disk again. The following description will be made by taking an example.
For example, in one search, the search attribute item is gender, and the feedback attribute items are name and native, so that the CPU can load attribute information corresponding to gender, name, and native into the memory of the CPU. After the retrieval is finished, the CPU does not need to delete the attribute information corresponding to the gender, name and place loaded in the memory. In the next retrieval, if the retrieval attribute items and the feedback attribute items are still sex, name and native place, the retrieval attribute items and the feedback attribute items do not need to be obtained from a disk; if the gender and the age of the attribute item are retrieved, and the feedback attribute item is the name and the native place, acquiring attribute information corresponding to the age from a disk; if the gender and the age of the retrieval attribute item and the feedback attribute item are names, the retrieval and the feedback do not use the attribute information corresponding to the native place, so that the attribute information corresponding to the age needs to be acquired, and the capacity of the memory is limited, the CPU can judge whether the memory space is enough to load the attribute information corresponding to the age, if so, the attribute information corresponding to the native place does not need to be deleted from the memory, and if not, the attribute information corresponding to the native place needs to be deleted to load the attribute information corresponding to the age. When the search attribute item and the feedback attribute item are other attribute items, the specific processing is similar to the above, and details are not described here.
And step 304, the CPU sends the image characteristics of each object and the attribute information corresponding to the retrieval attribute item to the GPU of the database server.
Step 305, the GPU determines the image features corresponding to the attribute information that satisfies the attribute condition as the image features to be compared.
Step 306, the GPU determines, among the image features to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition.
And 307, the GPU sequences the second image features according to the sequence of the similarity from large to small, selects N second image features from the sequenced second image features according to the sequence of the similarity from large to small, and determines object identifications corresponding to the N second image features.
In an implementation, the database server may store the attribute information and the image characteristics of each object in the form of a table. In the table, each object may correspond to an object identifier, that is, attribute information and image characteristics of each object correspond to an object identifier, and the object identifier may be a serial number, such as 1, 2, 3, or the like. In the above step 303, when the CPU acquires the image feature of each object from the disk and the attribute information corresponding to the search attribute item, the CPU may acquire the object identifiers of the objects together.
And step 308, the GPU sends the object identification to the CPU.
Step 309, the CPU sends the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to the target device.
It should be noted that, the specific implementation of the above steps is the same as or similar to the specific implementation of the relevant steps described in fig. 2, and is not repeated here.
Fig. 4 is a flowchart of object retrieval according to an embodiment of the present disclosure. In this embodiment, the database server is in a CPU operation mode. Referring to fig. 4, the embodiment includes:
step 401, the target device sends an object retrieval statement to the database server.
The object retrieval statement carries a first image feature and a retrieval condition, wherein the retrieval condition comprises an image feature similarity condition, an attribute condition, a feedback number N and a feedback attribute item. The object retrieval statement may be a statement written based on the above-described SQL.
Step 402, the CPU in the database server obtains the object retrieval statement and parses the optimized object retrieval statement.
Step 403, the CPU obtains the image features of each object, the attribute information corresponding to the search attribute item, and the attribute information corresponding to the feedback attribute item from the attribute information and the image features of each object stored in the disk of the database server.
Step 404, the CPU determines the image feature corresponding to the attribute information satisfying the attribute condition as the image feature to be compared.
Step 405, the CPU determines, among the image features to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition.
And 406, the CPU sequences the second image features according to the descending order of the similarity, selects N second image features from the sequenced second image features according to the descending order of the similarity, and determines object identifiers corresponding to the N second image features.
Step 407, the CPU sends the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to the target device.
It should be noted that, the specific implementation of the above steps is the same as or similar to the specific implementation of the relevant steps described in fig. 2 and fig. 3, and is not repeated here.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Based on the same technical concept, an embodiment of the present application further provides a database server, as shown in fig. 5, the database server includes: a processor 501 and a memory 502.
The processor 501 is configured to obtain an object retrieval statement, where the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition includes an image feature similarity condition and an attribute condition; determining image features corresponding to the attribute information meeting the attribute conditions from the attribute information and the image features of each object stored in the memory 502 as image features to be compared, and determining second image features of which the similarity with the first image features meets the image feature similarity conditions from the image features to be compared; and the object retrieval statement is used for feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
Optionally, the object retrieval statement further carries a feedback number N;
the processor 501 is further configured to:
sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small; and feeding back the object retrieval statement based on the attribute information corresponding to the N second image features.
Optionally, the object retrieval statement further carries a feedback attribute item;
the processor 501 is configured to:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target equipment.
Optionally, the object retrieval statement is a statement generated based on structured query language SQL.
Optionally, the processor 501 includes a central processing unit CPU and a graphics processing unit GPU, the memory 502 is a disk, and the attribute condition is an attribute condition corresponding to at least one retrieval attribute item;
the CPU is used for acquiring the image characteristics of each object and the attribute information corresponding to the retrieval attribute items from the attribute information and the image characteristics of each object stored in the disk of the database server, and sending the attribute information and the image characteristics to a Graphic Processing Unit (GPU) of the database server;
the GPU is used for determining the image characteristics corresponding to the attribute information meeting the attribute conditions as the image characteristics to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, determining object identifications corresponding to the N second image features, and sending the object identifications to the CPU;
and the CPU is used for acquiring the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identification in the attribute information of each object stored in the disk, and sending the attribute information to the target equipment.
Optionally, the attribute condition is an attribute condition corresponding to at least one search attribute item;
the CPU is used for acquiring the image characteristics of each object and the attribute information corresponding to the retrieval attribute item from the attribute information and the image characteristics of each object stored in the disk; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, and determining object identifications corresponding to the N second image features; and acquiring attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier from the attribute information of each object stored in the disk, and sending the attribute information to target equipment.
It should be noted that, the specific manner of the operations performed by the processor in the above embodiments has been described in detail in the above embodiments of the method for object retrieval, and will not be described in detail here.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, is also provided that includes instructions executable by a processor in a database server to perform the method of object retrieval in the above embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (12)
1. A method of object retrieval, the method comprising:
acquiring an object retrieval statement, wherein the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition;
determining image features corresponding to the attribute information meeting the attribute conditions in the attribute information and the image features of each object stored in the database server, and taking the image features as image features to be compared;
determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared;
and feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
2. The method according to claim 1, wherein the object retrieval statement further carries a feedback number N;
after determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition, the method further includes:
sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small;
the feeding back the object retrieval statement based on the attribute information corresponding to the second image feature includes:
and feeding back the object retrieval statement based on the attribute information corresponding to the N second image features.
3. The method according to claim 2, wherein the object retrieval statement further carries a feedback attribute item;
the feeding back the object retrieval statement based on the attribute information corresponding to the N second image features includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target equipment.
4. The method of claim 1, wherein the object retrieval statement is a statement generated based on the Structured Query Language (SQL).
5. The method according to claim 3, wherein the determining, as the image features to be compared, the image features corresponding to the attribute information that satisfies the attribute condition, from among the attribute information and the image features of each object stored in the database server, includes:
acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in a disk of the database server through a Central Processing Unit (CPU) of the database server, and sending the image characteristics of each object and the attribute information corresponding to the retrieval attribute item to a Graphic Processing Unit (GPU) of the database server;
determining the image characteristics corresponding to the attribute information meeting the attribute conditions through the GPU, and using the image characteristics as the image characteristics to be compared;
the determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition includes:
determining, by the GPU, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition among the image features to be compared;
the sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, includes:
sorting the second image features according to the sequence of the similarity from large to small through the GPU, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, determining object identifications corresponding to the N second image features, and sending the object identifications to the CPU;
the sending, to the target device, attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to target equipment through the CPU.
6. The method according to claim 3, wherein the attribute condition is an attribute condition corresponding to at least one search attribute item;
the determining, in the attribute information and the image features of each object stored in the database server, an image feature corresponding to the attribute information that satisfies the attribute condition as an image feature to be compared includes:
acquiring, by the CPU, image features of each object, attribute information corresponding to the search attribute item, and attribute information corresponding to the feedback attribute item from the attribute information and the image features of each object stored in the disk, and determining image features corresponding to the attribute information that satisfies the attribute condition as image features to be compared;
the determining, in each image feature to be compared, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition includes:
determining, by the CPU, a second image feature whose similarity to the first image feature satisfies the image feature similarity condition among the image features to be compared;
the sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, includes:
sorting the second image features according to the sequence of the similarity from large to small through the CPU, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, and determining object identifications corresponding to the N second image features;
the sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target device includes:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to the target equipment through the CPU.
7. A database server, comprising a processor and a memory, wherein:
the processor is used for acquiring an object retrieval statement, wherein the object retrieval statement carries a first image feature and a retrieval condition, and the retrieval condition comprises an image feature similarity condition and an attribute condition; determining image features corresponding to the target attribute information meeting the attribute conditions in the attribute information and the image features of each object stored in the memory, and taking the image features as image features to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; and feeding back the object retrieval statement based on the attribute information corresponding to the second image feature.
8. The computer device according to claim 7, wherein the object retrieval statement further carries a feedback number N;
the processor is further configured to:
sorting the second image features according to the sequence of the similarity from large to small, and selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small; and feeding back the object retrieval statement based on the attribute information corresponding to the N second image features.
9. The database server according to claim 8, wherein the object retrieval statement further carries a feedback attribute item;
the processor is configured to:
and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the N second image features to the target equipment.
10. The database server according to claim 7, wherein the object retrieval statement is a statement generated based on the Structured Query Language (SQL).
11. The database server according to claim 9, wherein the processor includes a Central Processing Unit (CPU) and a Graphics Processing Unit (GPU), the memory is a disk, and the attribute condition is an attribute condition corresponding to at least one search attribute item;
the CPU is used for acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in the disk of the database server, and sending the image characteristics of each object and the attribute information corresponding to the retrieval attribute item to the GPU;
the GPU is used for determining the image characteristics corresponding to the attribute information meeting the attribute conditions as the image characteristics to be compared; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, determining object identifications corresponding to the N second image features, and sending the object identifications to the CPU;
and the CPU is used for sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identification to the target equipment.
12. The database server according to claim 9, wherein the processor includes a CPU, and the attribute condition is an attribute condition corresponding to at least one search attribute item;
the CPU is used for acquiring the image characteristics of each object, the attribute information corresponding to the retrieval attribute item and the attribute information corresponding to the feedback attribute item from the attribute information and the image characteristics of each object stored in the disk; determining a second image feature of which the similarity with the first image feature meets the image feature similarity condition in each image feature to be compared; sorting the second image features according to the sequence of the similarity from large to small, selecting N second image features from the sorted second image features according to the sequence of the similarity from large to small, and determining object identifications corresponding to the N second image features; and sending the attribute information corresponding to the feedback attribute item in the attribute information corresponding to the object identifier to target equipment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910750904.9A CN112395441A (en) | 2019-08-14 | 2019-08-14 | Object retrieval method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910750904.9A CN112395441A (en) | 2019-08-14 | 2019-08-14 | Object retrieval method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112395441A true CN112395441A (en) | 2021-02-23 |
Family
ID=74601484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910750904.9A Pending CN112395441A (en) | 2019-08-14 | 2019-08-14 | Object retrieval method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112395441A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1268710A (en) * | 1999-03-24 | 2000-10-04 | 富士写真胶片株式会社 | Device and method for database searching |
EP0657831B1 (en) * | 1993-12-09 | 2005-05-11 | Canon Kabushiki Kaisha | Image retrieving method and apparatus |
CN101136042A (en) * | 2006-08-29 | 2008-03-05 | 株式会社东芝 | Image-display device and an image-display system |
CN106846317A (en) * | 2017-02-27 | 2017-06-13 | 北京连心医疗科技有限公司 | A kind of feature based extracts the method for retrieving medicine image with Similarity matching |
CN108009465A (en) * | 2016-10-31 | 2018-05-08 | 杭州海康威视数字技术股份有限公司 | A kind of face identification method and device |
CN108304431A (en) * | 2017-06-14 | 2018-07-20 | 腾讯科技(深圳)有限公司 | A kind of image search method and device, equipment, storage medium |
CN109271545A (en) * | 2018-08-02 | 2019-01-25 | 深圳市商汤科技有限公司 | A kind of characteristic key method and device, storage medium and computer equipment |
CN109325420A (en) * | 2018-08-27 | 2019-02-12 | 广州烽火众智数字技术有限公司 | A kind of vehicle characteristics search method and system based on big data |
CN110083729A (en) * | 2019-04-26 | 2019-08-02 | 北京金山数字娱乐科技有限公司 | A kind of method and system of picture search |
-
2019
- 2019-08-14 CN CN201910750904.9A patent/CN112395441A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0657831B1 (en) * | 1993-12-09 | 2005-05-11 | Canon Kabushiki Kaisha | Image retrieving method and apparatus |
CN1268710A (en) * | 1999-03-24 | 2000-10-04 | 富士写真胶片株式会社 | Device and method for database searching |
CN101136042A (en) * | 2006-08-29 | 2008-03-05 | 株式会社东芝 | Image-display device and an image-display system |
CN108009465A (en) * | 2016-10-31 | 2018-05-08 | 杭州海康威视数字技术股份有限公司 | A kind of face identification method and device |
CN106846317A (en) * | 2017-02-27 | 2017-06-13 | 北京连心医疗科技有限公司 | A kind of feature based extracts the method for retrieving medicine image with Similarity matching |
CN108304431A (en) * | 2017-06-14 | 2018-07-20 | 腾讯科技(深圳)有限公司 | A kind of image search method and device, equipment, storage medium |
CN109271545A (en) * | 2018-08-02 | 2019-01-25 | 深圳市商汤科技有限公司 | A kind of characteristic key method and device, storage medium and computer equipment |
CN109325420A (en) * | 2018-08-27 | 2019-02-12 | 广州烽火众智数字技术有限公司 | A kind of vehicle characteristics search method and system based on big data |
CN110083729A (en) * | 2019-04-26 | 2019-08-02 | 北京金山数字娱乐科技有限公司 | A kind of method and system of picture search |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110705245B (en) | Method and device for acquiring reference processing scheme and storage medium | |
CN104572717B (en) | Information searching method and device | |
CN106095738B (en) | Recommending form fragments | |
CN107085583B (en) | Electronic document management method and device based on content | |
EP3608798A1 (en) | Group search method based on social network, device, server and storage medium | |
CN103309869A (en) | Method and system for recommending display keyword of data object | |
US9552415B2 (en) | Category classification processing device and method | |
US20180285742A1 (en) | Learning method, learning apparatus, and storage medium | |
JP5884293B2 (en) | Similar character code group search support method, similar candidate extraction method, similar candidate extraction program, and similar candidate extraction device | |
CN110968723B (en) | Image characteristic value searching method and device and electronic equipment | |
CN111159443B (en) | Image characteristic value searching method and device and electronic equipment | |
CN112395441A (en) | Object retrieval method and device | |
CN111737608A (en) | Enterprise information retrieval result ordering method and device | |
WO2023077944A1 (en) | Method and apparatus for outputting information, device, and storage medium | |
CN111797115A (en) | Employee information searching method and device | |
US20200311125A1 (en) | Information processing apparatus and non-transitory computer readable medium storing program | |
US10394826B1 (en) | System and methods for searching query data | |
CN111752898B (en) | File processing method and device | |
CN114780589A (en) | Multi-table connection query method, device, equipment and storage medium | |
CN116414940A (en) | Standard problem determining method and device and related equipment | |
US11106737B2 (en) | Method and apparatus for providing search recommendation information | |
JPWO2012127986A1 (en) | Information search system, information search method, and information search program | |
CN116756301B (en) | User information searching method, electronic equipment and storage medium | |
CN111368055A (en) | Retrieval method and device for patent database combined enterprise information platform | |
CN110706699A (en) | Method and system for realizing interaction task by adopting voice recognition mode |
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 |