Vehicle detection method and device, electronic equipment and storage medium

By selecting an optimization strategy in vehicle detection to optimize the input video stream and deployment algorithm, the problem of insufficient computing power of the edge platform is solved, detection efficiency and security are improved, and computing congestion and hardware overheating are avoided.

CN118747860APending Publication Date: 2024-10-08HANGZHOU RUIJIAN ZHIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410808770.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

The computing power of the edge security operation center (SoC) platform is limited, which leads to computational blockage in vehicle detection tasks, hardware overheating, and delayed output of functional results, affecting driving safety.

Method used

When the actual computing power of the embedded platform in the vehicle to be detected does not meet the requirements of the target detection task, a preset optimization strategy is selected to reduce the computing power overhead by optimizing the input video stream or deployment algorithm, including frame loss processing and frame reduction. Processing, amortizing computing power overhead, simplifying algorithms and scheduling methods.

Benefits of technology

It improves the execution efficiency of vehicle detection tasks, avoids calculation blocking and hardware overheating, and ensures the real-time and safety of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747860A_ABST
    Figure CN118747860A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle detection method and device, electronic equipment and a storage medium, and the method comprises the steps: selecting a target optimization strategy from a plurality of preset to-be-selected optimization strategies when the actual calculation power of an embedded platform in a to-be-detected vehicle does not meet the required calculation power overhead of a target detection task; optimizing an initial input video stream of the target detection task by using the target optimization strategy to obtain a target input video stream; and / or optimizing an initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; and based on the target input video stream and / or the target deployment algorithm, performing target detection task detection on the to-be-detected vehicle. According to the method and the device, through a mode of optimizing the initial input video stream and / or optimizing the embedded platform, the computing power overhead when the target detection task is executed is reduced, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle detection technology, and in particular to a method, device, electronic device and storage medium for vehicle detection. Background Art

[0002] With the development of economy, cars have become an indispensable means of transportation in life. In order to ensure the driving safety of vehicles, it is necessary to detect the behavior of people inside the car or the driving environment outside the car. As the detection tasks gradually become richer, more complex calculations and more special operations need to be introduced.

[0003] The introduction of more complex calculations is often accompanied by an increase in CPU overhead, while the introduction of more special operations often leads to a decrease in the computing efficiency of computing units such as the CPU. The edge security operation center (SoC) platform often has limited computing power. Once the calculation is blocked, the embedded platform will often freeze and the hardware will overheat, which will lead to delays in the output of related function results (ranging from tens of milliseconds to several seconds) or even crashes, affecting driving safety. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a vehicle detection method, device, electronic device and storage medium to overcome the problems in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a method for detecting a vehicle, the method comprising:

[0006] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a target optimization strategy is selected from a plurality of preset optimization strategies;

[0007] Using the target optimization strategy to optimize the initial input video stream of the target detection task to obtain a target input video stream; and / or optimizing the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0008] Based on the target input video stream and / or the target deployment algorithm, the target detection task is performed on the vehicle to be detected.

[0009] In some technical solutions of the present application, when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a target optimization strategy is selected from a plurality of preset optimization strategies, including:

[0010] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, selecting one of the candidate optimization strategies as the target optimization strategy from the candidate optimization strategies;

[0011] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a plurality of the candidate optimization strategies are selected from the candidate optimization strategies as the target optimization strategy.

[0012] In some technical solutions of the present application, when the above-mentioned target optimization strategy includes the first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain the target input video stream;

[0013] When the target optimization strategy includes a second type of optimization strategy, the target optimization strategy is used to optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0014] When the target optimization strategy includes a first type optimization strategy and a second type optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain a target input video stream; and the initial deployment algorithm of the embedded platform is optimized to obtain an optimized target deployment algorithm;

[0015] Among them, the first type of optimization strategy is used to reduce the data volume of the target input video stream, and the second type of optimization strategy is used to reduce the initial computing power overhead of the initial deployment algorithm.

