| With the development of artificial intelligence technology,more and more occasions are used in industrial production to detect and locate workpiece by machine vision.At the same time,due to the promotion of big data technology and the improvement of hardware calculation,the deep neural network is gradually applied to the field of target detection,and the detection accuracy greatly exceeds the traditional method of feature extraction auxiliary classification regression.But most neural networks have higher requirements for hardware resources and the slower forward inference speed can not meet the actual needs of industrial production.Therefore,the solution of model compression and acceleration is gradually being paid attention to.It has become a hot research topic in academia and industry that the compression of the weight parameter of the model and the limitation of the definition field of the value of the parameters are accelerated.At the same time,how to make full use of the results of target detection,get the detection key points in pixel coordinate system and restore the real world 3D coordinates,so as to achieve the goal of positioning,is also one of the key issues in industrial production scene.This paper mainly studies the model compression and acceleration technology,and applies the research results to the classical single-stage neural network target detection model yolov3.At the same time,mobilenet is introduced into yolov3,which simplifies the network structure of the baseline model and greatly reduces the parameter,so that it can deploy the target detection model to the common PC or even single chip In the machine,the model volume is reduced and the speed of workpiece detection is improved.After obtaining the information of the centroid and edge points of the detection frame,the positioning information of the workpiece is calculated by using binocular vision technology.Besides,this paper also uses the lightweight Python web framework,flask,to deploy the model to provide interface services;design and implement a set of response mechanism from the terminal back end of the k210 MCU,and transmit the picture collection information of the MCU terminal to the back-end micro server for response.The main research contents of this paper include the following aspects:(1)The classical models of target detection in neural network are studied,such as yolov1 to yolov3 series.At the same time,the classical model compression and acceleration algorithms are studied based on the scene of workpiece detection.A series of experiments and application verification of compression and acceleration technology are carried out on the basis of the original detection model.Finally,the darknet-53 backbone network is replaced by mobilenet backbone network,and on the basis of the new network,the network size of the classic model is reduced by 27%,and the forward inference speed of the model is increased by nearly 32%,which can basically meet the requirements of industrial deployment.(2)The main principle of camera target location and camera calibration method are studied.This paper mainly introduces the classical camera imaging model and four kinds of basic coordinate transformation,and uses the two-step marking method of Zhang Zhengyou based on the plane template to describe the basic idea and principle of camera calibration and obtaining the internal and external parameters of the camera.With the help of opencv camera calibration algorithm library,the camera calibration experiment is carried out.Finally,the internal and external parameters after calibration are obtained.(3)A back-end server based on the flash microservice framework is built on PC,which can respond to the request of the client-side k210 MCU,and call the network structure and weight of the pre trained target detection model,calculate the forward inferred workpiece detection results and calculate the 3D coordinate information by using the key point coordinates of the pixel coordinate system of the detection results and return to the front end.Finally,the paper designs and implements a workpiece detection and positioning system by using the model compression and acceleration technology. |