Safety helmets and work clothes and other safety equipment are of great significance for ensuring the safety of workers. In view of the complex problems of the construction site scene, this paper proposes a real-time detection algorithm for the production workshop scene based on improved YOLOv7. First, the Dyhead module is added to the Head part of the network architecture, and the multi-head self-attention mechanism is coordinatedly combined in the scale-aware feature layer, the spatial-aware spatial position and the taskaware output channel. Then, the convolution kernel in the main network is replaced with CoordCov, and the input coordinate information is added to the input feature map of the network as an additional channel to help the network learn to process spatial-related information. The experimental results show that compared with the original model, the mAP of the improved model is increased by 1.4 % , Recall is increased by nearly 1%, precision is increased by 1.43%, and the improved model can effectively improve the detection performance of workers' safety equipment in the construction site scene.