[0016] In some technical solutions of the present application, when the above-mentioned target optimization strategy includes the first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain the target input video stream, including:

[0017] The target input video stream is obtained by performing frame dropping or frame reduction processing on the initial input video stream.

[0018] In some technical solutions of the present application, the above method reduces the initial computing power overhead of the initial deployment algorithm by:

[0019] Using other processing devices to apportion the first computing power overhead of the initial deployment algorithm; wherein the first computing power overhead is part or all of the required computing power overhead;

[0020] The computing power expenditure in the required computing power expenditure except the first computing power expenditure is used as the target computing power expenditure of the target deployment algorithm.

[0021] In some technical solutions of the present application, the above method reduces the initial computing power overhead of the initial deployment algorithm by:

[0022] By simplifying the initial deployment algorithm, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

[0023] In some technical solutions of the present application, the above method reduces the initial computing power overhead of the initial deployment algorithm by:

[0024] By changing the scheduling method between the various computing units in the embedded platform, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

[0025] In a second aspect, an embodiment of the present application provides a vehicle detection device, the device comprising:

[0026] A selection module is used to select a target optimization strategy from a plurality of preset optimization strategies when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task;

[0027] An optimization module, used to optimize the initial input video stream of the target detection task using the target optimization strategy to obtain a target input video stream; and / or optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0028] A detection module is used to perform a target detection task on the vehicle to be detected based on the target input video stream and / or the target deployment algorithm.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned vehicle detection method when executing the computer program.

[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned vehicle detection method are executed.

[0031] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0032] The method of the present application includes selecting a target optimization strategy from a plurality of preset optimization strategies to be selected when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task; using the target optimization strategy to optimize the initial input video stream of the target detection task to obtain a target input video stream; and / or optimizing the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; based on the target input video stream and / or the target deployment algorithm, performing the target detection task on the vehicle to be detected.

[0033] The present application reduces the computing power overhead when performing target detection tasks and improves detection efficiency by optimizing the initial input video stream and / or optimizing the embedded platform.

[0034] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A schematic diagram showing a flow chart of a vehicle detection method provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of a vehicle detection device provided in an embodiment of the present application is shown;

[0038] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0040] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0041] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0042] With the development of the economy, cars have become an indispensable means of transportation in life. In order to ensure the driving safety of the vehicle, it is necessary to detect the behavior of people in the car or the driving environment outside the car. For example, DMS (driver monitoring embedded platform) and OMS (full cabin occupant monitoring embedded platform) have been deployed in multiple models. As the name suggests, DMS focuses on driving safety for the monitoring of the driver's status; while the latter focuses more on the passengers' riding experience and entertainment. The driver monitoring embedded platform mainly includes distraction detection, fatigue monitoring, dangerous action detection, face registration & recognition and liveness functions; for the occupant monitoring embedded platform, it mainly includes occupant attribute detection, gesture control, and left-behind child care functions.

[0043] As detection tasks become increasingly diverse, more complex calculations and more special operations need to be introduced. The introduction of more complex calculations is often accompanied by an increase in CPU overhead, while the introduction of more special operations often leads to a decrease in the computing efficiency of computing units such as the CPU. The edge security operation center (SoC) platform often has limited computing power. Once the calculation is blocked, the embedded platform often freezes and the hardware overheats, which in turn causes delays in the output of related function results (ranging from tens of milliseconds to seconds) or even crashes, affecting driving safety.

[0044] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for vehicle detection, which are described below through embodiments.

[0045] Figure 1 A schematic flow chart of a vehicle detection method provided in an embodiment of the present application is shown, wherein the method includes steps S101-S104; specifically:

[0046] S101, when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, select a target optimization strategy from a plurality of preset optimization strategies to be selected;

[0047] S102, using the target optimization strategy to optimize the initial input video stream of the target detection task to obtain a target input video stream; and / or optimizing the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0048] S103: Based on the target input video stream and / or the target deployment algorithm, perform a target detection task on the vehicle to be detected.

