Simulation algorithm data generation method and device based on canvas, medium and equipment
By adding business attribute data to the canvas tool to generate target annotation items and converting them into recognition result data, the problem that existing technologies cannot meet the needs of business scenarios is solved, achieving efficient data generation and testing, and reducing costs.
Patent Information
- Application Number
- CN202411014980.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-15
AI Technical Summary
Existing data annotation methods are mainly for model training, which makes it difficult to meet the needs of complex and diverse business scenarios, and are also costly. There is a lack of canvas-based simulation algorithm data generation methods to support the generation of recognition result data for business scenarios.
Add raw annotations that match the target application algorithm to the canvas tool's display screen, add business attribute data, generate target annotations, convert the annotation list into target recognition result data through publishing rules, and output it to the specified data source.
It enables flexible fulfillment of algorithm recognition result data requirements for various business scenarios, improves business logic development efficiency, reduces testing costs, shortens testing cycles, and facilitates problem localization.
Smart Images

Figure CN118967883A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of algorithm recognition technology, and in particular to a canvas-based simulation algorithm data generation method, device, medium and equipment. Background Art
[0002] Existing data annotation is mainly used for model training, and the current annotation data format can only be a fixed format (such as cvat, coco, yolo, etc.) to specify features for the annotation target and improve model accuracy.
[0003] For an application algorithm, it is mainly divided into two parts: algorithm recognition and business logic. The input source of business logic is the algorithm recognition result data. For complex and diverse business scenarios, it is difficult to provide recognition result data for all business scenarios through algorithm recognition. Existing annotation methods are all for data annotation of model training. To test business scenarios, only real algorithm recognition result data can be used, which requires resources such as algorithms, data sources, and servers, and is costly.
[0004] The Canvas tool is a commonly used graphics drawing tool in web projects. There is currently no canvas-based simulation algorithm data generation method in the prior art to generate recognition result data for business scenarios. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a canvas-based simulation algorithm data generation method, device, medium and equipment that overcome the above problems or at least partially solve the above problems.
[0006] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0007] According to a first aspect of an embodiment of the present invention, a method for generating simulation algorithm data based on canvas is provided, and the method for generating simulation algorithm data based on canvas includes:
[0008] Adding at least one original annotation item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original annotation item is the annotation data after the annotation is completed;
[0009] Determine the business attribute data selected by each of the original marking items respectively, add the corresponding business attribute data to all the original marking items, and obtain the target marking items;
[0010] Merge all the target annotation items to create an annotation item list;
[0011] The marked item list is published according to a set publishing rule, and the marked item list is converted into target recognition result data to be output to a designated data source.
[0012] In some embodiments of the present invention, adding the corresponding business attribute data to the original annotation item includes:
[0013] After adding the original annotation item on the display screen of the canvas tool, selecting a target position on the original annotation item and adding a target frame at the target position;
[0014] The business attribute set for the target frame is determined, and the business attribute data is added to the original marked item to obtain the target marked item.
[0015] In some embodiments of the present invention, the method includes: setting a publishing rule for the annotation item list according to the type of the target application algorithm, the publishing rule including a publishing mode, a specified data source, and configuration parameters.
[0016] In some embodiments of the present invention, the method publishes the marked item list, including:
[0017] In response to the marking item list publishing request, calling and publishing an http request at the front end, wherein the request body in the http request includes the marking item list and the specified data of the data source;
[0018] The backend server converts the received list of annotation items into target recognition result data;
[0019] The target recognition result data is output to the designated data source according to the designated data of the data source.
[0020] In some embodiments of the present invention, the method further comprises:
[0021] Determine the type of the target application algorithm, wherein the type of the target application algorithm includes a target detection algorithm, an image segmentation algorithm, and an image classification algorithm;
[0022] The matching original annotation item is selected according to the type of the target application algorithm.
[0023] In some embodiments of the present invention, the method further includes: after adding the original annotation item on the display screen of the canvas tool, setting a background frame image on the display screen, wherein the background frame image is a photo or a captured video frame image.
[0024] In some embodiments of the present invention, the data sources include a MySQL database, a Kafka message queue, and a webhook.
[0025] According to a second aspect of an embodiment of the present invention, a canvas-based simulation algorithm data generation device is provided, and the canvas-based simulation algorithm data generation device includes:
[0026] A marking item adding module, used to add at least one original marking item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original marking item is the marking data after the marking is completed;
[0027] A business attribute adding module, used to respectively determine the business attribute data selected by each of the original marking items, and add the corresponding business attribute data to all the original marking items to obtain a target marking item;
[0028] A data processing module, used for merging all the target annotation items to create an annotation item list;
[0029] The publishing module is used to publish the marked item list according to the set publishing rules, and convert the marked item list into target recognition result data to output to the specified data source.
[0030] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which computer program instructions are stored. The computer program instructions are loaded and executed by a processor to implement the operations performed by any of the methods described above.
[0031] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, comprising a processor and a memory, wherein the memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, it implements instructions of any of the methods described above.
[0032] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:
[0033] The embodiments of the present invention provide a canvas-based simulation algorithm data generation method, device, medium and equipment. Compared with the prior art, the canvas-based simulation algorithm data generation method described in the embodiments of the present invention adds the required business attribute data to the original annotation item to obtain the target annotation item and converts it into the target recognition result data. According to the needs, it can flexibly meet the algorithm recognition result data requirements of various business scenarios, facilitate business logic developers to debug and improve the efficiency of business logic function development. At the same time, it is more convenient to provide various business scenario data to testers, and there can be rich test cases. At the same time, the route of business logic testing is shortened, so that the test does not need to go through the real recognition algorithm task to verify the correctness of business recognition, shorten the test cycle and can more easily locate the location where the problem occurs, thereby reducing costs.
[0034] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram of a flow chart of a method for generating simulation algorithm data based on canvas provided in an embodiment of the present invention;
[0037] Figure 2 This is a reference diagram for the target detection algorithm.
[0038] Figure 3 A schematic diagram of the principle structure of a canvas-based simulation algorithm data generation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings.
[0040] Various structural schematic diagrams according to embodiments of the present disclosure are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may further design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0041] In the context of the present disclosure, when a layer / element is referred to as being "on" another layer / element, the layer / element may be directly on the other layer / element, or there may be an intervening layer / element therebetween. Additionally, if a layer / element is "on" another layer / element in one orientation, the layer / element may be "below" the other layer / element when the orientation is reversed. In the context of the present disclosure, similar or identical components may be denoted by the same or similar reference numerals.
[0042] In order to better understand the above-mentioned technical scheme, the above-mentioned technical scheme will be described in detail below in combination with specific implementation methods. It should be understood that the embodiments of the present disclosure and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0043] Figure 1 is a flowchart of a method for generating simulation algorithm data based on canvas provided by an embodiment of the present invention, such as Figure 1 As shown, the canvas-based simulation algorithm data generation method includes the following steps:
[0044] S1. Adding at least one original annotation item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original annotation item is the annotated data;
[0045] In an embodiment of the present invention, the original annotation item is the annotation data that has been annotated. The annotation data is, for example, a frame of annotated image. Because in a specific application scenario, multiple original annotation items are required to accurately simulate the scene, the number of the original annotation items needs to be determined according to actual application requirements. For example, when the application scenario is a scene for identifying a person crossing a line (a person goes from one side of a line to the other side of a line), the previous frame of image is required, that is, the person is on one side of the line, and the second frame of image is the person on the other side of the line. To simulate this scene, at least two of the original annotation items must be used in combination, and a number is also required to identify a target frame, so that the person target frames with the same number in the previous frame and the next frame represent the same person.
[0046] The embodiment of the present invention determines the type of the target application algorithm, wherein the type of the target application algorithm includes a target detection algorithm, an image segmentation algorithm, and an image classification algorithm, etc.; and selects the matching original annotation item according to the type of the target application algorithm. For example, when the type of the target application algorithm is a target detection algorithm, the original annotation item is annotation data including annotation attribute data such as a bounding box and a tag.
[0047] In order to be closer to the actual scene picture and to improve the effect of scene simulation, after adding the original annotation item on the display screen of the canvas tool, the embodiment of the present invention can also set a background frame image on the display screen, and the background frame image is a photo or a captured video frame image, which is used as the background of the original annotation item.
[0048] S2, respectively determining the business attribute data selected by each of the original marking items, adding the corresponding business attribute data to all the original marking items, and obtaining a target marking item;
[0049] Regarding step S2, the embodiment of the present invention adds the corresponding business attribute data to the original annotation item, including: after adding the original annotation item on the display screen of the canvas tool, selecting a target position on the original annotation item, and adding a target box at the target position; determining the business attributes set for the target box, and adding the business attribute data to the original annotation item to obtain the target annotation item.
[0050] In an embodiment of the present invention, the business attribute data includes but is not limited to tag, attribute, trackId, score and other data. After the business attribute data is added, the embodiment of the present invention can further add a target box according to actual application requirements. The target box is, for example, a graphic such as a boundary box or a warning line.
[0051] Specifically, see Figure 2 As shown, when the type of the target application algorithm is a target detection algorithm, the reference of the annotation data code corresponding to the target annotation item is as follows:
[0052]
[0053] When the type of the target application algorithm is other types such as an image segmentation algorithm or an image classification algorithm, the business attribute data etc. may be adjusted accordingly, and the embodiment of the present invention has no limitation on this.
[0054] S3, merging all the target annotation items to create an annotation item list;
[0055] When there are multiple target marking items, the embodiment of the present invention merges all the target marking items to create a marking item list.
[0056] S4. Publish the marked item list according to the set publishing rules, and convert the marked item list into target recognition result data to output to the designated data source.
[0057] Before publishing the annotation item list, the embodiment of the present invention sets a publishing rule for the annotation item list according to the type of the target application algorithm, and the publishing rule includes a publishing method, a designated data source, and configuration parameters.
[0058] Among them, the publishing method refers to the publishing order, publishing time interval, etc. of each target annotation item in the annotation item list; the specified data source refers to which data source the annotation item list is finally output to; and the configuration parameters are parameters such as interface data.
[0059] In an embodiment of the present invention, the data sources include a MySQL database, a Kafka message queue, and a webhook.
[0060] For example, when the data source is a MySQL database, the corresponding configuration parameters may be:
[0061] url=>jdbc:mysql: / / localhost:3306 / yourdb? useSSL=false&serverTimezone=UTC
[0062] username=>yourusername
[0063] password=>yourpassword.
[0064] For example, when the data source is a Kafka message queue, the corresponding configuration parameters may be:
[0065] bootstrap-servers=>localhost:9092
[0066] topic=>test.
[0067] For example, when the data source is a webhook message queue, the corresponding configuration parameters may be:
[0068] url=>http: / / localhost:8080 / push.
[0069] The different types of data sources specified by the configuration parameters may be adjusted accordingly.
[0070] The embodiment of the present invention publishes the annotation item list, including: in response to a request for publishing the annotation item list, calling and publishing an http request at the front end, wherein the request body in the http request includes the annotation item list and specified data of the data source; converting the received annotation item list into target recognition result data at the back end server; and outputting the target recognition result data to the specified data source according to the specified data of the data source.
[0071] The target recognition result data is the algorithm recognition result data required by the corresponding business scenario. The target recognition result data can be adaptively adjusted according to the type of the data source. For example, when the specified data source is a kafka message queue, you can first connect to the configured kafka data source and write the simulated target recognition result data to the kafka specified topic through the kafka producer interface for use.
[0072] Compared with the prior art, the canvas-based simulation algorithm data generation method described in the embodiment of the present invention adds the required business attribute data to the original annotation item to obtain the target annotation item and converts it into target recognition result data. It can flexibly meet the algorithm recognition result data requirements of various business scenarios according to the needs, facilitate business logic developers to debug and improve the efficiency of business logic function development. At the same time, it is also more convenient to provide testers with various business scenario data, which can have rich test cases and shorten the route of business logic testing. It allows the test to verify the correctness of business recognition without the need for real recognition algorithm tasks, shortens the test cycle and can more easily locate the location where the problem occurs, thereby reducing costs.
[0073] Based on the above embodiment, as the above Figure 1 The present invention provides an embodiment of a simulation algorithm data generation device based on canvas, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices, see Figure 3 As shown, the canvas-based simulation algorithm data generation device includes:
[0074] The annotation item adding module 100 is used to add at least one original annotation item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original annotation item is the annotation data after the annotation is completed;
[0075] The business attribute adding module 200 is used to respectively determine the business attribute data selected by each of the original marking items, and add the corresponding business attribute data to all the original marking items to obtain the target marking items;
[0076] The data processing module 300 is used to merge all the target annotation items to create an annotation item list;
[0077] The publishing module 400 is used to publish the marked item list according to the set publishing rules, and convert the marked item list into target recognition result data to output to the specified data source.
[0078] The canvas-based simulation algorithm data generating device described in the embodiment of the present invention can execute the canvas-based simulation algorithm data generating method provided in the above embodiment. The canvas-based simulation algorithm data generating device has the corresponding functional steps and beneficial effects of the canvas-based simulation algorithm data generating method described in the above embodiment. Please refer to the above-mentioned embodiment of the canvas-based simulation algorithm data generating method for details. The embodiment of the present invention will not be repeated here.
[0079] The embodiment of the present invention also provides an electronic device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various types of chips. The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the canvas-based simulation algorithm data generation method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the canvas-based simulation algorithm data generation method in the above method embodiment is realized.
[0080] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The one or more modules are stored in the memory, and when executed by the processor, the simulation algorithm data generation method based on canvas in the above method embodiment is executed. The specific details of the above electronic device can be understood by corresponding to the corresponding descriptions and effects in the above method embodiment, and will not be repeated here. Those skilled in the art can understand that all or part of the processes in the above embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program, when executed, may include the processes of the embodiments of the above methods. Among them, the storage medium can be a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0081] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0082] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0083] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.
Claims
1. A method for generating simulation algorithm data based on canvas, characterized in that: The canvas-based simulation algorithm data generation method includes: Adding at least one original annotation item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original annotation item is the annotation data after the annotation is completed; Determine the business attribute data selected by each of the original marking items respectively, add the corresponding business attribute data to all the original marking items, and obtain the target marking items; Merge all the target annotation items to create an annotation item list; The marked item list is published according to a set publishing rule, and the marked item list is converted into target recognition result data to be output to a designated data source.
2. The method for generating simulation algorithm data based on canvas according to claim 1, characterized in that: Adding the corresponding business attribute data to the original annotation item includes: After adding the original annotation item on the display screen of the canvas tool, selecting a target position on the original annotation item and adding a target frame at the target position; The business attribute set for the target frame is determined, and the business attribute data is added to the original marked item to obtain the target marked item.
3. The canvas-based simulation algorithm data generation method according to claim 1, characterized in that: The method comprises: setting a publishing rule of the annotation item list according to the type of the target application algorithm, wherein the publishing rule comprises a publishing mode, a designated data source and configuration parameters.
4. The method for generating simulation algorithm data based on canvas according to claim 1, characterized in that: The method publishes the marked item list, including: In response to the marking item list publishing request, calling and publishing an http request at the front end, wherein the request body in the http request includes the marking item list and the specified data of the data source; The backend server converts the received list of annotation items into target recognition result data; The target recognition result data is output to the designated data source according to the designated data of the data source.
5. The canvas-based simulation algorithm data generation method according to claim 1, characterized in that: The method further comprises: Determine the type of the target application algorithm, wherein the type of the target application algorithm includes a target detection algorithm, an image segmentation algorithm, and an image classification algorithm; The matching original annotation item is selected according to the type of the target application algorithm.
6. The method for generating simulation algorithm data based on canvas according to claim 1, characterized in that: The method further includes: after adding the original annotation item on the display screen of the canvas tool, setting a background frame image on the display screen, wherein the background frame image is a photo or a captured video frame image.
7. The method for generating simulation algorithm data based on canvas according to claim 1, characterized in that: The data sources include MySQL database, Kafka message queue and webhook.
8. A canvas-based simulation algorithm data generation device, applied to the method according to any one of claims 1 to 7, characterized in that: The canvas-based simulation algorithm data generating device comprises: A marking item adding module, used to add at least one original marking item matching the type of the target application algorithm on the display screen of the canvas tool, wherein the original marking item is the marking data after the marking is completed; A business attribute adding module, used to respectively determine the business attribute data selected by each of the original marking items, and add the corresponding business attribute data to all the original marking items to obtain a target marking item; A data processing module, used for merging all the target annotation items to create an annotation item list; The publishing module is used to publish the marked item list according to the set publishing rules, and convert the marked item list into target recognition result data to output to the specified data source.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which are loaded and executed by a processor to implement the operations performed by the method according to any one of claims 1 to 7.
10. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, the processor implements instructions of any one of the methods described in claims 1-7.
