CN-115761707-B - Image detection model processing method, storage medium and system
Abstract
The invention provides an image detection model processing method, a storage medium and a system. The method comprises the steps of obtaining an object image, obtaining a real frame A i , obtaining an image detection model to generate a detection frame B p , obtaining a to-be-detected frame B k from the detection frame B p , obtaining a matched real frame A kx corresponding to the to-be-detected frame B k from the real frame A i , obtaining the area Sb k of the to-be-detected frame B k and the area SA kx of each matched real frame A kx corresponding to the to-be-detected frame B k , obtaining the overlapping area Sb k ∩SA kx of the to-be-detected frame B k and each matched real frame A kx , calculating the coincidence ratio bA kx of the to-be-detected frame B k and each corresponding matched real frame A kx , and calculating the coincidence ratio Judging whether the coincidence ratio bA kx larger than a first threshold exists in the to-be-judged detection frame b k or not, and if so, marking the judging result of the to-be-judged detection frame b k as correct. Wherein the storage medium, system are capable of implementing the above-described methods. By the arrangement, whether the detection frame generated by the image detection model is correct or not can be automatically judged, and accuracy of a judgment result is guaranteed.
Inventors
- BI YANHUA
- KONG LINGLEI
Assignees
- 青岛海尔电冰箱有限公司
- 海尔智家股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20220831
Claims (10)
- 1. An image detection model processing method, characterized by comprising: acquiring an article image; Acquiring a real frame A i ,i={1,2,…,n 1 },n 1 of each article in the input article image, wherein the real frame A i ,i={1,2,…,n 1 },n 1 is the number of the articles in the article image, each article corresponds to one real frame A i , and the real frame A i is a rectangular frame corresponding to the maximum outline of each article in the article image; Inputting the object image into the image detection model, and obtaining rectangular detection frames B p ,p={1,2,…,n 2 },n 2 of the object generated by the image detection model on the object image as the number of the detection frames B p ; Acquiring the number of to-be-judged detection frames B k ,k={1,2,…,n 3 },n 3 as the number of to-be-judged detection frames B k from the detection frames B p , n 3 ≤n 2 ; Obtaining the number of matching real frames a kx , x={1,2,…,n 4 },n 4 ≤n 1 ,n 4 corresponding to the to-be-judged detection frame b k as the number of matching real frames a kx corresponding to the to-be-judged detection frame b k from the real frames a i ; Acquiring a region area Sb k formed by the to-be-judged detection frame b k and a region area SA kx formed by each matched real frame A kx corresponding to the to-be-judged detection frame b k ; Acquiring the area Sb k ∩SA kx of the overlapping area of the detection frame b k to be judged and each corresponding matching real frame A kx ; Calculating a coincidence ratio bA kx of the to-be-judged detection frame b k and each corresponding matching real frame a kx , wherein the coincidence ratio bA kx = ; Judging whether the coincidence ratio bA kx larger than a first threshold exists in the detection frame b k to be judged; If yes, marking the judging result of the to-be-judged detection frame b k as correct; The "obtaining the to-be-determined detection frame B k from the rectangular detection frame B p " specifically includes: Obtaining an initial matching real frame a py , y={1,2,…,n 5 },n 5 ≤n 1 ,n 5 which at least partially overlaps with the detection frame B p from the real frames a i , which is the number of the real frames a i at least partially overlapping with the detection frame B p ; Acquiring a region area SB p formed by the detection frame B p and a region area SA py formed by each primary matching real frame A py corresponding to the detection frame B p ; Acquiring an overlapping area SB p ∩SA py of the detection frame B p and each corresponding primary matching real frame A py ; Acquiring a merging area SB p ∪SA py of the detection frame B p and each corresponding primary matching real frame A py ; Calculating the intersection ratio BA py of the detection frame B p and each corresponding primary matching real frame a py , the intersection ratio BA py = ; Judging whether the cross ratio BA py greater than a second threshold exists in the detection frame B p ; If yes, marking the judging result of the detecting frame B p as correct; if not, marking the detection frame B p as the detection frame B k to be judged.
- 2. The image detection model processing method according to claim 1, further comprising: If the determination result of the detection frame B p is correct, acquiring the best real frame ZA p corresponding to the maximum intersection ratio BA py from the primary matching real frame a py corresponding to the B p ; The "obtaining the matching real frame a kx corresponding to the to-be-determined detection frame b k from the real frame a i " includes obtaining the matching real frame a kx corresponding to the to-be-determined detection frame b k after all the obtained optimal real frames ZA p are excluded from the real frame a i .
- 3. The image detection model processing method according to claim 1, further comprising: Acquiring an article type label of the real frame A i ; acquiring an article type label of the detection frame b k to be judged; The "obtaining the matching real frame a kx corresponding to the to-be-judged detection frame b k from the real frame a i " includes obtaining the matching real frame a kx corresponding to the to-be-judged detection frame b k from the real frame a i having the same article type as the to-be-judged detection frame b k .
- 4. The image detection model processing method according to claim 1, wherein "obtaining a matching real frame a kx corresponding to the detection frame b k to be determined from the real frame a i " includes: And acquiring the matching real frame A kx corresponding to the to-be-judged detection frame b k from the real frame A i which at least partially overlaps with the to-be-judged detection frame b k .
- 5. The method of claim 1, wherein the step of sequentially obtaining the determination result of each of the to-be-determined detection frames b k from small to large according to the k value, further comprises: Obtaining the number of the coincidence ratio bA (k-m)x of which the detected frame b k-m to be judged is larger than the first threshold value, wherein m= {1, 2., and n 6 },k-n 6 is more than or equal to 1; If the number of coincidence ratios bA (k-m)x that are greater than the first threshold is 1, marking the matching real box a (k-m)x corresponding to the coincidence ratio bA (k-m)x as the best real box ZA k-m ; The "obtaining the matching real frame a kx corresponding to the to-be-determined detection frame b k from the real frame a i " includes obtaining the matching real frame a kx corresponding to the to-be-determined detection frame b k after all the obtained optimal real frames ZA k-m are excluded from the real frame a i .
- 6. The image detection model processing method as claimed in claim 5, further comprising: if the number of the coincidence ratios bA (k-m)x larger than the first threshold is larger than or equal to 2, four vertexes of the to-be-judged detection frame b k-m are obtained; Acquiring four vertexes of each matching real frame A (k-m)x corresponding to the coincidence ratio bA (k-m)x which is larger than the first threshold; Calculating the sum of the vertex distances between the to-be-judged detection frame b k-m and each matching real frame A (k-m)x , The calculation method of the vertex distance sum comprises the steps of corresponding four vertexes of the to-be-judged detection frame b k-m in the same direction to four vertexes of the matching real frame A (k-m)x one by one, obtaining the vertex distance between each vertex of the to-be-judged detection frame b k-m and the vertex of the matching real frame A (k-m)x in the corresponding direction, and adding the four vertex distances in an accumulated way to obtain the vertex distance sum; and acquiring the minimum vertex distance and the corresponding matching real frame A (k-m)x and marking as the best real frame ZA k-m .
- 7. The image detection model processing method according to claim 1, further comprising: Inputting the object images into a plurality of different image detection models M j ,j={1,2,…,n 7 respectively; Acquiring the detection frame B p and the total number sumM j of the detection frames B k to be judged, wherein the detection frames B p and the total number sumM j of the detection frames B k to be judged are correct according to the judging result corresponding to each image detection model M j ; And acquiring the image detection model M j corresponding to the maximum sumM j and marking the image detection model as the optimal image detection model.
- 8. The method of claim 1, further comprising the step of setting the first threshold to any value between 0.75 and 0.9 and the second threshold to any value between 0.5 and 0.6.
- 9. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the image detection model processing method according to any one of claims 1-8.
- 10. A system for processing an image detection model, characterized in that the system comprises a memory and a processor, the memory storing a computer program executable on the processor, the processor implementing the steps in the image detection model processing method according to any one of claims 1-8 when the computer program is executed.
Description
Image detection model processing method, storage medium and system Technical Field The present invention relates to the field of household appliances, and in particular, to a method, a storage medium, and a system for processing an image detection model for a refrigeration device. Background Along with the progress of science and technology, the requirements of users on refrigeration equipment are higher and higher, and intelligent transformation becomes a new research and development direction of the refrigeration equipment. The existing intelligent refrigeration equipment is generally provided with an image detection model, after an image of an article is acquired, detection frames which are in one-to-one correspondence with the article in the image can be generated around the article through the image detection model, and then candidate areas are formed through each detection frame to identify the article. Therefore, whether the detection frame generated by the image detection model can correctly frame the object has a very important influence on the object identification result. In the prior art, a manual judgment mode is often adopted for judging whether the generated detection frame is correct, namely, the detection frame of the object generated by the image detection model is acquired, and the operator judges that the generated detection frame is incorrect. However, this design has the disadvantages of increased labor costs and relatively low efficiency of manual decision. Disclosure of Invention The invention aims to provide an image detection model processing method, a storage medium and a system, which can automatically judge whether a detection frame generated by an image detection model is correct or not and ensure the accuracy and the reliability of a judgment result by calculating the coincidence ratio of the detection frame to be judged and each corresponding matching real frame. In order to achieve the above object, an embodiment of the present invention provides an image detection model processing method, including: acquiring an article image; Acquiring a real frame A i,i={1,2,…,n1},n1 of each article in the input article image, wherein the real frame A i,i={1,2,…,n1},n1 is the number of the articles in the article image, each article corresponds to one real frame A i, and the real frame A i is a rectangular frame corresponding to the maximum outline of each article in the article image; Inputting the object image into the image detection model, and obtaining rectangular detection frames B p,p={1,2,…,n2},n2 of the object generated by the image detection model on the object image as the number of the detection frames B p; acquiring the number of to-be-judged detection frames B k,k={1,2,…,n3},n3 as the number of to-be-judged detection frames B k from the detection frames B p, n 3≤n2; Obtaining the number of matching real frames a kx,x={1,2,…,n4},n4≤n1,n4 corresponding to the to-be-judged detection frame b k as the number of matching real frames a kx corresponding to the to-be-judged detection frame b k from the real frames a i; Acquiring a region area Sb k formed by the to-be-judged detection frame b k and a region area SA kx formed by each matched real frame A kx corresponding to the to-be-judged detection frame b k; Acquiring the area Sb k∩SAkx of the overlapping area of the detection frame b k to be judged and each corresponding matching real frame A kx; Calculating the coincidence ratio bA kx of the detection frame b k to be judged and each corresponding matching real frame A kx, wherein the coincidence ratio Judging whether the coincidence ratio bA kx larger than a first threshold exists in the detection frame b k to be judged; if yes, marking the judging result of the to-be-judged detection frame b k as correct. As a further improvement of an embodiment of the present invention, the "obtaining the to-be-determined detection frame B k from the rectangular detection frame B p" specifically includes: Obtaining an initial matching real frame a py,y={1,2,…,n5},n5≤n1,n5 which at least partially overlaps with the detection frame B p from the real frames a i, which is the number of the real frames a i at least partially overlapping with the detection frame B p; Acquiring a region area SB p formed by the detection frame B p and a region area SA py formed by each primary matching real frame A py corresponding to the detection frame B p; Acquiring an overlapping area SB p∩SApy of the detection frame B p and each corresponding primary matching real frame A py; Acquiring a merging area SB p∪SApy of the detection frame B p and each corresponding primary matching real frame A py; Calculating the cross-over ratio BA py of the detection frame B p and each corresponding primary matching real frame A py, the cross-over ratio Judging whether the cross ratio BA py greater than a second threshold exists in the detection frame B p; If yes, marking the judging result of the detecting frame B p as correct; if n