[0049] The present application reduces the computing power overhead when performing target detection tasks and improves detection efficiency by optimizing the initial input video stream and / or optimizing the embedded platform.

[0050] Some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0051] The embodiment of the present application provides a method for vehicle detection, which is applied to an embedded platform. The embedded platform integrates hardware and software to realize specific functions. In the present application, the embedded platform is connected to various data acquisition devices (such as sensors, cameras, etc.) or the embedded platform is integrated with data acquisition devices to obtain data to be detected from each data acquisition device. The data to be detected here is determined according to a specific target target detection task. That is, after the user determines the target detection task, the target detection task is input into the embedded platform, the embedded platform generates a corresponding data acquisition instruction, and sends the data acquisition instruction to the corresponding data acquisition device. The data acquisition device collects the corresponding data to be detected according to the data acquisition instruction. For example, the target detection task is the detection of dangerous actions of people in the car (including drivers and passengers) (the data acquisition device performs image acquisition on the area in the car, analyzes the collected images through the action detection model or method, and determines whether the people in the car have dangerous actions), or the target detection task is the detection of certain specific objects outside the car (the data acquisition device performs image acquisition on the designated area outside the car, analyzes the collected images through the target detection model or method, and determines whether there is a target object in the area).

[0052] When the embedded platform leaves the factory, it will have a set actual computing power (ability to process information). In the actual working environment, the computing power of the embedded platform here is generally very low. Low computing power means that the computing power allocated to the cockpit perception algorithm on the current embedded platform cannot fully meet the real-time operation of the full function of the cockpit perception under the most ideal reasoning strategy, which is reflected in one or more of the following characteristics: the absolute value of the computing power available to the algorithm is low, such as the allocated CPU resources are less than 5kDMIPs; the algorithm is stuck when running under the most ideal reasoning strategy with full functions, and cannot process all the data sent by the camera module in real time; the algorithm runs under the most ideal reasoning strategy with full functions, and the embedded hardware platform overheats, making the ideal resource allocation unsustainable. In this regard, it is necessary to improve the detection efficiency.

[0053] When determining whether computing power optimization is needed, when the actual computing power of the embedded platform in the vehicle to be detected in the embodiment of the present application does not meet the required computing power overhead of the target detection task, computing power optimization is needed at this time. The required computing power of the target detection task here is determined by the detection algorithm (the deployment algorithm preset in the embedded platform) and the detection object. For example, the required computing power of the same detection algorithm when detecting one person is lower than the required computing power overhead when detecting three people. When different monitoring algorithms are for the same detection object, the required computing power overhead of the two may be the same or different, which is specifically determined by factors such as the processing steps of the algorithm.

[0054] When performing computing power optimization, the embodiment of the present application pre-sets a variety of optimization strategies to be selected, and selects a target optimization strategy from the multiple optimization strategies to be selected. The target optimization strategy here includes one or more optimization strategies to be selected. That is, in the embodiment of the present application, one optimization strategy to be selected can be selected directly as the target optimization strategy, or multiple optimization strategies to be selected can be selected to be combined to obtain the target optimization strategy. After determining the target optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain the target input video stream; and / or the initial deployment algorithm of the embedded platform is optimized to obtain the optimized target deployment algorithm; based on the target input video stream and / or the target deployment algorithm, the target detection task is detected for the vehicle to be detected.

[0055] In an optional implementation, the optimization strategies to be selected in the embodiment of the present application include two different types: a first type of optimization strategy and a second type of optimization strategy, and different types of optimization strategies act on different objects. Among them, the first type of optimization strategy is used to optimize the initial input video stream to obtain an optimized target input video stream; the second type of optimization strategy is used to reduce the initial computing power overhead of the initial deployment algorithm. In specific implementations, the first type of optimization strategy and the second type of optimization strategy can be used alone or in combination.

[0056] In an optional implementation, the first type of optimization strategy is a method of reducing the data volume of the target input video stream, specifically including performing frame dropping or frame reduction processing on the initial input video stream.

