Method and device for detecting object in video, storage medium and electronic equipment
By matching and updating the video object detection model, the problem of missed detection caused by insufficient clarity of some images in the video is solved, and the accuracy of object detection is improved.
Patent Information
- Application Number
- CN202310300271.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2024-09-20
AI Technical Summary
Existing video object detection models tend to miss detection when part of the video image is not clear enough, resulting in low object detection accuracy.
By acquiring image frames to be optimized whose object detection images do not meet the preset conditions, matching and acquiring target image frames matching them are used as optimized image pairs to update the object detection model until the object detection images meet the preset conditions.
The detection accuracy and accuracy of the object detection model are improved, ensuring that previously undetectable image frames can be detected.
Smart Images

Figure CN118675077A
Abstract
Description
Background Art
[0002] Object detection is one of the classic problems in computer vision. The task is to use boxes to mark the location of objects in the image and give the category of the objects. Object detection models are usually used for detection.
[0003] However, the object detection model in the existing technology may miss detections due to the lack of clarity of some video images, resulting in low object detection accuracy.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0005] The present disclosure aims to provide a method for detecting objects in a video, an apparatus for detecting objects in a video, a computer-readable medium, and an electronic device, thereby improving the accuracy of object detection at least to a certain extent.
[0006] According to a first aspect of the present disclosure, a method for detecting objects in a video is provided, comprising: inputting a video to be detected into an object detection model to obtain an object detection image; obtaining, based on the object detection image, an image frame to be optimized in the video to be detected, in which the object detection image does not satisfy a preset condition; obtaining a target image frame that matches the image frame to be optimized, and using the image frame to be optimized and the target image frame as an optimized image pair; and updating the object detection model using the optimized image pair until the object detection images all satisfy the preset condition; wherein the object detection image corresponding to the target image frame satisfies the preset condition.
[0007] According to a second aspect of the present disclosure, a device for detecting objects in a video is provided, comprising: a detection module for inputting a video to be detected into an object detection model to obtain an object detection image; an acquisition module for acquiring, in the video to be detected, an image frame to be optimized in which the object detection image does not meet a preset condition based on the object detection image; a matching module for acquiring a target image frame that matches the image frame to be optimized, and using the image frame to be optimized and the target image frame as an optimized image pair; an updating module for updating the object detection model using the optimized image pair until the object detection images all meet the preset condition; wherein the object detection image corresponding to the target image frame meets the preset condition.
[0008] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above method is implemented.
[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a memory for storing one or more programs, which enables the one or more processors to implement the above-mentioned method when the one or more programs are executed by the one or more processors.
[0010] An embodiment of the present disclosure provides a method for detecting objects in a video, which inputs a video to be detected into an object detection model to obtain an object detection image; obtains an image frame to be optimized in the video whose object detection image does not meet a preset condition based on the object detection image; obtains a target image frame that matches the image frame to be optimized, and uses the image frame to be optimized and the target image frame as an optimized image pair; and uses the optimized image pair to update the object detection model until all object detection images meet the preset condition. Compared with the prior art, an image frame to be optimized whose object detection image does not meet the preset condition is detected, and a target image frame whose object detection image meets the preset condition is obtained, and the target image frame and the image frame to be optimized are used to update the above-mentioned object detection model, so that the object detection model can complete the detection of the image frame to be optimized that was previously unable to detect, thereby improving the detection accuracy of the object detection model and thereby improving the accuracy of object detection.
[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0013] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0014] Figure 2 A flowchart of a method for detecting objects in a video in an exemplary embodiment of the present disclosure is schematically shown;
[0015] Figure 3 Schematically illustrates a flow chart of acquiring a target image frame in an exemplary embodiment of the present disclosure;
[0016] Figure 4 Schematically illustrates another flow chart for acquiring a target image frame in an exemplary embodiment of the present disclosure;
[0017] Figure 5Schematically illustrates a flow chart of updating an object detection model in an exemplary embodiment of the present disclosure;
[0018] Figure 6 Schematically illustrates another flow chart for updating an object detection model in an exemplary embodiment of the present disclosure;
[0019] Figure 7 Schematically illustrates another flow chart for acquiring a target image frame in an exemplary embodiment of the present disclosure;
[0020] Figure 8 A schematic diagram schematically illustrates the composition of an apparatus for detecting objects in a video according to an exemplary embodiment of the present disclosure;
[0021] Figure 9 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0022] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0023] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0024] In related technologies, video capture can result in subtle differences between frames, even for videos of stationary objects, due to various factors such as lighting. Currently, object detection in videos is primarily performed using deep learning. Overexposure may cause the object detection model to miss an object in a subsequent frame. This example uses the effect of lighting on similar frames as an example. Other factors that can influence similar frames include contrast, sharpness, brightness, and noise.
[0025] Based on the above shortcomings, the present invention provides a method for detecting objects in a video. Figure 1A schematic diagram illustrates a system architecture that can implement the above-described method for detecting objects in videos. System architecture 100 may include a terminal 110 and a server 120. Terminal 110 may be a terminal device such as a smartphone, tablet computer, desktop computer, or laptop computer. Server 120 generally refers to the backend system that provides services related to object detection in videos in this exemplary embodiment and may be a single server or a cluster of multiple servers. Terminal 110 and server 120 may be connected via a wired or wireless communication link to exchange data.
[0026] In one embodiment, the above-mentioned object detection method in a video can be performed by the terminal 110. For example, a user uses the terminal 110 to obtain a video to be detected, and the terminal 110 performs object detection on the video to be detected and outputs an object detection map that meets preset conditions.
[0027] In one embodiment, the above-described method for detecting objects in a video may be performed by server 120. For example, after a user uses terminal 110 to obtain a video to be detected, terminal 110 uploads the video to be detected to server 120. Server 120 then performs object detection on the video and returns an object detection map that meets preset conditions to terminal 110.
[0028] As can be seen from the above, the execution entity of the method for detecting objects in a video in this exemplary embodiment may be the terminal 110 or the server 120 , and this disclosure does not limit this.
[0029] The following combination Figure 2 The object detection method in the video in this exemplary embodiment is described. Figure 2 An exemplary process of the object detection method in the video is shown, which may include:
[0030] Step S210: Input the video to be detected into the object detection model to obtain an object detection image;
[0031] Step S220, obtaining, in the video to be detected, an image frame to be optimized whose object detection image does not meet a preset condition according to the object detection image;
[0032] Step S230, obtaining a target image frame that matches the image frame to be optimized, and using the image frame to be optimized and the target image frame as an optimized image pair;
[0033] Step S240, updating the object detection model using the optimized image pair until all the object detection images meet the preset conditions;
[0034] Wherein, the object detection image corresponding to the target image frame meets the preset condition.
[0035] Based on the above method, the image frames to be optimized whose object detection images do not meet the preset conditions are detected, and the target image frames whose object detection images match the preset conditions are obtained. The above object detection model is updated using the target image frames and the image frames to be optimized, so that the object detection model can complete the detection of the image frames to be optimized that were previously undetectable, thereby improving the detection accuracy of the object detection model and thereby improving the accuracy of object detection.
[0036] Below Figure 2 Each step is described in detail.
[0037] refer to Figure 2 In step S210, the video to be detected is input into the object detection model to obtain an object detection image.
[0038] In an example embodiment of the present disclosure, the object detection model may be pre-trained and used to perform object detection on image frames in a video. The input of the object detection model may be an image or a video, and the output is an object detection image that frames the location of the object and marks the type of the object.
[0039] In this example embodiment, the above-mentioned video to be detected can be input into the above-mentioned object detection model to obtain the above-mentioned object detection image, wherein the above-mentioned object detection image can also be marked with the position of the corresponding image frame in the video to be detected, or the time node of the corresponding image frame in the video to be detected.
[0040] In step S220, an image frame to be optimized whose object detection image does not meet a preset condition is obtained in the video to be detected based on the object detection image.
[0041] In this example embodiment, after obtaining the object detection image corresponding to the above-mentioned video to be detected, the correspondence between the above-mentioned object detection image and the image frame in the video to be detected is determined, and the image frame without a corresponding image to be detected is used as the above-mentioned image to be optimized, or the image frame corresponding to the object detection image with poor selection results is used as the image to be optimized.
[0042] That is, the above-mentioned preset conditions include that the frame selection result of the object detection image is accurate and the object detection image has a corresponding image frame. The above-mentioned preset conditions can also be customized according to user needs and are not specifically limited in this example embodiment.
[0043] In step S230, a target image frame matching the image frame to be optimized is acquired, and the image frame to be optimized and the target image frame are used as an optimized image pair.
[0044] In an exemplary embodiment of the present disclosure, referring to Figure 3As shown, obtaining a target image frame that matches the image frame to be optimized may include steps S310 to S330.
[0045] In step S310, candidate images of the object detection images that meet preset conditions are obtained in the video to be detected.
[0046] In an example embodiment of the present disclosure, the object detection image is detected, and the image frame corresponding to the object detection image that meets the above-mentioned preset conditions is used as the above-mentioned candidate image, wherein the specific details of the preset conditions have been explained in detail above and therefore will not be repeated here.
[0047] In step S320, the similarity between the candidate image and the image frame to be optimized is obtained.
[0048] In this example embodiment, after obtaining the above-mentioned candidate images, the following operation can be performed for each of the above-mentioned image frames to be optimized: calculate the similarity between the above-mentioned candidate images and the above-mentioned image frames to be optimized. The scheme for similarity calculation can refer to the existing technology and will not be repeated again.
[0049] In step S330, the candidate image with the highest similarity is used as the target image frame.
[0050] In this exemplary embodiment, after obtaining the similarities between the image frame to be optimized and each candidate image, the candidate image with the greatest similarity may be used as the target frame.
[0051] In another example embodiment, when obtaining a target image frame that matches the image frame to be optimized, the target image frame that truly matches the image frame to be optimized can be obtained in the video to be detected based on the position of the image frame to be optimized in the video to be detected. Figure 4 As shown, the above steps may include step S410 to step S440.
[0052] In step S410, preselected images of N frames before and after the frame to be optimized are obtained according to the position of the frame to be optimized in the video to be detected.
[0053] In an exemplary embodiment of the present disclosure, the position of the image frame whose number of rows is to be optimized in the video to be detected may be first determined, and then a total of N frames of images before and after the image frame are taken as pre-selected images, where N is a positive integer.
[0054] If N is an even number, N / 2 frames are taken before and after. If N is an odd number, the front frame is taken as one frame more than the rear frame as the above-mentioned pre-selected image. The specific selection method and the specific value of N can be customized according to user needs and are not specifically limited in this example implementation.
[0055] In step S420, candidate images of the object detection images that meet preset conditions are obtained from the pre-selected images.
[0056] In this example embodiment, the object detection image corresponding to the above-mentioned preset image is detected, and the pre-selected image corresponding to the object detection image that meets the above-mentioned preset conditions is used as the above-mentioned candidate image, wherein the specific details of the preset conditions have been explained in detail above, and therefore will not be repeated here.
[0057] In step S430, the similarity between the candidate image and the image frame to be optimized is obtained.
[0058] In this example embodiment, after obtaining the above-mentioned candidate images, the following operation can be performed for each of the above-mentioned image frames to be optimized: calculate the similarity between the above-mentioned candidate images and the above-mentioned image frames to be optimized. The scheme for similarity calculation can refer to the existing technology and will not be repeated again.
[0059] In step S440, the candidate image with the highest similarity is used as the target image frame.
[0060] In this exemplary embodiment, after obtaining the similarities between the image frame to be optimized and each candidate image, the candidate image with the greatest similarity may be used as the target frame.
[0061] In yet another exemplary embodiment, the target image frame for which image frame matching is to be optimized may be obtained by clustering.
[0062] After obtaining the target image frame, the image frame to be optimized and the target image frame may be used as the optimized image pair.
[0063] It should be noted that the object detection images corresponding to the above target image frames all meet the above preset conditions. The specific details of the above preset conditions have been explained in detail above, so they will not be repeated here.
[0064] In step S240, the object detection model is updated using the optimized image pair until all the object detection images meet the preset conditions.
[0065] In this exemplary embodiment, after obtaining the optimized image pair, the object detection model can be updated using the flower head image pair. Specifically, refer to Figure 5 As shown, it may include steps S510 to S530.
[0066] In step S510, a target object detection image corresponding to the target image frame is obtained.
[0067] In this example embodiment, the target object detection image corresponding to the target frame may be directly obtained from the object detection image, or the target image frame may be input into the object detection model to obtain the target object detection image.
[0068] In step S520, the image frame to be optimized is input into an object detection model to obtain a reference object detection image.
[0069] After obtaining the target object detection image, the image to be optimized is input into the object detection model to obtain a reference object detection image corresponding to the image to be optimized.
[0070] In step S530 , the object detection model is updated according to the target object detection image and the reference object detection image.
[0071] After obtaining the reference object detection image and the target object detection image, the target detection image and the reference detection image can be used to update the object detection model. Figure 6 As shown, it may include steps S610 to S630.
[0072] In step S610 , soft labels of the target object detection image and the reference object detection image are determined.
[0073] In an exemplary embodiment of the present disclosure, the soft labels of the target object detection image and the reference object detection image may be first obtained. Specifically:
[0074] in Indicates that the input is the soft label of the target object detection image;
[0075] Indicates that the input is the soft label of the reference object detection image.
[0076] Among them, the above z j Represents the classification part in the target object detection image, z j ′ Classification output for the reference object detection image.
[0077] In step S620 , a loss function is determined based on the soft tags.
[0078] Among them, the position loss and classification loss can select appropriate loss functions according to the needs. For details, please refer to the relevant technology and will not be repeated here. The loss function in this disclosure can be expressed as:
[0079] Loss = L res +a*L cls +b*L kl-loss
[0080] Among them, L res Represents the position loss, L cls Denotes the classification loss. L kl-loss Represents the KL divergence loss, a and b are weight coefficients, in order to be the above L cls The classification loss and L kl-loss The KL divergence loss represented by is of the same order of magnitude.
[0081] In step S630 , the parameters of the object detection model are adjusted until the value of the loss function is less than or equal to a preset value.
[0082] In this example embodiment, after obtaining the above-mentioned loss function, the parameters of the above-mentioned object detection model can be adjusted until the value of the above-mentioned loss function is limited to be equal to a preset value, wherein the above-mentioned preset value can be customized according to user needs and is not specifically limited in this example embodiment.
[0083] Refer to the following Figure 7 The object detection method in the above video is described in detail. First, step S710 can be executed to input the video to be detected into the object detection model to obtain the object detection image, and then step S720 can be executed to determine whether the object detection images meet the preset conditions. If so, step S730 is executed to output the object detection image. If not, step S740 is executed to obtain the image frame to be optimized and the target image frame matched with the image frame to be optimized. The specific details of obtaining the image frame to be optimized and the target image frame matched with the image frame to be optimized have been described in detail above, so they will not be repeated here.
[0084] Then, step S750 may be executed to update the object detection image using the image frame to be optimized and the target image frame, and then step S710 may be executed.
[0085] In summary, in this exemplary embodiment, an image frame to be optimized whose object detection image does not meet the preset conditions is detected, and a target image frame whose object detection image matches the preset conditions is obtained. The target image frame and the image frame to be optimized are used to update the object detection model, enabling the object detection model to complete detection of the image frame to be optimized that was previously undetectable, thereby improving the detection accuracy of the object detection model and, in turn, the accuracy of object detection. After multiple iterations of updates until all object detection images meet the preset conditions, the object detection image is output, resulting in higher detection accuracy for the object detection image and a higher accuracy rate for the obtained results.
[0086] It should be noted that the above figures are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0087] For further reference, Figure 8 As shown, in the embodiment of this example, a device 800 for detecting objects in a video is also provided, comprising a detection module 810, an acquisition module 820, a matching module 30, and an update module 840. In particular:
[0088] The detection module 810 can be used to input the video to be detected into the object detection model to obtain the object detection image.
[0089] The acquisition module 820 may be configured to acquire, in the video to be detected, an image frame to be optimized whose object detection image does not meet a preset condition based on the object detection image.
[0090] In an example implementation, the acquisition module 820 may be configured to acquire, based on the object detection image, an image frame to be optimized that has no corresponding object detection image in the video to be detected.
[0091] The matching module 830 may be configured to obtain a target image frame that matches the image frame to be optimized, and use the image frame to be optimized and the target image frame as an optimized image pair.
[0092] In an example embodiment, the matching module 830 can be configured to obtain a candidate image of the object detection image that meets preset conditions in the video to be detected; obtain the similarity between the candidate image and the image frame to be optimized; and use the candidate image with the highest similarity as the target image frame.
[0093] In another example embodiment, the matching module 830 can be configured to obtain a target image frame that matches the image to be optimized in the video to be detected based on the position of the image frame to be optimized in the video to be detected. Specifically, according to the position of the image frame to be optimized in the video to be detected, a total of N frames of pre-selected images before and after the frame to be optimized are obtained; a candidate image of the object detection image that meets preset conditions is obtained from the pre-selected images; the similarity between the candidate image and the image frame to be optimized is obtained; and the candidate image with the highest similarity is used as the target image frame.
[0094] The updating module 840 may be configured to update the object detection model using the optimized image pair until all the object detection images satisfy the preset condition.
[0095] In one example embodiment, the updating module 840 may be configured to obtain a target object detection image corresponding to the target image frame; input the image frame to be optimized into an object detection model to obtain a reference object detection image; and update the object detection model based on the target object detection image and the reference object detection image. Specifically, the updating module 840 may be configured to determine soft labels for the target object detection image and the reference object detection image; determine a loss function based on the soft labels; and adjust parameters of the object detection model until the value of the loss function is less than or equal to a preset value.
[0096] The specific details of each module in the above device have been described in detail in the implementation method part. The undisclosed details can be found in the implementation method part, so they will not be repeated here.
[0097] The exemplary embodiments of the present disclosure further provide an electronic device for executing the above-mentioned method for detecting objects in a video, which may be the above-mentioned terminal 110 or server 120. Generally, the electronic device may include a processor and a memory, wherein the memory is configured to store executable instructions of the processor, and the processor is configured to execute the above-mentioned method for detecting objects in a video by executing the executable instructions.
[0098] Below is Figure 9 The structure of the electronic device is exemplarily described by taking the mobile terminal 900 in FIG. 1 as an example. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 9 The construction in can also be applied to fixed type equipment.
[0099] like Figure 9 As shown, the mobile terminal 900 may specifically include: a processor 901, a memory 902, a bus 903, a mobile communication module 904, an antenna 1, a wireless communication module 905, an antenna 2, a display screen 906, a camera module 907, an audio module 908, a power module 909 and a sensor module 910.
[0100] The processor 901 may include one or more processing units, for example, an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit). The method for detecting objects in a video in this exemplary embodiment may be executed by an AP, a GPU, or a DSP. When the method involves neural network-related processing, it may be executed by an NPU.
[0101] The processor 901 may be connected to the memory 902 or other components via a bus 903 .
[0102] The memory 902 can be used to store computer-executable program code, which includes instructions. The processor 901 executes the instructions stored in the memory 902 to execute various functional applications and data processing of the mobile terminal 900. The memory 902 can also store application data, such as images, videos, and other files.
[0103] The communication functions of mobile terminal 900 are implemented through mobile communication module 904, antenna 1, wireless communication module 905, antenna 2, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 904 can provide 2G, 3G, 4G, and 5G mobile communication solutions for mobile terminal 900. Wireless communication module 905 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication for mobile terminal 900.
[0104] The display screen 906 is used to implement display functions, such as displaying a user interface, images, and videos. The camera module 907 is used to implement shooting functions, such as capturing images and videos. The audio module 208 is used to implement audio functions, such as playing audio and capturing voice. The power module 209 is used to implement power management functions, such as charging the battery, powering the device, and monitoring battery status. The sensor module 910 may include a depth sensor 9101, a pressure sensor 9102, a gyroscope sensor 9103, an air pressure sensor 9104, etc., to implement corresponding sensing and detection functions.
[0105] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0106] The exemplary embodiments of the present disclosure further provide a computer-readable storage medium having stored thereon a program product capable of implementing the methods described above in this specification. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code that, when executed on a terminal device, causes the terminal device to execute the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of the present disclosure.
[0107] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above.
[0108] In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
[0109] In addition, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0110] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0111] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for detecting objects in a video, characterized in that: include: Input the video to be detected into the object detection model to obtain the object detection image; Obtaining, according to the object detection image, an image frame to be optimized in the video to be detected, in which the object detection image does not meet a preset condition; Acquire a target image frame that matches the image frame to be optimized, and use the image frame to be optimized and the target image frame as an optimized image pair; Using the optimized image pair to update the object detection model until the object detection images all meet the preset conditions; Wherein, the object detection image corresponding to the target image frame meets the preset condition.
2. The method according to claim 1, characterized in that The acquiring of a target image frame matching the image frame to be optimized comprises: Acquire a candidate image of the object detection image that meets a preset condition in the video to be detected; Obtaining the similarity between the candidate image and the image frame to be optimized; The candidate image with the highest similarity is used as the target image frame.
3. The method according to claim 1, characterized in that The acquiring of a target image frame matching the image frame to be optimized comprises: A target image frame matching the image to be optimized is acquired in the video to be detected according to the position of the image frame to be optimized in the video to be detected.
4. The method according to claim 3, characterized in that: Acquiring a target image frame matching the image to be optimized in the video to be detected according to the position of the image frame to be optimized in the video to be detected comprises: Acquire N preselected images before and after the frame to be optimized according to the position of the frame to be optimized in the video to be detected; Acquire a candidate image of the object detection image that meets a preset condition from the preselected images; Obtaining the similarity between the candidate image and the image frame to be optimized; The candidate image with the highest similarity is used as the target image frame.
5. The method according to claim 1, characterized in that: Updating the object detection model using the optimized image pair includes: Acquire a target object detection image corresponding to the target image frame; Inputting the image frame to be optimized into an object detection model to obtain a reference object detection image; The object detection model is updated according to the target object detection image and the reference object detection image.
6. The method according to claim 5, characterized in that The updating of the object detection model according to the target object detection image and the reference object detection image comprises: Determining soft labels of the target object detection image and the reference object detection image; Determining a loss function based on the soft note; The parameters of the object detection model are adjusted until the value of the loss function is less than or equal to a preset value.
7. The method according to claim 1, characterized in that Acquiring an image frame to be optimized in which the object detection image does not meet a preset condition in the video to be detected according to the object detection image includes: An image frame to be optimized without a corresponding object detection image is obtained in the video to be detected according to the object detection image.
8. A device for detecting objects in a video, characterized in that: include: The detection module is used to input the video to be detected into the object detection model to obtain the object detection image; An acquisition module, configured to acquire, in the video to be detected, an image frame to be optimized whose object detection image does not meet a preset condition according to the object detection image; A matching module, used for acquiring a target image frame that matches the image frame to be optimized, and using the image frame to be optimized and the target image frame as an optimized image pair; An updating module, configured to update the object detection model using the optimized image pair until the object detection images all meet the preset conditions; Wherein, the object detection image corresponding to the target image frame meets the preset condition.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting objects in a video according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: one or more processors; as well as A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for detecting objects in a video as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Video target detection method, device and equipment and storage medium
CN112101114A
Image optimization method, image optimization device, storage medium and electronic equipment
CN112348738A
Video detection method, video detection device, storage medium and electronic equipment
CN114170554A
Object characterization model training method, object characterization method and device
CN115620089A
