Target detection method and device, equipment, medium and product
By using pre-trained edge detection model to perform interpolation and intersection operations of multi-scale edge probability maps, the problem of low accuracy of existing object detection methods is solved, and higher edge detection and object detection accuracy is achieved.
Patent Information
- Application Number
- CN202411639953.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-11
AI Technical Summary
The existing machine learning-based object detection methods have low accuracy and are difficult to accurately identify target objects in monitoring images.
The pre-trained edge detection model is adopted to determine the edge probability maps of multiple different scales through the decoding unit, and the edge probability map is updated through interpolation and intersection operations, gradually improving the accuracy of edge detection.
The accuracy of edge detection results is improved, thereby improving the accuracy of object detection results determined based on edge detection results.
Smart Images

Figure CN119600534A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a target detection method, device, equipment medium and product. Background Art
[0002] As the manufacturing technology of surveillance equipment matures, public security cameras of all sizes have sprung up like mushrooms after a rain. At the same time, the number of surveillance videos has increased exponentially, so there is an urgent need to use scientific and technological means to process surveillance images and obtain more reliable recognition results. With the development of computer vision technology, people apply machine learning to image target recognition. However, existing target recognition methods based on machine learning generally have the problem of low accuracy. Summary of the invention
[0003] The present invention provides a target detection method, device, equipment, medium and product to solve the problem of low accuracy in existing target detection methods.
[0004] According to one aspect of the present invention, there is provided a target detection method, comprising:
[0005] Get the image to be processed;
[0006] The image to be processed is input into a pre-trained edge detection model to obtain an edge detection result; wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and along the scale increasing direction, for each non-minimum scale edge probability map, the latest edge probability map of the previous scale corresponding to the current edge probability map is interpolated to the same scale as the current edge probability map to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result;
[0007] In the case where it is detected that the edge detection result includes a target object, a first target detection result is output.
[0008] According to another aspect of the present invention, there is provided a target detection device, comprising:
[0009] An image acquisition module, used for acquiring an image to be processed;
[0010] A detection module, used for inputting the image to be processed into a pre-trained edge detection model to obtain an edge detection result; wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and interpolates the latest edge probability map of the previous scale corresponding to the current edge probability map to the same scale as the current edge probability map along the scale increasing direction, for each edge probability map of non-minimum scale, to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result;
[0011] The detection result module is used to output a first target detection result when the edge detection result includes the target object.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the target detection method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the target detection method described in any embodiment of the present invention when executed.
[0017] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program, the computer program implementing the target detection method according to any embodiment when executed by a processor
[0018] The technical solution of the embodiment of the present invention, the technical solution provided by the embodiment of the present invention, since the pre-trained edge detection model updates the edge probability map of the latter scale by the intersection between the interpolation result of the latest edge probability map at one scale and the edge probability map of the latter scale, the edge probability map of each non-minimum scale is gradually updated until the updated edge probability map of the maximum scale is obtained, and the edge probability map of the maximum scale is used as the target edge probability map; since the interpolation result of the edge probability map of the smaller scale includes the edges in the edge probability map of the larger scale, and the edge probability map of the smaller scale has a higher spatial resolution due to the network characteristics, the intersection of the interpolation result of the edge probability map of the smaller scale and the edge probability map of the larger scale can restore the spatial resolution of the edge probability map of the larger scale without damaging the edges of the large-scale edge probability map, and the spatial distribution of the noise has a certain randomness, so in the process of determining the intersection, the noise can be effectively suppressed to obtain an edge detection result with higher accuracy; and after the accuracy of the edge detection result is improved, the first target detection result determined based on the edge detection result also has higher accuracy.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flow chart of a target detection method provided according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a method for determining an intersection provided according to an embodiment of the present invention;
[0023] Figure 3 is another flow chart of a target detection method provided according to an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of the structure of a target detection device provided according to an embodiment of the present invention;
[0025] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the target detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0029] Figure 1 This is a flow chart of a target detection method provided by an embodiment of the present invention. This embodiment can be applied to the case where contour information included in an image to be processed is accurately determined based on a pre-trained edge detection model. The method can be executed by a target detection device, which can be implemented in the form of hardware and / or software. The target detection device can be configured in a processor of an electronic device. Figure 1 As shown, the method includes:
[0030] S110: Obtain an image to be processed.
[0031] The image to be processed is an image frame of a video image, such as an image frame of a surveillance video image.
[0032] The image to be processed in this embodiment may be a black-and-white image or a color image.
[0033] S120. Input the image to be processed into a pre-trained edge detection model to obtain an edge detection result, wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and interpolates the latest edge probability map of the previous scale corresponding to the current edge probability map to the same scale as the current edge probability map along the scale increasing direction, for each non-minimum scale edge probability map, to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result.
[0034] The edge detection model may be a machine learning model. It includes an encoder and a decoder. The decoder includes at least three upsampling layers, each of which is configured to output an edge probability map of a corresponding scale. It is understandable that the first upsampling layer of the decoder is connected to the last downsampling layer of the encoder, so the size of the edge probability map output by it is the smallest. The size of the edge probability map output by the second upsampling layer connected to the first upsampling layer is larger than the size of the edge probability map output by the first upsampling layer, and smaller than the size of the edge probability map output by the third upsampling layer.
[0035] Therefore, the pre-trained edge detection model is used to determine, for each non-first upsampling layer, the previous sampling layer corresponding to the current upsampling layer, interpolate the latest edge probability map corresponding to the previous upsampling layer to the same scale as the edge probability map output by the current upsampling layer, and obtain the target edge probability map corresponding to the previous upsampling layer; use the intersection of the target edge probability map corresponding to the previous upsampling layer and the edge probability map corresponding to the current upsampling layer as the updated edge probability map corresponding to the current upsampling layer; when the current upsampling layer is the last upsampling layer, use the updated edge probability map corresponding to the current upsampling layer as the edge detection result.
[0036] Specifically, Figure 2As shown, the encoding module of the pre-trained edge detection model outputs four edge probability maps of given scales, namely, a first edge probability map, a second edge probability map, a third edge probability map and a fourth edge probability map, and the scales of the first edge probability map, the second edge probability map, the third edge probability map and the fourth edge probability map are the first scale, the second scale, the third scale and the fourth scale respectively; the first edge probability map is interpolated to the second scale to obtain a first target edge probability map; the product of the first target edge probability map and the second edge probability map is taken as the intersection of the two, and the intersection is taken as the updated second edge probability map; the updated second edge probability map is interpolated to the third scale to obtain a second target edge probability map, the product of the second target edge probability map and the third edge probability map is taken as the intersection of the two, and the intersection is taken as the updated third edge probability map; the updated third edge probability map is interpolated to the fourth scale to obtain a third target edge probability map; the product of the third target edge probability map and the fourth edge probability map is taken as the intersection of the two, and the intersection is taken as the edge detection result.
[0037] It should be noted that, in this embodiment, each upsampling layer may be connected only to the previous upsampling layer, or may be connected to other upsampling layers and / or a set downsampling layer while being connected to the previous upsampling layer.
[0038] This embodiment trains the edge detection model based on the training samples in the training set until the optimization of the model parameters is completed to obtain a pre-trained edge detection model. The training samples include monitoring image frames and label content, wherein the label content is the edge detection result of the monitoring image frame determined based on the setting method. The setting method is an existing edge detection method with high accuracy.
[0039] S130. When the edge detection result includes the target object, output a first target detection result.
[0040] If the edge detection result includes the target object, a first target detection result is output; if the edge detection result does not include the target object, a second target detection result is output. The first target detection result is prompt information for indicating that the target matching is successful. The second target detection result is prompt information for indicating that the target matching fails.
[0041] In one embodiment, the first target detection result includes the edge detection result, at least one of the images to be processed, the target object, and prompt information for indicating successful matching. Exemplarily, the first target detection result includes the edge detection result and prompt information indicating that the person in the edge detection result successfully matches the target object.
[0042] After the edge detection result is determined, the edge detection result is subjected to image post-processing to update the edge detection result; the image post-processing includes gamma transformation. The accuracy of the final edge detection result is improved by image post-processing, thereby improving the accuracy of the target object recognition result in the edge detection result.
[0043] The technical solution provided by the embodiment of the present invention is that the pre-trained edge detection model gradually updates the edge probability maps of non-minimum scales by the intersection between the interpolation result of the latest edge probability map at one scale and the edge probability map of the next scale, until the updated edge probability map of the maximum scale is obtained, and the edge probability map of the maximum scale is used as the target edge probability map; since the interpolation result of the edge probability map of the smaller scale includes the edges in the edge probability map of the larger scale, and the edge probability map of the smaller scale has a higher spatial resolution due to the network characteristics, the intersection of the interpolation result of the edge probability map of the smaller scale and the edge probability map of the larger scale can restore the spatial resolution of the edge probability map of the larger scale without damaging the edges of the edge probability map of the larger scale, and the spatial distribution of the noise has a certain randomness, so in the process of determining the intersection, the noise can be effectively suppressed to obtain an edge detection result with higher accuracy; and after the accuracy of the edge detection result is improved, the first target detection result determined based on the edge detection result also has higher accuracy.
[0044] Figure 3 This is another flow chart of the target detection method provided by an embodiment of the present invention. This embodiment is used to refine the step of determining whether the edge detection result in the above embodiment includes the target object. Figure 3 As shown, the method includes:
[0045] S210: Obtain an image to be processed.
[0046] S220. Input the image to be processed into a pre-trained edge detection model to obtain an edge detection result, wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and interpolates the latest edge probability map of the previous scale corresponding to the current edge probability map to the same scale as the current edge probability map along the scale increasing direction, for each non-minimum scale edge probability map, to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result.
[0047] S2301: Determine the matching degree between the edge detection result and the target object.
[0048] The edge detection result includes the contour information of each object or person in the image to be detected.
[0049] The target object can be a physical image, or a contour of a target object or an object. In one embodiment, the target object is a facial contour or a body contour of a target person.
[0050] The matching degree between the edge detection result and the target object can be determined by using the existing technology, and this embodiment will not be described in detail. It can be understood that the higher the matching degree, the higher the similarity between the contour in the edge detection result and the target object.
[0051] S2302: When the matching degree is greater than a set threshold, output a first target detection result corresponding to the target object.
[0052] In one embodiment, there is only one target object, and the matching degree between the edge detection result and the target object is determined; when the matching degree is greater than a set threshold, the first target detection result corresponding to the target object is output; when the matching degree is less than or equal to the set threshold, the second target detection result corresponding to the target object is output.
[0053] In one embodiment, there are multiple target objects, and the matching degree between the edge detection result and at least two pre-stored target objects is determined; if the matching degree between the edge detection result and any one of the at least two target objects is greater than a set matching threshold, the edge detection result, at least one of the images to be processed, and the successfully matched target object and prompt information indicating a successful match are output; if the matching degree between the edge detection result and each of the at least two target objects is less than or equal to the set matching threshold, a second target detection result indicating a failed match is output.
[0054] Exemplarily, there are three target objects, namely the first target object, the second target object and the third target object. If the matching degree of the edge detection result with the first target object is less than the set threshold, the matching degree with the second target object is greater than the set threshold, and the matching degree with the third target object is greater than the set threshold, then the edge detection result, the third target object and a prompt message indicating successful matching are output. This makes it easier for users to visually judge whether the edge detection result is highly consistent with the third target object, thereby improving the convenience of manual review.
[0055] In one embodiment, after the first target detection result is determined, the first target detection result is displayed in a visual interface; or the first target detection result is pushed to a set device or a set email address to facilitate timely implementation of emergency response measures.
[0056] The technical solution provided by the embodiment of the present invention reflects the similarity between the edge detection result and the target object through the matching degree. When the matching degree between the two is greater than a set threshold, it is determined that the edge detection result includes the target object, and the first target detection result corresponding to the target object is output, thereby achieving the technical effect of quickly and automatically determining whether the edge detection result includes the target object.
[0057] Figure 4 Schematic diagram of the structure of the target detection device provided by the embodiment of the present invention. Figure 4 As shown, the device comprises:
[0058] An acquisition module 310 is used to acquire an image to be processed;
[0059] The detection module 320 is used to input the image to be processed into a pre-trained edge detection model to obtain an edge detection result; wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and interpolates the latest edge probability map of the previous scale corresponding to the current edge probability map to the same scale as the current edge probability map along the scale increasing direction for each edge probability map of non-minimum scale, to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result;
[0060] The detection result module 330 is configured to output a first target detection result when it is detected that the edge detection result includes a target object.
[0061] In one embodiment, the detection result module 330 includes:
[0062] A matching unit, used to determine the matching degree between the edge detection result and the target object;
[0063] The result unit is used to output a first target detection result corresponding to the target object when the matching degree is greater than a set threshold.
[0064] In one embodiment, the target object includes a body contour and / or a facial contour of the target object.
[0065] In one embodiment, the matching unit is used to:
[0066] Determining a degree of match between the edge detection result and at least two pre-stored target objects;
[0067] The results unit is used to:
[0068] If the matching degree between the edge detection result and any one of the at least two target objects is greater than a set matching threshold, the image to be processed, the successfully matched target object and prompt information indicating successful matching are output.
[0069] In one embodiment, the result unit is further configured to:
[0070] If the matching degree between the edge detection result and each of the at least two target objects is less than or equal to a set matching threshold, a prompt message indicating that the matching fails is output.
[0071] In one embodiment, the pre-trained edge detection model is used to:
[0072] Taking the edge probability map output by the first upsampling layer as the target edge probability map, interpolating the target edge probability map to update the target edge probability map, taking the intersection of the updated target edge probability map and the edge probability map output by the next upsampling layer as the updated edge probability map output by the next upsampling layer, and the scale of the updated target edge probability map is the same as the scale of the edge probability map output by the next upsampling layer;
[0073] The updated edge probability map output by the subsequent upsampling layer is used as the target edge probability map, and the step of interpolating the target edge probability map to update the target edge probability map is returned until the subsequent upsampling layer is the last upsampling layer, and the latest updated edge probability map is used as the edge detection result.
[0074] The technical solution provided by the embodiment of the present invention is that the pre-trained edge detection model gradually updates the edge probability maps of non-minimum scales by the intersection between the interpolation result of the latest edge probability map at one scale and the edge probability map of the next scale, until the updated edge probability map of the maximum scale is obtained, and the edge probability map of the maximum scale is used as the target edge probability map; since the interpolation result of the edge probability map of the smaller scale includes the edges in the edge probability map of the larger scale, and the edge probability map of the smaller scale has a higher spatial resolution due to the network characteristics, the intersection of the interpolation result of the edge probability map of the smaller scale and the edge probability map of the larger scale can restore the spatial resolution of the edge probability map of the larger scale without damaging the edges of the edge probability map of the larger scale, and the spatial distribution of the noise has a certain randomness, so in the process of determining the intersection, the noise can be effectively suppressed to obtain an edge detection result with higher accuracy; and after the accuracy of the edge detection result is improved, the first target detection result determined based on the edge detection result also has higher accuracy.
[0075] The target detection device provided in the embodiment of the present invention can execute the target detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0076] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0077] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0078] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0079] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a target detection method.
[0080] In some embodiments, the target detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the target detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the target detection method in any other appropriate manner (e.g., by means of firmware).
[0081] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0083] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0084] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0085] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0086] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0087] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the target detection method provided in any embodiment of the present application.
[0088] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0089] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0090] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A target detection method, characterized in that: include: Get the image to be processed; The image to be processed is input into a pre-trained edge detection model to obtain an edge detection result; wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and along the scale increasing direction, for each non-minimum scale edge probability map, the latest edge probability map of the previous scale corresponding to the current edge probability map is interpolated to the same scale as the current edge probability map to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result; In the case where it is detected that the edge detection result includes a target object, a first target detection result is output.
2. The method according to claim 1, characterized in that: When the edge detection result includes the target object, outputting the first target detection result includes: Determining a degree of match between the edge detection result and the target object; When the matching degree is greater than a set threshold, a first target detection result corresponding to the target object is output.
3. The method according to claim 2, characterized in that The target object includes a body contour and / or a facial contour of the target object.
4. The method according to claim 2, characterized in that: Determining the matching degree between the edge detection result and the target object includes: Determining a degree of match between the edge detection result and at least two pre-stored target objects; When the matching degree is greater than a set threshold, outputting a first target detection result corresponding to the target object includes: If the matching degree between the edge detection result and any one of the at least two target objects is greater than a set matching threshold, the edge detection result, at least one of the images to be processed, the successfully matched target object, and prompt information indicating successful matching are output.
5. The method according to claim 4, characterized in that After determining the matching degree between the edge detection result and at least two pre-stored target objects, the method further includes: If the matching degree between the edge detection result and each of the at least two target objects is less than or equal to a set matching threshold, a second target detection result indicating a matching failure is output.
6. The method according to claim 1, characterized in that The pre-trained edge detection model is used to: For each non-first upsampling layer, determine the previous sampling layer corresponding to the current upsampling layer, interpolate the latest edge probability map corresponding to the previous upsampling layer to the same scale as the edge probability map output by the current upsampling layer, and obtain the target edge probability map corresponding to the previous upsampling layer; Taking the intersection of the target edge probability map corresponding to the previous upsampling layer and the edge probability map corresponding to the current upsampling layer as the updated edge probability map corresponding to the current upsampling layer; In the case that the current upsampling layer is the last upsampling layer, the updated edge probability map corresponding to the current upsampling layer is used as the edge detection result.
7. A target detection device, characterized in that: include: An image acquisition module, used for acquiring an image to be processed; A detection module, used for inputting the image to be processed into a pre-trained edge detection model to obtain an edge detection result; wherein the pre-trained edge detection model determines at least three edge probability maps of different scales corresponding to the image to be processed through a decoding unit, and interpolates the latest edge probability map of the previous scale corresponding to the current edge probability map to the same scale as the current edge probability map along the scale increasing direction, for each edge probability map of non-minimum scale, to obtain a target edge probability map of the previous scale; the intersection of the target edge probability map of the previous scale and the current edge probability map is used as the updated current edge probability map; when the current edge probability map is the maximum scale edge probability map, the updated current edge probability map is used as the edge detection result; The detection result module is used to output a first target detection result when the edge detection result includes the target object.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the target detection method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the target detection method described in any one of claims 1-6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the target detection method according to any one of claims 1-6.