[0057] Frame loss processing: In order to avoid blockage during the operation of the embedded platform, which may cause subsequent tasks to be unable to be processed in time (for example, video frames in the embedded platform are sent to the embedded platform frame by frame at an interval of 40ms, and the embedded platform takes 50ms to process a certain frame (which may be occasional or frequent), then the subsequent frames will not be processed in real time and have to wait in queue), thereby affecting the real-time nature of related alarms. Here, an embodiment of the present application proposes a frame loss processing strategy to optimize this problem.

[0058] Specifically, after the previous frame data has been processed and the target frame to be processed (recorded as the n-1th frame) is to be selected, it can be based on the following criteria: the frame processing queue is empty, that is, all frames currently sent in have been processed in real time, and it is necessary to wait for new frames to enter the frame queue for processing; the number of frames in the frame processing queue is 1, that is, there is no video frame backlog problem at present, and the current frame (i.e., the nth frame) can be taken out for processing; the number of frames in the frame processing queue is > 1, that is, there is a video frame backlog problem, and there are multiple processing strategies at this time: take out the head frame of the queue for processing, that is, take out the next frame of the currently processed frame (i.e., the nth frame) for processing. Using this strategy may cause a backlog of video frames to be processed in the queue; take out the tail frame (recorded as the pth frame, p>n) for processing, and clear the remaining frames in the current frame queue at the same time.

[0059] When performing this type of processing, you need to pay attention to the function that relies on a window period (that is, the output of a certain state needs to meet the continuous duration or number of frames) for alarming. It is necessary to rely on the result of the pth frame to complete the discarded frames between the nth and pth frames. At this time, there are two completion strategies: the first one: if the pth frame is judged as result x (such as dangerous action), and the nth frame is also judged as result x, then the frames between p and n are all supplemented with result x; the second one: if the pth frame is judged as result x (such as dangerous action), and the nth frame is judged as result y (such as safe action), then the frames between p and n can be supplemented with result x or y according to predefined rules.

[0060] According to the predefined time interval threshold (denoted as T), the frame that meets the threshold and is farthest from the nth frame (denoted as the qth frame) is taken out, that is, the time interval between q and n is less than T, and the time interval between the q+1th frame and n is greater than T. The purpose of this strategy is to avoid the loss of necessary monitoring information due to large time span frame skipping. Similarly, the second completion strategy can be used for the result of discarding frames between the qth frame and the mth frame.

[0061] When using frame loss processing, it is also necessary to combine it with the specific data to be detected. If no dangerous behavior is detected in the data to be detected, a low-frequency acquisition method can be adopted (that is, more images are discarded). When dangerous behavior is detected, a high-frequency acquisition method can be adopted (that is, more images are retained).

[0062] Frame drop processing: Similar to frame loss processing, this solution is also to alleviate the problem that subsequent tasks cannot be processed in time due to blocking during the operation of the embedded platform. The strategy of this solution is relatively simple, that is, a frame drop signal is sent to the camera module, thereby increasing the interval between frames sent in; after the blocking problem is alleviated (such as after the completion of intensive computing tasks), the frame rate can be lowered back to normal. For the selection of the timing of frame drop, there can be (but not limited to) the following methods: defined according to the length of the frame processing queue, if the length of the frame processing queue is greater than 5, then the frame is dropped; based on the current frame or the average single frame processing time over a period of time, if the processing time is greater than a certain threshold, the frame rate is lowered. It should be noted that the threshold can be an absolute value (such as 30ms) or an adaptive value (such as defined based on the interval time between adjacent frames at the current frame rate).

[0063] The frame rate to be reduced can be selected in the following ways (but not limited to): reducing to a fixed frame rate, such as from 20FPS to 10FPS; the frame rate is gradually reduced according to the set rules, such as each frame rate is reduced to 80% of the current frame rate. If the frame rate reduction condition is still met after the frame rate reduction, the current frame rate can be further reduced.

