CN112668597B - Feature comparison method, device and equipment - Google Patents

Feature comparison method, device and equipment Download PDF

Info

Publication number
CN112668597B
CN112668597B CN201910980095.0A CN201910980095A CN112668597B CN 112668597 B CN112668597 B CN 112668597B CN 201910980095 A CN201910980095 A CN 201910980095A CN 112668597 B CN112668597 B CN 112668597B
Authority
CN
China
Prior art keywords
feature
model
gpu
models
library
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.)
Active
Application number
CN201910980095.0A
Other languages
Chinese (zh)
Other versions
CN112668597A (en
Inventor
罗仕胜
陈益新
李二连
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910980095.0A priority Critical patent/CN112668597B/en
Publication of CN112668597A publication Critical patent/CN112668597A/en
Application granted granted Critical
Publication of CN112668597B publication Critical patent/CN112668597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a feature comparison method, a device and equipment, wherein the method comprises the following steps: determining at least one target GPU for processing the feature to be detected from all the GPUs; the method comprises the steps of sending a feature to be detected to a target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to a CPU according to the similarity between the feature to be detected and each first feature model in the first feature library; selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from a plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of feature points of the first feature model in the first feature library is smaller than the number of feature points of the second feature model in the second feature library. According to the technical scheme, the quantity of the feature models loaded by the GPU is enlarged in a mode of loading the small feature models by the GPU, and the comparison precision is guaranteed.

Description

Feature comparison method, device and equipment
Technical Field
The application relates to the technical field of image processing, in particular to a feature comparison method, a feature comparison device and feature comparison equipment.
Background
Machine learning is a way to realize artificial intelligence, is a multi-domain interdisciplinary, and relates to multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. Machine learning is used to study how computers mimic or implement learning behavior of humans to acquire new knowledge or skills, reorganizing existing knowledge structures to continually improve their performance. Machine learning is more focused on algorithm design, enabling a computer to automatically learn rules from data and utilize the rules to predict unknown data.
In the related art of machine learning, feature comparison is widely used as an effective means in the fields of face recognition, human body recognition, vehicle recognition, and the like. The feature comparison means that the feature to be detected is compared with the feature models in the feature library, and then the feature models meeting the requirements are screened out from the feature library.
Because the number of the feature models in the feature library is very large, when the feature to be detected and the feature models in the feature library are compared one by one, the operation amount is very large, so that the operation speed of feature comparison is very slow, and therefore, how to improve the operation speed of feature comparison becomes the problem to be solved at present.
Disclosure of Invention
The application provides a feature comparison method, device and equipment, which expand the number of feature models loadable by a GPU and ensure comparison accuracy in a mode of loading small feature models by the GPU.
The application provides a feature comparison method, which is applied to a CPU, and comprises the following steps:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
the feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
The application provides a feature comparison device, the device includes: the determining module is used for determining at least one target GPU for processing the feature to be detected from all the GPUs;
The sending module is used for sending the feature to be detected to the target GPU so that the target GPU can send the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
the processing module is used for selecting a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
the number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
The application provides a feature comparison device, comprising: a CPU and a machine-readable storage medium storing machine-executable instructions executable by the CPU;
the CPU is used for executing machine executable instructions to realize the following steps:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
The feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
The application provides a feature comparison device, which is characterized by comprising a CPU and a GPU, wherein:
the CPU is used for determining at least one target GPU for processing the feature to be detected from all the GPUs; transmitting the feature to be detected to the target GPU; the GPU is used for sending the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
The CPU is further used for selecting a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
the number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
As can be seen from the above technical solutions, in the embodiments of the present application, a feature comparison process can be implemented based on a GPU and a CPU, and by loading a first feature library (including a first feature model with a smaller number of feature points) in the GPU, and loading a second feature library (including a second feature model with a larger number of feature points) in a designated storage medium, the number of feature models in the GPU can be increased. When the GPU performs feature comparison on the features to be detected, a small amount of precision loss exists due to the fact that the number of feature points of the first feature model is small. The GPU outputs a plurality of comparison results to the CPU, so that the CPU performs feature comparison on the features to be detected based on the second feature models corresponding to the plurality of comparison results, and the accurate feature comparison results are obtained because the number of feature points of the second feature models is large. Obviously, in the above manner, by loading a small model (i.e., a first feature model with a smaller number of feature points) on the GPU and loading a large model (i.e., a second feature model with a larger number of feature points) on the designated storage medium, the calculation amount of the CPU is reduced, meanwhile, the comparison precision is ensured, and the capacity and concurrency of the feature library (concurrency refers to how many features to be detected can be compared with the feature model in average per second) are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly describe the drawings that are required to be used in the embodiments of the present application or the description in the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may also be obtained according to these drawings of the embodiments of the present application for a person having ordinary skill in the art.
FIG. 1 is a flow chart of a feature alignment method in one embodiment of the present application;
FIG. 2 is a flow chart of a feature alignment method in another embodiment of the present application;
FIG. 3 is a schematic diagram of the loading of feature libraries in one embodiment of the present application;
FIG. 4 is a flow chart of a feature alignment method in another embodiment of the present application;
FIG. 5 is a block diagram of a feature alignment device in one embodiment of the present application;
fig. 6 is a block diagram of a feature alignment apparatus in one embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to any or all possible combinations including one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. Depending on the context, furthermore, the word "if" used may be interpreted as "at … …" or "at … …" or "in response to a determination".
Feature comparison is widely applied to the fields of face recognition, human body recognition, vehicle recognition and the like. The feature comparison means that the feature to be detected is compared with the feature models in the feature library, and then the feature models meeting the requirements are screened out from the feature library. Because the number of the feature models in the feature library is very large, when the feature to be detected and the feature models in the feature library are compared one by one, the operation speed is very slow, the operation amount can be very large, and how to improve the operation speed of feature comparison becomes the problem to be solved at present.
In one implementation, since the feature comparison is substantially a linear operation between the feature model in the feature library and the feature to be detected, by increasing the main frequency of the CPU (Central Processing Unit ) or using a multi-core CPU, the feature to be detected can be compared with a plurality of feature models in the feature library at the same time, thereby increasing the linear operation speed. However, both the improvement of the main frequency of the CPU and the multi-core CPU technology have reached the development bottleneck, and it has been difficult to further improve the main frequency of the CPU or to adopt a CPU with more cores.
In another implementation, feature comparison may be implemented by GPUs (Graphics Processing Unit, graphics processors), and since a large number of GPUs may be deployed, each GPU may perform feature comparison on features to be detected and multiple feature models in a feature library, thereby improving the linear operation speed. However, the storage space (such as a video memory) of the GPU is relatively small (such as 1-24 GB), so that all feature models in the feature library cannot be stored, only part of feature models in the feature library can be stored, and then the GPU cannot utilize all feature models to perform feature comparison on the features to be detected, so that an accurate feature comparison result cannot be obtained.
In view of the above problems, in the embodiment of the present application, feature comparison is implemented based on a GPU and a CPU, by loading a small model (referred to as a first feature model with a small number of feature points in the embodiment) on the GPU and loading a large model (referred to as a second feature model with a large number of feature points in the embodiment) on a designated storage medium, the calculation amount of the CPU is reduced, and at the same time, the comparison precision is ensured, and the capacity and concurrency of a feature library are improved.
The technical solutions of the embodiments of the present application are described in detail below with reference to specific embodiments.
The embodiment of the application provides a feature comparison method which can be applied to feature comparison equipment, wherein the feature comparison equipment can comprise a CPU (single-core CPU or multi-core CPU) and a plurality of GPUs. The feature comparison device may be any type of device such as a personal computer, a server, an imaging device, a storage device, a notebook computer, etc., without limitation, as long as it includes a CPU and a plurality of GPUs. Referring to fig. 1, a flow chart of the feature comparison method may include:
in step 101, the cpu determines at least one target GPU for processing the feature to be detected from all the GPUs, that is, the number of target GPUs may be one or more.
In one example, before step 101, the CPU may acquire a first feature model and a second feature model corresponding to each sample feature, where the number of feature points of the first feature model corresponding to the sample feature is smaller than the number of feature points of the second feature model corresponding to the sample feature. The model identification of the first feature model corresponding to the sample feature has a mapping relationship with the model identification of the second feature model corresponding to the sample feature.
Determining the quantity M of the GPUs which are needed to be occupied by all the first feature models according to the total quantity N of all the first feature models and a set threshold K; grouping all the GPUs, wherein the number of the GPUs in each GPU group is greater than or equal to M; and grouping all the first feature models to obtain M first feature libraries, and storing the M first feature libraries into the GPUs in each GPU group, namely, each GPU group can store the M first feature libraries, and each GPU stores one first feature library. The number of the first feature models in each first feature library is smaller than or equal to K, wherein K is the maximum value of the number of the first feature models which the GPU is allowed to store.
All second feature models are grouped into a second feature library, and the second feature library is stored to a designated storage medium (such as a memory or a high-speed storage area, etc., without limitation).
In one example, the CPU determines at least one target GPU from among all GPUs for processing the feature to be detected, which may include, but is not limited to: if the number of GPU groups is one, each GPU in the GPU groups is determined to be a target GPU. Or if the number of the GPU groups is at least two, selecting the GPU group with the lightest load from all the GPU groups according to the load condition of each GPU group, and determining all the GPUs in the GPU group with the lightest load as target GPUs. Or if the number of the GPU groups is at least two, arbitrarily selecting one GPU group from all the GPU groups, and determining all the GPUs in the selected GPU groups as target GPUs. Or if one GPU can store all the first feature models (i.e., M is 1), arbitrarily selecting one GPU from all the GPUs, and determining the selected one GPU as the target GPU.
And 102, the CPU sends the feature to be detected to the target GPU, so that the target GPU sends the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library. Wherein the model information of the first feature model may comprise a model identification of the first feature model. Alternatively, the model information of the first feature model may include a model identification of the first feature model, a similarity between the first feature model and the feature to be detected.
Specifically, if at least two target GPUs exist, the CPU sends the feature to be detected to each target GPU. Each target GPU transmits model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library, namely, the CPU can receive the model information of the plurality of first feature models transmitted by each target GPU.
Step 103, the CPU selects a plurality of second feature models from the second feature library according to the model information sent by the target GPU; and determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model. The number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
The process of the CPU selecting the plurality of second feature models from the second feature library may include, but is not limited to:
in the first mode, if the model information includes a model identifier and a mapping relationship exists between the model identifier of the first feature model and the model identifier of the second feature model corresponding to the same sample feature, the CPU selects the second feature model corresponding to the model identifier sent by the target GPU from the second feature library based on the mapping relationship between the model identifier of the first feature model and the model identifier of the second feature model.
If the model information comprises model identifications and similarities and a mapping relation exists between the model identifications of the first feature models corresponding to the same sample feature and the model identifications of the second feature models, the CPU selects a target model identification from the model identifications of the first feature models sent by the target GPU according to the similarities (namely the similarities between the first feature models and the features to be detected) of the first feature models sent by the target GPU; and selecting a second feature model corresponding to the target model identifier from the second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
In the second mode, the CPU may sort the model identifiers of the plurality of first feature models sent by the target GPU based on the similarity of the plurality of first feature models sent by the target GPU; based on the ranking result, a specified number of model identifications are selected from the model identifications of the plurality of first feature models sent by the target GPU as target model identifications. For example, when sorting in order of high-to-low similarity, a specified number of model identifications in the top order may be selected as the target model identifications. When sorting in order of low-to-high similarity, a specified number of model identifications later in the sorting may be selected as target model identifications.
Further, the manner of determining the specified number includes, but is not limited to: the specified number is determined according to the processing capability of the CPU, for example, the better the processing capability of the CPU, the larger the specified number, the worse the processing capability of the CPU, and the smaller the specified number. Or determining the designated number according to the concurrent output condition of the GPU, for example, if the GPU outputs the model information of the S first feature models to the CPU, the designated number may be equal to S.
As can be seen from the above technical solutions, in the embodiments of the present application, a feature comparison process can be implemented based on a GPU and a CPU, and by loading a first feature library (including a first feature model with a smaller number of feature points) in the GPU, and loading a second feature library (including a second feature model with a larger number of feature points) in a designated storage medium, the number of feature models in the GPU can be increased. When the GPU performs feature comparison on the features to be detected, a small amount of precision loss exists due to the fact that the number of feature points of the first feature model is small. The GPU outputs a plurality of comparison results to the CPU, so that the CPU performs feature comparison on the features to be detected based on the second feature models corresponding to the plurality of comparison results, and the accurate feature comparison results are obtained because the number of feature points of the second feature models is large. Obviously, in the above manner, by loading a small model (i.e., a first feature model with a smaller number of feature points) on the GPU and loading a large model (i.e., a second feature model with a larger number of feature points) on the designated storage medium, the calculation amount of the CPU is reduced, meanwhile, the comparison precision is ensured, and the capacity and concurrency of the feature library (concurrency refers to how many features to be detected can be compared with the feature model in average per second) are improved.
The following describes a storage procedure of the feature model in connection with a specific embodiment.
By way of example, a sample feature library may be created using conventional modeling algorithms, which may include a large number of sample features, without limitation to the creation process. For example, in the field of face recognition, a sample feature library for performing face recognition is established, the sample feature library including a large number of face recognition features. In the field of human body recognition, a sample feature library for human body recognition is established, and the sample feature library comprises a large number of human body recognition features. In the field of vehicle identification, a sample feature library for vehicle identification is established, which includes a large number of vehicle identification features. Of course, the above is merely an example of a sample feature library, and is not limited in this regard.
In this embodiment, for each sample feature (e.g., all features for identifying the same object, such as a face, a body, a vehicle, etc.) in the sample feature library, the sample feature may correspond to the first feature model and the second feature model.
For each sample feature, the number of feature points of the first feature model corresponding to the sample feature is smaller than the number of feature points of the second feature model corresponding to the sample feature, that is, the complexity of the first feature model corresponding to the sample feature is smaller than the complexity of the second feature model corresponding to the sample feature, which may refer to the number of feature points of the feature model. For example, for a certain sample feature, this sample feature may be represented by 100 feature points, or may be represented by 10 feature points, and thus a feature model based on 100 feature points is referred to as a second feature model, and a feature model based on 10 feature points is referred to as a first feature model. Obviously, since the number of the feature points of the second feature model is larger than that of the first feature model, the description of the sample features by the second feature model is more accurate.
The feature model is a string of binary data describing the target through an algorithm, and when the number of feature points is larger, the feature model is longer, namely the data size of the feature model is larger, and the storage space occupied by the feature model is larger. When the number of the feature points is smaller, the feature model is shorter, namely the data volume of the feature model is smaller, and the storage space occupied by the feature model is smaller. In summary, since the number of feature points of the second feature model is greater than the number of feature points of the first feature model, the data size of the second feature model is greater than the data size of the first feature model, and the storage space occupied by the second feature model is greater than the storage space occupied by the first feature model.
For each sample feature in the sample feature library, the first feature model and the second feature model are acquired based on the sample feature, that is, the first feature model and the second feature model are both acquired based on the sample feature, and the acquisition mode is not limited. For example, this sample feature may be represented by 100 feature points, and a feature model based on 100 feature points is referred to as a second feature model, this sample feature may be represented by 10 feature points, and a feature model based on 10 feature points is referred to as a first feature model.
Or, for each sample feature in the sample feature library, acquiring a second feature model based on the sample feature, and acquiring a first feature model based on the second feature model, namely, acquiring the second feature model based on the sample feature, wherein the first feature model is acquired based on the second feature model, and the acquisition mode is not limited. For example, this sample feature may be represented by 100 feature points, and a feature model based on 100 feature points is referred to as a second feature model. 10 feature points are selected from 100 feature points of the second feature model, the sample feature is represented by the 10 feature points, and the feature model based on the 10 feature points is called a first feature model.
Of course, the above manner is only one example of acquiring the first feature model and the second feature model, which is not limited thereto, as long as the first feature model and the second feature model corresponding to each sample feature can be acquired, and the number of feature points of the first feature model is smaller than the number of feature points of the second feature model. In practical applications, the first feature model may also be referred to as a small model and the second feature model may also be referred to as a large model.
For each sample feature in the sample feature library, the first feature model corresponding to the sample feature has a model identification, and the model identification is used for uniquely representing the first feature model, that is, the model identifications corresponding to different first feature models may be different. Furthermore, the second feature model to which the sample feature corresponds has a model identification, and the model identification is used to uniquely represent this second feature model, that is, the model identifications to which different second feature models correspond may be different.
For each sample feature, the model identification of the first feature model corresponding to the sample feature has a mapping relationship with the model identification of the second feature model corresponding to the sample feature. For example, the model identifier of the first feature model is the same as the model identifier of the second feature model, and the model identifier of the first feature model and the model identifier of the second feature model are not limited to each other, so long as the model identifier and the model identifier have a mapping relationship, and the corresponding second feature model can be known through the model identifier of the first feature model.
For example, a first feature model 1 and a second feature model 1 corresponding to the sample feature 1 are acquired, and a model identifier (e.g., A1) of the first feature model 1 has a mapping relationship with a model identifier (e.g., A1 or B1) of the second feature model 1. A first feature model 2 and a second feature model 2 corresponding to the sample feature 2 are obtained, a model identifier (such as A2) of the first feature model 2 and a model identifier (such as A2 or B2) of the second feature model 2 have a mapping relationship, and so on, and then taking ten thousand sample features as an example, ten thousand first feature models and ten thousand second feature models can be obtained, and of course, the number of sample features is far greater than ten thousand, which is not limited.
Based on the above application scenario, referring to fig. 2, a flow chart of a feature comparison method is shown.
In step 201, the cpu acquires a first feature model and a second feature model corresponding to each sample feature.
For each sample feature in the sample feature library, a first feature model and a second feature model corresponding to the sample feature can be obtained, wherein the number of feature points of the first feature model corresponding to the sample feature is smaller than that of the second feature model corresponding to the sample feature, and the model identification of the first feature model corresponding to the sample feature has a mapping relation with the model identification of the second feature model corresponding to the sample feature.
For example, assuming that 10000 sample features are included in the sample feature library, the CPU may acquire 10000 first feature models (hereinafter referred to as first feature model 1-first feature model 10000) and 10000 second feature models (hereinafter referred to as second feature model 1-second feature model 10000).
In step 202, the cpu groups all the second feature models into a second feature library, and stores the second feature library to a designated storage medium, that is, the designated storage medium stores all the second feature models.
For example, the CPU groups the second feature models 1-10000 into second feature libraries (i.e., includes a set of these second feature models), and stores the second feature libraries to a specified storage medium, such that the specified storage medium includes the second feature models 1-10000 in the second feature libraries.
Wherein the designated storage medium may include, but is not limited to: the memory and the high-speed storage area may be, for example, SSD (Solid State Drive, solid state disk), which is not limited.
In step 203, the cpu determines, according to the total number N of all the first feature models and the set threshold K, the number M of GPUs that all the first feature models need to occupy, where K is the maximum value of the number of first feature models stored by the GPU, that is, the maximum value of the number of first feature models that the GPU video memory can store.
In one possible embodiment, the CPU divides the total number N of all the first feature models by the set threshold K to round up to obtain the intermediate value. The number of GPUs M that all the first feature model needs to occupy may be greater than or equal to the intermediate value. For example, assuming that the total number N of all the first feature models is 10000 and the threshold K is 2500, dividing 10000 by 2500 is rounded up to obtain an intermediate value 4, and the number M of gpus may be 4 or other values greater than 4, such as 5, 6, etc., which is not limited.
In another possible embodiment, the CPU divides the total number N of all the first feature models by the set threshold K to round up to obtain the intermediate value. The number M of GPUs that all the first feature models need to occupy may be greater than or equal to the intermediate value, and the total number of all GPUs is an integer multiple of the number M of GPUs. For example, assuming that the total number N of all the first feature models is 10000 and the threshold K is 2500, the intermediate value 4 is obtained by dividing 10000 by 2500 and rounding up. Assuming that the total number of all GPUs is 8, the GPU number M may be 4 or 8. Assuming that the total number of all GPUs is 10, the number of GPUs M may be 5 or 10. Assuming that the total number of all GPUs is 12, the number of GPUs M may be 4, 6, or 12.
In the above embodiment, the threshold K is set to be the maximum value of the number of first feature models stored by the GPU. The set threshold K may be a threshold configured empirically, or may be determined based on the size of the first feature model and the size of the available memory space in the GPU video memory, for example, the size of the available memory space in the GPU video memory divided by the size of the first feature model may be a value obtained by taking the value upward, which is the set threshold K.
In step 204, the cpu groups all GPUs, where the number of GPUs in each GPU group is greater than or equal to M. For convenience of description, in this embodiment, the number of GPUs in each GPU group is equal to M.
For example, assuming GPU number M is 4, all GPUs include GPU1, GPU2, GPU3, GPU4, GPU5, GPU6, GPU7, and GPU8, based on which GPU1, GPU2, GPU3, and GPU4 may be grouped into GPU group 1, and GPU5, GPU6, GPU7, and GPU8 may be grouped into GPU group 2.
In step 205, the cpu groups all the first feature models to obtain M first feature libraries, and stores the M first feature libraries into GPUs in each GPU group, that is, into the GPU video memory of the GPU. That is, each GPU group may store M first feature libraries, and each GPU may store one first feature library, where the number of first feature models in each first feature library may be less than or equal to K.
Assuming that M is 4 and K is 2500, grouping the first feature models 1-10000 to obtain 4 first feature libraries, wherein the number of the first feature models in each first feature library is 2500. If the first feature library 1 comprises a first feature model 1-a first feature model 2500, the first feature library 2 comprises a first feature model 2501-a first feature model 5000, the first feature library 3 comprises a first feature model 5001-a first feature model 7500, and the first feature library 4 comprises a first feature model 7501-a first feature model 10000. To this end, 4 first feature libraries were obtained, each first feature library being a set of 2500 first feature models.
GPU group 1 includes GPU1, GPU2, GPU3, and GPU4, and therefore, first feature library 1 is stored to GPU video memory of GPU1, GPU video memory of GPU1 includes 2500 first feature models in first feature library 1, and GPU1 has access to the first feature models in first feature library 1. The first feature library 2 is stored to a GPU video memory of the GPU2, the GPU video memory of the GPU2 comprises 2500 first feature models in the first feature library 2, and the GPU2 can access the first feature models in the first feature library 2. The first feature library 3 is stored to a GPU video memory of the GPU3, the GPU video memory of the GPU3 comprises 2500 first feature models in the first feature library 3, and the GPU3 has access to the first feature models in the first feature library 3. The first feature library 4 is stored to a GPU video memory of the GPU4, the GPU video memory of the GPU4 comprises 2500 first feature models in the first feature library 4, and the GPU4 is capable of accessing the first feature models in the first feature library 4.
GPU group 2 includes GPU5, GPU6, GPU7 and GPU8, stores first feature library 1 to GPU video memory of GPU5, stores first feature library 2 to GPU video memory of GPU6, stores first feature library 3 to GPU video memory of GPU7, and stores first feature library 4 to GPU video memory of GPU 8.
Referring to fig. 3, the CPU stores the second feature library to a designated storage medium. The CPU stores the first feature library 1 into the GPU video memory of the GPU1 in the GPU group 1, loads the first feature library 2 into the GPU video memory of the GPU2 in the GPU group 1, loads the first feature library 3 into the GPU video memory of the GPU3 in the GPU group 1, and loads the first feature library 4 into the GPU video memory of the GPU4 in the GPU group 1. And the CPU loads the first feature library 1 to the GPU video memory of the GPU5 in the GPU group 2. And loading the first feature library 2 to the GPU video memory of the GPU6 in the GPU group 2. And loading the first feature library 3 to the GPU video memory of the GPU7 in the GPU group 2. And loading the first feature library 4 to the GPU video memory of the GPU8 in the GPU group 2.
The following describes a feature comparison process of a feature to be detected in connection with a specific embodiment. Referring to fig. 4, a flow chart of a feature comparison method may include:
in step 401, the cpu acquires the feature to be detected, and determines a target GPU for processing the feature to be detected from all GPUs, where the number of target GPUs may be one or more.
For example, if the number of GPU groups is multiple, the GPU group with the lightest load may be selected from all GPU groups according to the load condition of each GPU group, and all GPUs in the GPU group with the lightest load may be determined as the target GPU. For example, according to the load conditions of GPU group 1 and GPU group 2, the CPU selects the GPU group with the lightest load from GPU group 1 and GPU group 2, and determines GPU1, GPU2, GPU3 and GPU4 in GPU group 1 as the target GPU assuming that the GPU group with the lightest load is GPU group 1.
In step 402, the cpu sends the feature to be detected to the target GPU.
For example, if the comparison task of the feature to be detected has a high requirement on real-time performance, the CPU directly outputs the feature to be detected to each target GPU. If the comparison task of the features to be detected has low requirement on real-time performance, the CPU adds the comparison task of the features to be detected into the processing queue. The CPU sequentially processes the comparison tasks in the processing queue in sequence, and when the comparison tasks of the features to be detected are processed, the features to be detected are output to each target GPU. When the CPU processes the comparison tasks in the processing queue, a plurality of comparison tasks can be processed in a batch mode at a time, namely, a plurality of features to be detected are output to the target GPU at a time.
In step 403, the target GPU selects a plurality of first feature models from the first feature library according to the similarity between the feature to be detected and each first feature model in the first feature library, and sends the model information of the plurality of first feature models to the CPU. Wherein the model information of the first feature model may comprise a model identification of the first feature model. Alternatively, the model information of the first feature model may include a model identification of the first feature model, a similarity between the first feature model and the feature to be detected.
For example, after the GPU1 receives the feature to be detected, the similarity between the feature to be detected and each first feature model (e.g., the first feature model 1-the first feature model 2500) in the first feature library 1 is determined, and the determination method is not limited. And selecting S first feature models with high similarity from the first feature library according to the sequence of the similarity from high to low. The value of S may be empirically configured, and since the number of feature points of the first feature model is small, the value of S may be relatively large, instead of relatively small values such as 2 and 3, and of course, the value of S may not be too large in order to avoid consuming a large amount of resources of the CPU. For example, S may be 100, and S first feature models with high similarity may be the first feature model 1-the first feature model 100.
GPU1 may then send model information (e.g., model identification, or model identification and similarity) for the S first feature models to the CPU. For example, the model information of the first feature model 1 (such as the model identification of the first feature model 1, or the model identification of the first feature model 1 and the similarity of the first feature model 1 to the feature to be detected), the model information of the first feature model 2, and so on.
After the GPU2 receives the feature to be detected, the processing mode refers to the GPU1, and the model information of the S first feature models, that is, the model information of the S first feature models in the first feature library 2, may also be sent to the CPU. Similarly, the GPU3 may also send the model information of the S first feature models, i.e. the model information of the S first feature models in the first feature library 3, to the CPU. The GPU4 may also send model information of S first feature models, i.e. model information of S first feature models in the first feature library 4, to the CPU.
In step 404, the cpu selects a plurality of second feature models from the second feature library according to the model information sent by the target GPUs (i.e., the model information of the first feature models sent by the plurality of target GPUs respectively).
The model information of the first feature model includes a model identification of the first feature model. The CPU selects a second feature model corresponding to the model identification sent by the target GPU from the second feature library based on the mapping relation between the model identification of the first feature model and the model identification of the second feature model.
For example, the GPU1 sends the model identifier of the first feature model 1-the first feature model 100 to the CPU, the CPU selects the second feature model 1 corresponding to the model identifier of the first feature model 1 from the second feature library, selects the second feature model 2 corresponding to the model identifier of the first feature model 2 from the second feature library, and so on, and finally selects the second feature model 1-the second feature model 100 from the second feature library.
GPU2 sends model identifications of first feature model 2501-first feature model 2600 to the CPU, which selects the second feature model corresponding to these model identifications from the second feature library, i.e., selects second feature model 2501-second feature model 2600 from the second feature library. The GPU3 sends the model identification of the first feature model 5001-the first feature model 5100 to the CPU, and the CPU selects the second feature model 5001-the second feature model 5100 from the second feature library. GPU3 sends the model identification of first feature model 7501-first feature model 7600 to CPU, and CPU selects second feature model 7501-second feature model 7600 from the second feature library.
So far, the CPU selects 400 second feature models from the second feature library, and carries out subsequent processing based on the 400 second feature models.
The second mode, the model information of the first feature model includes the model identification of the first feature model, and the similarity between the first feature model and the feature to be detected. And the CPU selects a target model identifier from the model identifiers of the plurality of first feature models sent by the target GPU according to the similarity of the plurality of first feature models sent by the target GPU. And selecting a second feature model corresponding to the target model identifier from the second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
For example, for a process of selecting a target model identification from model identifications of a plurality of first feature models, the model identifications of the plurality of first feature models sent by the target GPU are ordered based on a similarity of the plurality of first feature models sent by the target GPU; based on the ranking result, a specified number of model identifications are selected from the model identifications of the plurality of first feature models sent by the target GPU as target model identifications.
For example, the model identifiers of the plurality of first feature models sent by the target GPU may be ranked in order of high-to-low similarity, and a designated number of model identifiers with a top ranking may be selected as the target model identifiers. Wherein the determining manner of the specified number includes but is not limited to: the specified number is determined according to the processing capability of the CPU, for example, the better the processing capability of the CPU, the larger the specified number, the worse the processing capability of the CPU, and the smaller the specified number. Or determining the designated number according to the concurrent output condition of the GPU, for example, if the GPU outputs the model information of the S first feature models to the CPU, the designated number may be equal to S.
For example, the GPU1 outputs model identifiers of S first feature models and similarity between the S first feature models and the feature to be detected to the CPU; the GPU2 outputs model identifications of the S first feature models and similarity between the S first feature models and the features to be detected to the CPU; the GPU3 outputs model identifications of the S first feature models and similarity between the S first feature models and the features to be detected to the CPU; the GPU4 outputs model identifications of the S first feature models and similarity between the S first feature models and the features to be detected to the CPU.
Based on the similarity corresponding to the model identifications of the 4S first feature models, the CPU may rank the model identifications of the 4S first feature models in order of the similarity from high to low, and select, from the model identifications of the 4S first feature models, a specified number of model identifications ranked first as the target model identifications, where the specified number may be S, i.e., select, from the 4S model identifications, S model identifications ranked first as the target model identifications. Of course, the above manner is merely an example, and is not limited thereto.
Assuming that the target model identifier is a model identifier of the first feature model 1-the first feature model 100, the CPU selects a second feature model 1 corresponding to the model identifier of the first feature model 1 from the second feature library, selects a second feature model 2 corresponding to the model identifier of the first feature model 2 from the second feature library, and so on, and finally selects the second feature model 1-the second feature model 100 from the second feature library. So far, 100 second feature models are selected from the second feature library, and subsequent processing is carried out based on the 100 second feature models.
In summary, based on the first mode or the second mode, the CPU may select a plurality of second feature models from the second feature library, and the number of the selected second feature models is far smaller than the total number of the second feature models. For example, 100 second feature models are selected from the second feature library, and the total number of the second feature models is 10000.
Step 405, based on a plurality of second feature models selected from the second feature library, the CPU determines at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model, where the target feature model is the final feature comparison result.
For example, the CPU determines the similarity between the feature to be detected and each of the selected second feature models (e.g., 100 second feature models), and the determination is not limited. And sequencing each second feature model according to the sequence from high similarity to low similarity, and selecting T second feature models with top sequences, namely T second feature models with high similarity, wherein the T second feature models are target feature models.
The value of T may be configured empirically, which means that T feature comparison results are output finally, for example, T may be 1, 2, 3, etc., which is not limited. If T is 3, the CPU selects 3 second feature models which are ranked ahead, namely the feature comparison result is the model identification of the 3 second feature models which are ranked ahead.
In the above embodiment, the CPU selects the T second feature models with the front order from the plurality of second feature models (for example, 100 second feature models), instead of selecting the T second feature models with the front order from all the second feature models (for example, 10000 second feature models) of the second feature library, because the number of the 100 second feature models is far smaller than the total number of the second feature models, the above method loads the small model with the small number of feature points on the GPU and loads the large model with the large number of feature points on the designated storage medium, while reducing the calculation amount of the CPU, ensuring the comparison accuracy, and improving the capacity and concurrency of the feature library (concurrency refers to how many features to be detected can be compared with the feature models on average per second).
Based on the application concept same as the above method, in an embodiment of the present application, a feature comparison device is further provided, as shown in fig. 5, which is a structural diagram of the feature comparison device, where the device includes: a determining module 51, configured to determine at least one target GPU for processing the feature to be detected from all GPUs;
the sending module 52 is configured to send the feature to be detected to the target GPU, so that the target GPU sends model information of a plurality of first feature models in the first feature library to the CPU according to a similarity between the feature to be detected and each first feature model in the first feature library;
The processing module 53 is configured to select a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
the number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
In one example, the processing module 53 is specifically configured to, according to the model information sent by the target GPU, select a plurality of second feature models from the second feature library:
if the model information comprises model identifications and a mapping relation exists between the model identifications of the first feature model and the model identifications of the second feature model corresponding to the same sample feature, selecting a second feature model corresponding to the model identifications sent by the target GPU from a second feature library based on the mapping relation between the model identifications of the first feature model and the model identifications of the second feature model; or if the model information comprises model identifications and similarities and a mapping relation exists between the model identifications of the first feature models and the model identifications of the second feature models corresponding to the same sample feature, selecting a target model identification from the model identifications of the first feature models sent by the target GPU according to the similarities of the first feature models sent by the target GPU; and selecting a second feature model corresponding to the target model identifier from a second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
In one example, the processing module 53 is specifically configured to, when selecting the target model identifier from the model identifiers of the plurality of first feature models sent by the target GPU according to the similarities of the plurality of first feature models sent by the target GPU: sorting model identifications of the plurality of first feature models sent by the target GPU based on the similarity of the plurality of first feature models sent by the target GPU; and selecting a specified number of model identifications from the model identifications of the first feature models sent by the target GPU as target model identifications based on the sequencing result.
The determining module 51 is further configured to obtain a first feature model and a second feature model corresponding to each sample feature; determining the quantity M of the GPUs which are needed to be occupied by all the first feature models according to the total quantity N of all the first feature models and a set threshold K; grouping all the GPUs, wherein the number of the GPUs in each GPU group is greater than or equal to M; grouping all the first feature models to obtain M first feature libraries, storing the M first feature libraries into the GPUs in each GPU group, wherein each GPU stores one first feature library, the number of the first feature models in each first feature library is smaller than or equal to K, and K is the maximum value of the number of the first feature models stored by the GPU; all second feature models are grouped into a second feature library, and the second feature library is stored to a designated storage medium.
The determining module 51 is specifically configured to, when determining at least one target GPU for processing the feature to be detected from all GPUs: selecting the GPU group with the lightest load from all the GPU groups according to the load condition of each GPU group; and determining all the GPUs in the GPU group with the lightest load as the target GPU.
Based on the same application concept as the above method, a feature comparison device is further provided in the embodiments of the present application, and from a hardware aspect, a schematic diagram of a hardware architecture of the feature comparison device may be shown in fig. 6. The feature comparison device may include: a CPU61, a machine-readable storage medium 62 and a GPU, the machine-readable storage medium 62 storing machine-executable instructions executable by the CPU 61; the CPU61 is configured to execute machine executable instructions to implement the methods disclosed in the above examples of the present application. For example, the CPU61 is configured to execute machine executable instructions to implement the steps of:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
the feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
Selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
Based on the same application concept as the above method, the embodiment of the present application further provides a machine-readable storage medium, where the machine-readable storage medium stores a number of computer instructions, where the computer instructions can implement the method disclosed in the above example of the present application when executed by a processor.
For example, the computer instructions, when executed by a processor, can implement the steps of:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
the feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
Selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
By way of example, the machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, and the like. For example, a machine-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
Based on the same application concept as the above method, a feature comparison device is also provided in the embodiments of the present application, where the feature comparison device may include, but is not limited to, a CPU and a GPU, and the feature comparison device includes:
The CPU is used for determining at least one target GPU for processing the feature to be detected from all the GPUs; transmitting the feature to be detected to the target GPU;
the GPU is used for sending the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
the CPU is further used for selecting a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
the number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Moreover, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A feature comparison method, applied to a CPU, the method comprising:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
the feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
2. The method of claim 1, wherein before determining at least one target GPU from among all GPUs for processing the feature to be detected, the method further comprises:
acquiring a first characteristic model and a second characteristic model corresponding to each sample characteristic;
Determining the quantity M of the GPUs which are needed to be occupied by all the first feature models according to the total quantity N of all the first feature models and a set threshold K; grouping all the GPUs, wherein the number of the GPUs in each GPU group is greater than or equal to M; grouping all the first feature models to obtain M first feature libraries, storing the M first feature libraries into the GPUs in each GPU group, wherein each GPU stores one first feature library, the number of the first feature models in each first feature library is smaller than or equal to K, and K is the maximum value of the number of the first feature models stored by the GPU;
all second feature models are grouped into a second feature library, and the second feature library is stored to a designated storage medium.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the determining at least one target GPU for processing the feature to be detected from all GPUs comprises:
selecting the GPU group with the lightest load from all the GPU groups according to the load condition of each GPU group;
and determining all the GPUs in the GPU group with the lightest load as the target GPU.
4. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the model information comprises model identifications, a mapping relation exists between the model identifications of the first feature models and the model identifications of the second feature models corresponding to the same sample feature, and a plurality of second feature models are selected from a second feature library according to the model information sent by the target GPU, and the method comprises the following steps:
And selecting a second feature model corresponding to the model identifier sent by the target GPU from the second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
5. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the model information comprises model identification and similarity, a mapping relation exists between the model identification of a first feature model and the model identification of a second feature model corresponding to the same sample feature, and a plurality of second feature models are selected from a second feature library according to the model information sent by the target GPU, and the method comprises the following steps:
selecting a target model identifier from the model identifiers of the plurality of first feature models sent by the target GPU according to the similarity of the plurality of first feature models sent by the target GPU;
and selecting a second feature model corresponding to the target model identifier from a second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
6. The method of claim 5, wherein the step of determining the position of the probe is performed,
the selecting, according to the similarity of the plurality of first feature models sent by the target GPU, a target model identifier from model identifiers of the plurality of first feature models sent by the target GPU includes:
Sorting model identifications of the plurality of first feature models sent by the target GPU based on the similarity of the plurality of first feature models sent by the target GPU;
and selecting a specified number of model identifications from the model identifications of the first feature models sent by the target GPU as target model identifications based on the sequencing result.
7. A feature alignment apparatus, the apparatus comprising:
the determining module is used for determining at least one target GPU for processing the feature to be detected from all the GPUs;
the sending module is used for sending the feature to be detected to the target GPU so that the target GPU can send the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
the processing module is used for selecting a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
The number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
8. The apparatus according to claim 7, wherein the processing module is specifically configured to, when selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU:
if the model information comprises model identifications and a mapping relation exists between the model identifications of the first feature model and the model identifications of the second feature model corresponding to the same sample feature, selecting a second feature model corresponding to the model identifications sent by the target GPU from a second feature library based on the mapping relation between the model identifications of the first feature model and the model identifications of the second feature model; or alternatively, the process may be performed,
if the model information comprises model identifications and similarities and a mapping relation exists between the model identifications of the first feature models and the model identifications of the second feature models corresponding to the same sample feature, selecting a target model identification from the model identifications of the first feature models sent by the target GPU according to the similarities of the first feature models sent by the target GPU; and selecting a second feature model corresponding to the target model identifier from a second feature library based on the mapping relation between the model identifier of the first feature model and the model identifier of the second feature model.
9. A feature alignment apparatus, comprising: a CPU and a machine-readable storage medium storing machine-executable instructions executable by the CPU;
the CPU is used for executing machine executable instructions to realize the following steps:
determining at least one target GPU for processing the feature to be detected from all the GPUs;
the feature to be detected is sent to the target GPU, so that the target GPU sends model information of a plurality of first feature models in a first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
selecting a plurality of second feature models from the second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model; the number of the characteristic points of the first characteristic model in the first characteristic library is smaller than that of the characteristic points of the second characteristic model in the second characteristic library.
10. The characteristic comparison device is characterized by comprising a CPU and a GPU, wherein:
The CPU is used for determining at least one target GPU for processing the feature to be detected from all the GPUs; transmitting the feature to be detected to the target GPU;
the GPU is used for sending the model information of a plurality of first feature models in the first feature library to the CPU according to the similarity between the feature to be detected and each first feature model in the first feature library;
the CPU is further used for selecting a plurality of second feature models from a second feature library according to the model information sent by the target GPU; determining at least one target feature model from the plurality of second feature models according to the similarity between the feature to be detected and each selected second feature model;
the number of the feature points of the first feature model in the first feature library is smaller than that of the feature points of the second feature model in the second feature library.
CN201910980095.0A 2019-10-15 2019-10-15 Feature comparison method, device and equipment Active CN112668597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910980095.0A CN112668597B (en) 2019-10-15 2019-10-15 Feature comparison method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910980095.0A CN112668597B (en) 2019-10-15 2019-10-15 Feature comparison method, device and equipment

Publications (2)

Publication Number Publication Date
CN112668597A CN112668597A (en) 2021-04-16
CN112668597B true CN112668597B (en) 2023-07-28

Family

ID=75400341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910980095.0A Active CN112668597B (en) 2019-10-15 2019-10-15 Feature comparison method, device and equipment

Country Status (1)

Country Link
CN (1) CN112668597B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033927A (en) * 2010-12-15 2011-04-27 哈尔滨工业大学 Rapid audio searching method based on GPU (Graphic Processing Unit)
CN107341507A (en) * 2017-06-20 2017-11-10 华中科技大学 A kind of rapid image SIFT feature matching process based on GPU with cascade Hash
CN108564084A (en) * 2018-05-08 2018-09-21 北京市商汤科技开发有限公司 character detecting method, device, terminal and storage medium
CN109492604A (en) * 2018-11-23 2019-03-19 北京嘉华科盈信息系统有限公司 Faceform's characteristic statistics analysis system
CN109614510A (en) * 2018-11-23 2019-04-12 腾讯科技(深圳)有限公司 A kind of image search method, device, graphics processor and storage medium
CN109657083A (en) * 2018-12-27 2019-04-19 广州华迅网络科技有限公司 The method for building up and device in textile picture feature library
CN109902547A (en) * 2018-05-29 2019-06-18 华为技术有限公司 Action identification method and device
CN109947811A (en) * 2017-11-29 2019-06-28 北京京东金融科技控股有限公司 Generic features library generating method and device, storage medium, electronic equipment
CN110084268A (en) * 2019-03-18 2019-08-02 浙江大华技术股份有限公司 Image comparison method, face identification method and device, computer storage medium
CN110110113A (en) * 2019-05-20 2019-08-09 重庆紫光华山智安科技有限公司 Image search method, system and electronic device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7567252B2 (en) * 2003-12-09 2009-07-28 Microsoft Corporation Optimizing performance of a graphics processing unit for efficient execution of general matrix operations
US9129163B2 (en) * 2009-06-24 2015-09-08 Here Global B.V. Detecting common geographic features in images based on invariant components
US9332028B2 (en) * 2013-01-25 2016-05-03 REMTCS Inc. System, method, and apparatus for providing network security
US20140218377A1 (en) * 2013-02-04 2014-08-07 Hon Hai Precision Industry Co., Ltd. Graphics processing unit expansion card and method for expanding and registering graphics processing units
US10298606B2 (en) * 2017-01-06 2019-05-21 Juniper Networks, Inc Apparatus, system, and method for accelerating security inspections using inline pattern matching
CN107516090B (en) * 2017-09-11 2021-09-17 北京百度网讯科技有限公司 Integrated face recognition method and system
US11644834B2 (en) * 2017-11-10 2023-05-09 Nvidia Corporation Systems and methods for safe and reliable autonomous vehicles

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033927A (en) * 2010-12-15 2011-04-27 哈尔滨工业大学 Rapid audio searching method based on GPU (Graphic Processing Unit)
CN107341507A (en) * 2017-06-20 2017-11-10 华中科技大学 A kind of rapid image SIFT feature matching process based on GPU with cascade Hash
CN109947811A (en) * 2017-11-29 2019-06-28 北京京东金融科技控股有限公司 Generic features library generating method and device, storage medium, electronic equipment
CN108564084A (en) * 2018-05-08 2018-09-21 北京市商汤科技开发有限公司 character detecting method, device, terminal and storage medium
CN109902547A (en) * 2018-05-29 2019-06-18 华为技术有限公司 Action identification method and device
CN109492604A (en) * 2018-11-23 2019-03-19 北京嘉华科盈信息系统有限公司 Faceform's characteristic statistics analysis system
CN109614510A (en) * 2018-11-23 2019-04-12 腾讯科技(深圳)有限公司 A kind of image search method, device, graphics processor and storage medium
CN109657083A (en) * 2018-12-27 2019-04-19 广州华迅网络科技有限公司 The method for building up and device in textile picture feature library
CN110084268A (en) * 2019-03-18 2019-08-02 浙江大华技术股份有限公司 Image comparison method, face identification method and device, computer storage medium
CN110110113A (en) * 2019-05-20 2019-08-09 重庆紫光华山智安科技有限公司 Image search method, system and electronic device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A framework for accelerating local feature extraction with OpenCL on multi-core CPUs and co-processors;Konrad Moren等;《Journal of Real-Time Image Processing》;901–918 *
基于GPU的SIFT特征点快速匹配;柯涛等;《测绘与空间地理信息》;14-16页 *
基于移动平台的人脸检测与人脸识别算法研究;李建超等;《中国优秀硕士学位论文电子期刊》;51-60页 *

Also Published As

Publication number Publication date
CN112668597A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US10909455B2 (en) Information processing apparatus using multi-layer neural network and method therefor
US10558914B2 (en) Real-time resource usage reduction in artificial neural networks
CN107957989B (en) Cluster-based word vector processing method, device and equipment
CN110462646A (en) Information processing equipment, information processing method and computer readable storage medium
TW201439966A (en) Performing object detection operations via a graphics processing unit
CN107341507B (en) GPU and cascade hash based rapid image SIFT feature matching method
Lawrence et al. Comparing TensorFlow deep learning performance using CPUs, GPUs, local PCs and cloud
CN112070219A (en) Element for in-memory computation
Masek et al. Multi-GPU implementation of k-nearest neighbor algorithm
US20230051237A1 (en) Determining material properties based on machine learning models
CN113407343A (en) Service processing method, device and equipment based on resource allocation
US20210304010A1 (en) Neural network training under memory restraint
CN112668597B (en) Feature comparison method, device and equipment
CN112906728B (en) Feature comparison method, device and equipment
CN111898747B (en) Feature comparison method and electronic equipment
CN108334935B (en) Deep learning neural network method and device for simplifying input and robot system
CN108364067B (en) Deep learning method based on data segmentation and robot system
CN108460453B (en) Data processing method, device and system for CTC training
CN115237097A (en) Automatic driving simulation test method, device, computer equipment and storage medium
US20220343146A1 (en) Method and system for temporal graph neural network acceleration
Masek et al. Multi–gpu implementation of machine learning algorithm using cuda and opencl
CN110188798B (en) Object classification method and model training method and device
CN111340237B (en) Data processing and model running method, device and computer equipment
CN109213590B (en) Method and apparatus for scheduling processors
CN115774800A (en) Time-varying graph processing method based on NUMA (non uniform memory access) architecture, electronic device and 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
GR01 Patent grant
GR01 Patent grant