Method and device for automatic part dimensioning based on key point matching
Through the neural network model based on key point matching, automatic part dimension marking is solved, and the problem of difficult to deal with special-shaped parts in the existing technology is solved, and the automation of part marking and the correctness of results is achieved.
Patent Information
- Application Number
- CN202111531700.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The existing automatic part size labeling methods mainly rely on template matching, making it difficult to deal with special-shaped parts, resulting in bloated parts and low retrieval efficiency.
Using a method based on key point matching, we use the neural network model to obtain candidate annotation points and matching annotation points pairs, automatically dimension the marking, and check the annotation results through the annotation relationship diagram.
It realizes automation of marking points selection and matching in part marking, which is suitable for automatic marking of special-shaped parts, ensuring the correctness of marking results.
Smart Images

Figure CN114239169B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure mainly relate to the field of part dimensioning, and more specifically, to a method and device for automatic part dimensioning based on key point matching. Background Art
[0002] There are a lot of functional requirements for dimensioning of part drawings in the fields of civil engineering and mechanical design. At present, the automatic dimensioning of part dimensions is mainly achieved through template matching, which compares the existing parts with the part templates in the parts library one by one (for example, the existing parts are I-sections, and the parts library has a corresponding I-section dimensioning method, which can be directly applied), determines the dimensioning method of the parts, and uses the inherent parts modeling in the parts library in some parts design software to more conveniently achieve automatic dimensioning. However, due to the increasing number of special-shaped parts, and the lack of uniform shapes of special-shaped parts, it is difficult to find the corresponding part templates in the parts library. Adding all of them to the parts library will cause the parts library to become bloated, reduce retrieval efficiency, and affect usage. Summary of the invention
[0003] Embodiments of the present disclosure provide a method, device, electronic device, and computer-readable storage medium for automatic part dimensioning based on key point matching.
[0004] In the first aspect of the present disclosure, a computer-implemented method for automatically marking part dimensions is provided. The method comprises: reading a part drawing to be marked; determining multiple key points of the part to be marked based on the part drawing to be marked; obtaining multiple candidate marking points of the part to be marked based on the multiple key points using a first neural network model; obtaining multiple matching marking point pairs of the part to be marked based on the multiple candidate marking points using a second neural network model; marking the dimensions of the related part to be marked in the part drawing to be marked based on the multiple matching marking point pairs to obtain a marked part drawing; constructing a marking relationship diagram based on the multiple matching marking point pairs and checking the marked part drawing using the marking relationship diagram to obtain a check result.
[0005] In a second aspect of the present disclosure, there is provided an automatic part dimension marking device, comprising: an input module configured to read a part drawing to be marked; a key point determination module configured to determine a plurality of key points of the part to be marked based on the part drawing to be marked; a candidate marking point acquisition module configured to obtain a plurality of candidate marking points of the part to be marked based on the plurality of key points by using a first neural network model; a matching marking point acquisition module configured to obtain a plurality of matching marking point pairs of the part to be marked based on the plurality of candidate marking points by using a second neural network model; a marking module configured to mark the dimensions of the related parts to be marked in the part drawing to be marked, and obtain a marked part drawing; and an inspection module configured to construct a marking relationship diagram based on the plurality of matching marking point pairs and to inspect the marked part drawing using the marking relationship diagram, and obtain an inspection result.
[0006] In a third aspect of the present disclosure, an electronic device is provided, comprising: a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to the first aspect.
[0007] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein one or more computer instructions are stored on the computer-readable storage medium, wherein the one or more computer instructions are executed by a processor to implement the method according to the first aspect.
[0008] In a fifth aspect of the present disclosure, a computer program product is provided, wherein the computer program product comprises one or more computer instructions, wherein the one or more computer instructions are executed by a processor to implement the method according to the first aspect.
[0009] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0011] Figure 1 A schematic diagram of an exemplary environment 100 is shown according to an embodiment of the present disclosure;
[0012] Figure 2 A flowchart of an exemplary part dimension automatic marking method 200 according to an embodiment of the present disclosure is shown;
[0013] Figure 3 A block diagram of an exemplary automatic part dimensioning apparatus 300 according to an embodiment of the present disclosure is shown;
[0014] Figure 4 An exemplary part drawing to be annotated according to an embodiment of the present disclosure is shown;
[0015] Figure 5 shows an exemplary labeled parts diagram according to an embodiment of the present disclosure; and
[0016] Figure 6 A block diagram of a computing system 600 is shown in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION
[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0018] The term "including" and its variations used in this document are open-ended, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment". The relevant definitions of other terms will be given in the following description.
[0019] The inventors noticed that the existing automatic part dimensioning mainly uses the template matching method to compare the existing parts with the part templates in the parts library one by one (for example, if the existing part is an I-section, and the parts library has a corresponding I-section dimensioning method, it can be directly applied) to determine the part dimensioning method. Although the use of inherent part modeling in the parts library in some parts design software can more conveniently achieve automatic dimensioning, due to the increasing number of special-shaped parts, and the lack of uniform shapes of special-shaped parts, it is difficult to find the corresponding part template in the parts library. Adding all of them to the parts library will cause the parts library to become bloated, reduce retrieval efficiency, and affect usage.
[0020] In order to at least partially solve some of the above problems. An embodiment of the present disclosure provides a method for automatic part dimensioning based on key point matching. In an embodiment of the present disclosure, a part drawing of a part to be marked is first obtained, and all key points in the part drawing that may be related to the marking are extracted, and the key points are the possible endpoints in the marking. Then, the key points that may be part marking points are extracted from all the key points using a corresponding neural network model to obtain a set of candidate marking points. Then, these candidate marking points are paired in pairs, and another corresponding neural network model is used to determine the marking point pairs that match the part drawing to be marked. Matching marking point pairs refers to the combination of points pointed to by the dimension boundary in the dimension marking. By matching the marking point pairs, the marked dimension line and the marking text can be derived. Finally, the marking of the entire part is completed based on the matching marking points using the existing technology. For example, in AutoCAD, linear dimensioning can be automatically performed based on matching marking point pairs, that is, the above-mentioned steps of deriving dimension lines and marking text are completed. The present disclosure can also verify the result of part marking by generating a relationship diagram of the marking points after marking.
[0021] Through the above technical solution, the method combines the deep learning model and automatically judges and matches the annotation points of the parts based on the key points of the parts, realizing the automation of the selection and matching of annotation points in part annotation, which is especially suitable for the automatic annotation of special-shaped parts. In addition, the method provides a result verification method based on the automatic generation of annotations to ensure the correctness of the results.
[0022] Figure 1 A schematic diagram of an exemplary environment 100 is shown in accordance with an embodiment of the present disclosure.
[0023] At a computing device, for example, Figure 1 The computing device 120 reads an unlabeled part drawing, for example, Figure 1 Unlabeled part drawing 110. In some embodiments, a two-dimensional part drawing having the shape of the part to be labeled can be generated based on the three-dimensional model of the part by using the existing technology in the art.
[0024] The computing device 120 first obtains key points in the part drawing, for example, in a key point acquisition module, and then uses the first neural network model to determine candidate annotation points in the key points, for example, in a candidate annotation point acquisition module. The computing device 120 then pairs the annotation points, and uses the second neural network model to determine the annotation point pairs that match the annotation to be added to the part, for example, in a matching annotation point acquisition module.
[0025] After obtaining the matching annotation points, the computing device 120 automatically completes the addition of annotations using existing technologies in the art, for example, in the annotation module, and finally generates an annotated part drawing, for example, Figure 1The annotated part drawing 130. For example, existing design and drawing software such as Autodesk can be used to automatically measure dimension numbers and add dimensions based on matching annotated point pairs, as well as to draw dimension lines and other annotation work.
[0026] After completing the annotation, the computing device 120 may check whether the annotation of the part is correct by constructing a relationship diagram of the annotation points, and generate a corresponding inspection result, for example, executed in an inspection module.
[0027] In some embodiments, computing device 120 may include, but is not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant (PDA), a media player, etc.), a multiprocessor system, consumer electronics, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, etc.
[0028] The following will describe in detail the process of automatic part labeling according to the disclosed embodiment in conjunction with the accompanying drawings. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It should be understood that the described method may include additional actions not shown and / or may omit the actions shown, and the scope of the present disclosure is not limited in this respect.
[0029] Figure 2 A flowchart of an exemplary method for automatically marking part dimensions according to an embodiment of the present disclosure is shown.
[0030] At block 202 , a part drawing to be annotated is read.
[0031] In some embodiments, a two-dimensional part drawing having the shape of the part to be annotated can be generated based on the three-dimensional model of the part by using the prior art in the art. Figure 4 A two-dimensional part drawing to be annotated is shown.
[0032] At block 204 , a plurality of key points of the part to be annotated are determined based on the part drawing to be annotated.
[0033] In some embodiments, the key points of the part to be annotated include line segment endpoints, line segment midpoints, arc endpoints, arc center points, foci of ellipses, polygons, geometric center points of circles, and intersection points of lines.
[0034] At block 206 , a plurality of candidate annotations of the part to be annotated is obtained using a first neural network model based on the plurality of key points.
[0035] In some embodiments, the first neural network model is a multi-classification model in the field of machine learning, so as to automatically classify key points, thereby obtaining candidate annotation points that match the parts to be annotated.
[0036] In some embodiments, the training process of the first neural network model includes:
[0037] Read the labeled sample part drawing. In some embodiments, a previously completed labeled part drawing can be used as the sample part drawing.
[0038] Based on the sample part drawings, multiple key points of the sample part drawings are determined. In some embodiments, key points can be extracted for each part drawing in the sample part drawing set. The key points may include line segment endpoints, line segment midpoints, arc endpoints, arc center points, foci of ellipses, polygons, geometric center points of circles, and intersection points of lines, etc.
[0039] A training data set is constructed based on multiple key points and sample part drawings. In some embodiments, the key points are classified into two categories, namely, labeled points and non-labeled points, by combining the sample part drawings to construct the training data set.
[0040] A first neural network model is constructed, and the first neural network model is trained using a training data set to obtain a trained first neural network model.
[0041] The trained first neural network model can automatically classify the key points in the input part drawing to be labeled, thereby obtaining candidate labeling points in the part drawing to be labeled.
[0042] At block 208 , a second neural network model is used to obtain a plurality of matching annotation point pairs of the part to be annotated based on the plurality of candidate annotation points.
[0043] In some embodiments, the second neural network model is a multi-classification model in the field of machine learning.
[0044] In some embodiments, the training process of the second neural network model includes:
[0045] Read the labeled sample part drawing. In some embodiments, a previously completed labeled part drawing can be used as the sample part drawing.
[0046] A plurality of annotation points in the sample part drawing are determined based on the sample part drawing.
[0047] A training data set is constructed based on multiple annotation points and sample part drawings. In some embodiments, the annotation points are first paired in pairs, and then the pairing results are compared with the existing annotation results in the sample part drawings. The consistent ones are classified as positive samples, and the inconsistent ones are classified as negative samples. Then the labels of the positive samples are set to paired, and the labels of the negative samples are set to unpaired. In some embodiments, the label categories of the data set can be further divided into: unpaired, horizontal annotation paired, vertical annotation paired, horizontal and vertical paired at the same time, etc. In some embodiments, the number of samples in the data set with different labels can be adjusted according to the ratio.
[0048] A second neural network model is constructed, and the second neural network model is trained using the training data set to obtain a trained second neural network model.
[0049] The trained second neural network model can match the paired annotation point pairs consisting of the candidate annotation points in the part drawing to be labeled with the parts to be labeled, and obtain the annotation point pairs that match the parts to be labeled, that is, the matching annotation point pairs.
[0050] At block 210 , based on a plurality of matching annotation point pairs, in the part drawing to be annotated, the dimensions of the related parts to be annotated are annotated to obtain an annotated part drawing.
[0051] After obtaining the matching annotation points, the existing technology in the field can be used to automatically add annotations, and finally generate the annotated part drawing. In some embodiments, the existing design and drawing software such as AutoCAD can be used to automatically measure the dimension numbers and add dimensions, as well as draw dimension lines and other annotation work. For example, Figure 5 The annotated parts drawing is shown.
[0052] At block 212 , a labeling relationship graph is constructed based on a plurality of matching labeling point pairs and the labeling relationship graph is used to check the labeled part drawing to obtain a check result.
[0053] First, a labeling relationship graph is constructed based on multiple matching labeling point pairs. In some embodiments, the edges of the labeling relationship graph can be generated according to the pairing results of the matching labeling points. In some embodiments, the labeling relationship graph includes a horizontal pairing relationship graph and a vertical pairing relationship graph.
[0054] Based on the generated annotation relationship diagram, the annotated part drawing can be checked to obtain the inspection result. In some embodiments, when there is a ring relationship in the annotation relationship diagram, it indicates that there is annotation redundancy, so an annotation redundancy result is generated, and the related annotations that generate the ring are pointed out to remind the user whether to delete a certain annotation.
[0055] In some embodiments, when there are isolated points in the annotation relationship graph, it indicates that there is a missing match behavior, so a missing match result is generated and the isolated points are pointed out. It is up to the user to decide whether to add additional annotations.
[0056] In some embodiments, the inferred coordinates of the matching annotation points can be generated based on the annotation relationship diagram. For example, any annotation point in the diagram is taken as the origin, and the coordinates of each annotation point are inferred according to the pairing relationship in the annotation relationship diagram (the connection relationship of the points, the annotation type (horizontal or vertical) and the dimension number, etc.), so as to find the drawing problem by comparing the inferred results with the coordinates of the actual drawing points. When the inferred coordinates are inconsistent with the actual coordinates of the already marked annotation points, the annotation dimension abnormality result is generated.
[0057] Figure 3 A block diagram of an exemplary automatic part dimensioning device according to an embodiment of the present disclosure is shown.
[0058] The input module 302 is configured to read the part drawing to be annotated.
[0059] The key point determination module 304 is configured to determine a plurality of key points of the part to be annotated based on the part drawing to be annotated.
[0060] The candidate marking point acquisition module 306 is configured to obtain multiple candidate marking points of the part to be marked based on multiple key points using the first neural network model.
[0061] The matching annotation point acquisition module 308 is configured to obtain a plurality of matching annotation point pairs of the to-be-annotated part based on the plurality of candidate annotation points using the second neural network model.
[0062] The marking module 310 is configured to mark the size of the related part to be marked for each matching marking point in the part drawing to be marked, and obtain the marked part drawing.
[0063] The inspection module 312 is configured to construct an annotation relationship diagram based on multiple matching annotation point pairs and use the annotation relationship diagram to inspect the annotated part drawing to obtain an inspection result.
[0064] In some embodiments, the candidate annotation point acquisition module further includes: a sample acquisition module, configured to read an annotated sample part drawing; a training data generation module, configured to determine multiple key points of the sample part drawing based on the sample part drawing, and construct a training data set based on the multiple key points and the sample part drawing; a training module, configured to construct a first neural network model, and train the first neural network model using the training data set to obtain a trained first neural network model, wherein the first neural network model is a multi-classification neural network model; and an inference module, configured to obtain multiple candidate annotation points of the part to be annotated using the trained first neural network model.
[0065] In some embodiments, the matching annotation point acquisition module further includes: a sample acquisition module, configured to read an annotated sample part drawing; a training data generation module, configured to obtain multiple annotation points of the sample part drawing based on the sample part drawing, and construct a training data set based on the annotation points and the sample part drawing; a training module, configured to construct a second neural network model, and train the second neural network model using the training data set to obtain a trained second neural network model, wherein the second neural network model is a multi-classification neural network model; an inference module, configured to use the trained second neural network model to determine multiple matching annotation point pairs that match the part to be annotated.
[0066] In some embodiments, the inspection module further includes: a labeling relationship graph construction module, configured to construct a labeling relationship graph based on multiple matching labeling point pairs; and an inspection result generation module, configured to check the labeled part drawing based on the labeling relationship graph to obtain an inspection result.
[0067] In some embodiments, the labeled relationship graph includes a horizontal pairing relationship graph and a vertical pairing relationship graph.
[0068] In some embodiments, the inspection module is further configured to: generate a labeling redundancy result when there is a circular relationship in the labeling relationship graph; generate a missed matching result when there are isolated points in the labeling relationship graph; and generate inferred coordinates of matching labeling points based on the labeling relationship graph, and generate a labeling dimension abnormality result when the inferred coordinates are inconsistent with the actual coordinates of the labeling points.
[0069] In some embodiments, key points include line segment endpoints, line segment midpoints, arc endpoints, arc center points, foci of ellipses, geometric center points of polygons and circles, and intersection points of lines.
[0070] In some embodiments, the data set includes an unpaired data set, a horizontally annotated paired data set, a vertically annotated paired data set, and a simultaneously horizontally and vertically paired data set.
[0071] Figure 6 600 is a schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure. For example, the electronic device 600 can be used to implement Figure 1600. As shown, the device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 to a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of the device 600 can also be stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0072] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0073] Processing unit 601 performs the methods and processes described above, such as process 200. For example, in some embodiments, process 200 can be implemented as a computer software program or computer program product, which is tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more steps in any process of process 200 described above can be performed. Alternatively, in other embodiments, CPU 601 can be configured to perform process 200 in any other suitable manner (e.g., by means of firmware).
[0074] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium on which are loaded computer-readable program instructions for executing various aspects of the present disclosure. In some embodiments, the method described in the present disclosure may be used in a steel structure detailed design software. In some embodiments, the method described in the present disclosure may be implemented in a steel structure detailed design software PKPM-DetailWorks.
[0075] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, any non-temporary storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0076] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0077] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0078] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0079] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0080] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0081] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0082] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A computer-implemented method for automatically marking part dimensions, comprising: Read the part drawing to be marked of the part to be marked; Determine a plurality of key points of the part to be labeled based on the part drawing to be labeled; Obtaining a plurality of candidate marking points of the part to be marked using a first neural network model based on the plurality of key points; Obtaining a plurality of matching annotation point pairs of the to-be-annotated part using a second neural network model based on the plurality of candidate annotation points; Based on the multiple matching annotation point pairs, in the part drawing to be annotated, the size of the part to be annotated related to each matching annotation point pair is annotated to obtain an annotated part drawing; and Constructing a labeling relationship diagram based on the multiple matching labeling point pairs and using the labeling relationship diagram to check the labeled part drawing to obtain a check result; Wherein using the annotated relationship diagram to check the annotated part drawing comprises: When a circular relationship exists in the labeled relationship graph, generating a labeled redundant result; When there are isolated points in the labeled relationship graph, generating a missing match result; and The inferred coordinates of the annotation points in the matching annotation point pair are generated based on the annotation relationship graph, and when the inferred coordinates are inconsistent with the actual coordinates of the annotation points in the matching annotation point pair, an annotation dimension abnormality result is generated.
2. The method according to claim 1, wherein obtaining a plurality of candidate annotation points of the part to be annotated by using the first neural network model comprises: Read the marked sample parts drawing; Determine a plurality of key points of the sample part drawing based on the sample part drawing; Constructing a training data set based on the plurality of key points and the sample part drawings; Constructing the first neural network model, and training the first neural network model using the training data set to obtain a trained first neural network model, wherein the first neural network model is a multi-classification neural network model; and The trained first neural network model is used to obtain a plurality of candidate marking points of the part to be marked.
3. The method according to claim 1, wherein obtaining a plurality of matching annotation point pairs of the to-be-annotated part by using the second neural network model comprises: Read the marked sample parts drawing; Determine a plurality of annotation points of the sample part drawing based on the sample part drawing; Constructing a training data set based on the multiple annotation points and the sample part drawing; Constructing the second neural network model, and training the second neural network model using the training data set to obtain a trained second neural network model, wherein the second neural network model is a multi-classification neural network model; and The trained second neural network model is used to obtain a plurality of matching annotation point pairs of the part to be annotated. The method according to claim 1 , wherein the labeled relationship diagram comprises a horizontal pairing relationship diagram and a vertical pairing relationship diagram.
5. The method according to claim 1, wherein the key points include line segment endpoints, line segment midpoints, arc endpoints, arc center points, foci of ellipses, polygons, geometric center points of circles, and intersection points of lines. 6 . The method according to claim 3 , wherein the data set comprises an unpaired data set, a horizontally annotated paired data set, a vertically annotated paired data set, and a horizontally and vertically paired data set simultaneously.
7. A device for automatically marking part dimensions, comprising: An input module is configured to read a part drawing of a part to be annotated; A key point determination module is configured to determine a plurality of key points of the part to be annotated based on the part drawing to be annotated; A candidate marking point acquisition module is configured to obtain a plurality of candidate marking points of the part to be marked based on the plurality of key points using a first neural network model; A matching annotation point acquisition module is configured to obtain a plurality of matching annotation point pairs of the to-be-annotated part by using a second neural network model based on the plurality of candidate annotation points; A marking module is configured to mark the size of the part to be marked for each matching marking point in the part drawing to be marked, so as to obtain a marked part drawing; as well as An inspection module is configured to construct an annotation relationship diagram based on the plurality of matching annotation point pairs and use the annotation relationship diagram to inspect the annotated part drawing to obtain an inspection result; The inspection module is further configured to: When a circular relationship exists in the labeled relationship graph, generating a labeled redundant result; When there are isolated points in the labeled relationship graph, generating a missing matching result; as well as The inferred coordinates of the annotation points in the matching annotation point pair are generated based on the annotation relationship graph, and when the inferred coordinates are inconsistent with the actual coordinates of the annotation points in the matching annotation point pair, an annotation dimension abnormality result is generated.
8. The device according to claim 7, wherein the candidate annotation point acquisition module further comprises: A sample acquisition module is configured to read annotated sample part drawings; A training data generation module is configured to determine a plurality of key points of the sample part drawing based on the sample part drawing, and construct a training data set based on the plurality of key points and the sample part drawing; A training module is configured to construct the first neural network model, and train the first neural network model using the training data set to obtain a trained first neural network model, wherein the first neural network model is a multi-classification neural network model; as well as The reasoning module is configured to obtain multiple candidate marking points of the part to be marked by using the trained first neural network model.
9. The device according to claim 7, wherein the matching annotation point acquisition module further comprises: A sample acquisition module is configured to read annotated sample part drawings; A training data generation module is configured to obtain a plurality of marked points of the sample part drawing based on the sample part drawing, and construct a training data set based on the plurality of marked points and the sample part drawing; A training module is configured to construct the second neural network model, and train the second neural network model using the training data set to obtain a trained second neural network model, wherein the second neural network model is a multi-classification neural network model; as well as The reasoning module is configured to use the trained second neural network model to determine a plurality of matching annotation point pairs that match the part to be annotated.
10. The apparatus according to claim 7, wherein the inspection module further comprises: a labeling relationship graph construction module, configured to construct a labeling relationship graph based on the plurality of matching labeling point pairs; as well as The inspection result generating module is configured to inspect the annotated part drawing based on the annotated relationship diagram to obtain an inspection result. The apparatus according to claim 10 , wherein the annotated relationship diagram comprises a horizontal pairing relationship diagram and a vertical pairing relationship diagram.
12. The device according to claim 7, wherein the key points include line segment endpoints, line segment midpoints, arc endpoints, arc center points, foci of ellipses, polygons, geometric center points of circles, and intersection points of lines. 13 . The apparatus according to claim 9 , wherein the data set comprises an unpaired data set, a horizontally annotated paired data set, a vertically annotated paired data set, and a horizontally and vertically paired data set simultaneously.
14. An electronic device comprising: Memory and processor; The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 6.
15. A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of claims 1 to 6.
16. A computer program product comprising one or more computer instructions, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of claims 1 to 6.