[0064] When specifically reducing the amount of data to be detected, it is also necessary to consider the changes in the indicators to be detected in the data to be detected, so as to dynamically adjust the frequency. That is, according to the impact of the indicators to be detected in the data to be detected on the target project, reduce the amount of data to be detected. For example, in the driver monitoring embedded platform, the indicators concerned by functions such as fatigue, distraction, and dangerous action detection are different. The fatigue function focuses on the opening and closing state of the eyes (closed eye duration, blinking frequency, etc.), the distraction function focuses on the head posture, line of sight direction and landing point, and the dangerous action focuses on whether the driver has smoking, calling, drinking water and other behaviors. Among these indicators, the changes in the opening and closing state of the eyes, the line of sight direction and the landing point are more frequent and need to be updated in real time; while the changes in the head posture and the state of dangerous actions are relatively stable, and can be predicted and interpolated to a certain extent. The embodiment of the present application can determine whether this type of indicator has changed significantly based on some additional information, so as to dynamically adjust the frequency of calculating this type of indicator. For example: when the position of the head or feature point changes, the head posture often changes accordingly; when the state of the feature points around the mouth changes from "unobstructed" to "obstructed", there is a probability that it is because of the occurrence of smoking and drinking actions.

[0065] The two types of indicators are calculated in a dynamic scheduling manner: the indicators corresponding to each function are divided into two categories. One type of indicator needs to be updated in real time, and the algorithm calculates it every frame; the other type of indicator can be interpolated and predicted, and the calculation frequency is dynamically adjusted according to other information in the algorithm. For the latter type of indicator, the program is first calculated in low-frequency mode during operation. If it is evaluated based on other information in the algorithm that the indicator has a probability of changing significantly, the calculation frequency of the indicator is increased accordingly. After that, when it is evaluated that the indicator tends to be stable, it is switched to low-frequency calculation mode. Take the calculation of head posture indicators as an example: when the program starts running, the head posture is calculated once every 4 frames, and the remaining frames are interpolated to obtain the results; if the position of the head or feature points changes, the head posture is calculated in real time every frame; when the position of the head or feature points tends to be stable, the calculation frequency is reduced to once every 4 frames.

[0066] In an optional embodiment, the second type of optimization strategy to improve the computing power of the embedded platform processing includes: using other processing devices to share the first computing power overhead of the initial deployment algorithm, simplifying the initial deployment algorithm, and changing the scheduling method between the various computing units in the embedded platform.

[0067] Use other processing devices to share the first computing power overhead of the initial deployment algorithm: set up a backup processing device on the vehicle or use a cloud server, etc. That is, give part or all of the data to be detected to other processing devices for processing, and give the processing results to the embedded platform.

[0068] For example, take the smoking function in dangerous behavior action detection as an example (assuming that the edge network has a high enough recall in smoking, there will be some false alarms in accuracy, but basically all smoking actions can be detected). The steps are as follows: The smoking detection process is divided into low-frequency and high-frequency modes. In order to save computing power, the low-frequency mode skips frames for smoking (such as 10 frames at intervals); after entering the high-frequency mode, the edge will detect smoking at a higher frequency (such as frame-by-frame detection) and count the smoking duration. In the low-frequency mode, the edge smoking determination algorithm needs to detect the smoking detection frame. If the smoking determination algorithm determines that it is in a non-smoking state, it will discard the current frame and continue to detect in a low-frequency mode; if the smoking determination algorithm determines that it is in a smoking state, it will enter the smoking determination window and perform high-frequency smoking monitoring. After recognizing the start of smoking, the algorithm performs high-frequency smoking monitoring and sends the current frame (or adjacent frame) information to the cloud. Here, the current frame information can be the original image, a local image of the smoking-related area, or a desensitized feature image that has been partially processed by a neural network. The duration of smoking (or the number of frames) will be counted in the smoking judgment window. During the process of accumulating the duration of smoking at the edge, the cloud performs a model inference process with a high computing density. Its goal is to verify the edge results and avoid false triggering of recognition. This process may not be able to receive feedback quickly due to the communication overhead or inference overhead between the edge and the cloud. However, once the result is calculated, the cloud sends a signal to synchronize with the edge. If it is judged as a non-smoking state (that is, a misjudgment occurs at the edge), the edge is notified to reset the judgment window. Once the edge finds that smoking has stopped within the judgment window (or corrects the previous misjudgment), it can immediately notify the cloud to terminate the inference to avoid resource waste. The current cumulative duration (or number of frames) will be determined frame by frame in the smoking judgment window. Once the smoking output alarm threshold is exceeded, a smoking alarm is issued. At the same time, its window will not be reset to zero, but will continue to count the duration of smoking until the smoking judges that the target frame is in a non-smoking state.

[0069] By moving some heavy calculation tasks to the cloud, the computing power of the edge can be saved; high-confidence calculations are performed on the cloud to increase the detection interval of the high-frequency detection mode, thereby saving computing power on the edge (that is, if there is no cloud intervention, the edge may need to perform high-frequency verification within the judgment window period to ensure the correctness of the output, such as frame-by-frame verification; because of the introduction of the cloud, the edge needs to perform verification at a high frequency, such as frame-by-frame calculations during the judgment window period); by introducing a secondary verification link on the cloud, the false detection problem caused by computing power limitations is optimized.

[0070] By simplifying the initial deployment algorithm: by pruning the target detection model; by reducing the computing power occupied by other models except the target detection model. Specific pruning method: compressing the network model structure and reducing the size of the model.

[0071] Reduce the computing power occupied by other models: For target detection models with large models, low simultaneous call frequency, and high tolerance for response delay, the function dynamic initialization strategy can be used for optimization. That is, initialize before calling other models, and release them in time after use, thereby optimizing the internal resource usage of the embedded platform. The conditions for using this strategy must be met: model loading time + model inference time < output response tolerance time.

[0072] For example, before deployment, first determine the CNN model that does not need to be initialized with the DMS / OMS embedded platform based on the functional characteristics of other models. The characteristics of this type of other model are that it occupies a large amount of RAM during the operation process, and the call frequency is low and the response delay tolerance is high. Often, this type of other model belongs to some models related to static facial attributes (such as judging the user's gender, age, etc.) or secondary verification models (such as the use of low-computing power small models in dangerous behaviors, and verification models that are called infrequently); after the embedded platform is started, the initialization process begins after determining that the other model will perform reasoning tasks in the short term. Like the general model initialization process, it is necessary to initialize the model on a specific computing chip side (such as CPU, CDSP, GPU); after other models are used, they are released after the release conditions are met. The release conditions here include but are not limited to the time from the last call exceeding a certain threshold, the embedded platform determines that the other model will not be called again in the short term, and the allocatable resources of the embedded platform have been basically exhausted.

[0073] Change the scheduling method between the various computing units in the embedded platform: For some target detection models with large computational workloads, flexible scheduling can be performed based on the working saturation (or occupancy rate) of the current different inference computing units (which can be CPU, CDSP, GPU and other hardware or multiple SoC chips). If the default inference unit freezes during the inference process, the inference computing unit with lower occupancy rate will be searched in the established order for inference and the results will be fed back. It can be divided into the following steps:

[0074] Determine the scheduling model that requires multi-computing unit scheduling from the target detection model: specifically, for the scheduling of CNN between computing units, mainly select models with longer computing time, or select models with large differences in inference efficiency on different platforms (i.e., on some platforms, due to different inference hardware architectures, the inference time of some models is significantly different from the inference time of other networks with similar computing complexity on the chip);

[0075] Convert the selected scheduling model to the corresponding candidate inference platform. If it needs to be deployed on the Qualcomm CDSP platform, it is necessary to use the SNPE tool chain to convert the DLC, or use the tool chain corresponding to the NPU of the target SoC to convert the model.

[0076] In the real-time inference stage, the scheduling model needs to be initialized. At this time, you can choose to initialize all the deployment models of all platforms of the scheduling model at once, or initialize them before the target platform has a call demand according to actual needs. The advantage of the former solution is that it does not require additional initialization time overhead when inferencing calls, so the response time is shorter; the advantage of the latter is that it does not require additional RAM and other storage overheads for different platform models in advance;

[0077] When certain conditions are triggered, the model x inference platform needs to be switched. This function needs to explain the selection of the model switching target platform and the timing of the switch. Regarding the selection of the model switching target platform, it can choose (but not limited to) one of the following solutions: when switching is required, query the occupancy of multiple candidate platforms and select the platform with the lowest current occupancy rate; combined with real-time requirements, select the platform that can currently meet the real-time inference requirements (that is, it is necessary to consider the occupancy rate and the computing power of the platform); based on the computing power of different models and the current occupancy, use the above two types of information to estimate the platform with the shortest inference time for the target model.

[0078] Regarding the switching timing, it can choose (but not limited to) one of the following solutions: make decisions and schedule when the previous frame is processed and the current frame is about to start processing; during the processing process, make a decision before inference for each model that can be scheduled on multiple platforms.

[0079] In addition, the above "CNN scheduling between computing units" solution is introduced based on the model as the atomic unit. Similarly, the algorithm can be split based on the model sub-modules (such as splitting a network into three sub-modules, sub-A, sub-B, and sub-C according to the inference order, and the image is sent to sub-A and then passes through sub-B and sub-C to output the final result). The solution can completely use sub-modules to replace the "scheduling model" in the above introduction to use this scheduling algorithm, so it will not be repeated.

[0080] Figure 2 A schematic diagram of the structure of a vehicle detection device provided in an embodiment of the present application is shown, and the device includes:

[0081] A selection module is used to select a target optimization strategy from a plurality of preset optimization strategies when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task;

[0082] An optimization module, used to optimize the initial input video stream of the target detection task using the target optimization strategy to obtain a target input video stream; and / or optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0083] A detection module is used to perform a target detection task on the vehicle to be detected based on the target input video stream and / or the target deployment algorithm.

[0084] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a target optimization strategy is selected from a plurality of preset optimization strategies, including:

[0085] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, selecting one of the candidate optimization strategies as the target optimization strategy from the candidate optimization strategies;

[0086] When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a plurality of the candidate optimization strategies are selected from the candidate optimization strategies as the target optimization strategy.

[0087] When the target optimization strategy includes a first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain a target input video stream;

[0088] When the target optimization strategy includes a second type of optimization strategy, the target optimization strategy is used to optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm;

[0089] When the target optimization strategy includes a first type optimization strategy and a second type optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain a target input video stream; and the initial deployment algorithm of the embedded platform is optimized to obtain an optimized target deployment algorithm;

[0090] Among them, the first type of optimization strategy is used to reduce the data volume of the target input video stream, and the second type of optimization strategy is used to reduce the initial computing power overhead of the initial deployment algorithm.

[0091] When the target optimization strategy includes the first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain the target input video stream, including:

[0092] The target input video stream is obtained by performing frame dropping or frame reduction processing on the initial input video stream.

[0093] When the target optimization strategy includes the second type optimization strategy, the initial deployment algorithm of the embedded platform is optimized using the target optimization strategy to obtain an optimized target deployment algorithm, including:

[0094] Using other processing devices to apportion the first computing power overhead of the initial deployment algorithm; wherein the first computing power overhead is part or all of the required computing power overhead;

[0095] The computing power expenditure in the required computing power expenditure except the first computing power expenditure is used as the target computing power expenditure of the target deployment algorithm.

[0096] When the target optimization strategy includes the second type of optimization strategy, the target optimization strategy is used to optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm:

[0097] By simplifying the initial deployment algorithm, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

[0098] When the target optimization strategy includes the second type optimization strategy, the initial deployment algorithm of the embedded platform is optimized using the target optimization strategy to obtain an optimized target deployment algorithm, including:

[0099] By changing the scheduling method between the various computing units in the embedded platform, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

[0100] like Figure 3 As shown, an embodiment of the present application provides an electronic device for executing the vehicle detection method in the present application, the device includes a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the vehicle detection method when executing the computer program.

[0101] Specifically, the above-mentioned memory and processor may be general-purpose memory and processor, which are not specifically limited here. When the processor runs the computer program stored in the memory, the above-mentioned vehicle detection method can be executed.

[0102] Corresponding to the vehicle detection method in the present application, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned vehicle detection method are executed.

[0103] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is executed, the above-mentioned vehicle detection method can be executed.

[0104] In the embodiments provided in the present application, it should be understood that the disclosed embedded platform and method can be implemented in other ways. The embedded platform embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another embedded platform, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the embedded platform or unit can be electrical, mechanical or other forms.

[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0106] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0108] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0109] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for vehicle detection, It is characterized in that The method comprises: When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a target optimization strategy is selected from a plurality of preset optimization strategies; Using the target optimization strategy to optimize the initial input video stream of the target detection task to obtain a target input video stream; and / or optimizing the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; Based on the target input video stream and / or the target deployment algorithm, the target detection task is performed on the vehicle to be detected.

2. The method according to claim 1, It is characterized in that When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a target optimization strategy is selected from a plurality of preset optimization strategies, including: When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, selecting one of the candidate optimization strategies as the target optimization strategy from the candidate optimization strategies; When the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task, a plurality of the candidate optimization strategies are selected from the candidate optimization strategies as the target optimization strategy.

3. The method according to claim 1, It is characterized in that When the target optimization strategy includes a first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain a target input video stream; When the target optimization strategy includes a second type of optimization strategy, the target optimization strategy is used to optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; When the target optimization strategy includes a first type optimization strategy and a second type optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain a target input video stream; and optimizing the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; Among them, the first type of optimization strategy is used to reduce the data volume of the target input video stream, and the second type of optimization strategy is used to reduce the initial computing power overhead of the initial deployment algorithm.

4. The method according to claim 3, It is characterized in that When the target optimization strategy includes the first type of optimization strategy, the target optimization strategy is used to optimize the initial input video stream of the target detection task to obtain the target input video stream, including: The target input video stream is obtained by performing frame dropping or frame reduction processing on the initial input video stream.

5. The method according to claim 3, It is characterized in that The method reduces the initial computing power overhead of the initial deployment algorithm by: Using other processing devices to apportion the first computing power overhead of the initial deployment algorithm; wherein the first computing power overhead is part or all of the required computing power overhead; The computing power expenditure in the required computing power expenditure except the first computing power expenditure is used as the target computing power expenditure of the target deployment algorithm.

6. The method according to claim 3, It is characterized in that The method reduces the initial computing power overhead of the initial deployment algorithm by: By simplifying the initial deployment algorithm, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

7. The method according to claim 3, It is characterized in that The method reduces the initial computing power overhead of the initial deployment algorithm by: By changing the scheduling method between the various computing units in the embedded platform, the initial computing power overhead of the initial deployment algorithm is reduced, and the target computing power overhead of the target deployment algorithm is obtained.

8. A vehicle detection device, It is characterized in that The device comprises: A selection module is used to select a target optimization strategy from a plurality of preset optimization strategies when the actual computing power of the embedded platform in the vehicle to be detected does not meet the required computing power overhead of the target detection task; An optimization module, used to optimize the initial input video stream of the target detection task using the target optimization strategy to obtain a target input video stream; and / or optimize the initial deployment algorithm of the embedded platform to obtain an optimized target deployment algorithm; A detection module is used to perform a target detection task on the vehicle to be detected based on the target input video stream and / or the target deployment algorithm.

9. An electronic device, It is characterized in that include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the vehicle detection method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle detection method as claimed in any one of claims 1 to 7 are executed.