This letter analyzes the spectral and energy efficiency of an intelligent reflecting surface (IRS)-assisted the dual unmanned aerial vehicles (UAVs) in target detection with hardware support, where devices first harvest energy from a power station (PS) in the downlink (DL) and then transmit information to a data sink in the uplink (UL). However, in order to increase the spectral efficiency, most existing works on dual UAVs adopted the simplified linear energyharvesting methodology and also cannot guarantee the detection performance. To improve system property, we optimize the beamforming coefficients on the basis of improved semidefinite relaxation (SDR) to minimize the total transmit power subject to the signal-to-noise (SNR) of the receiving antenna reaches the standard. Moreover, we analyze the energy saving effect of optimized system. The simulation results show that with the increased number of elements in the IRS, the proposed method has better detection probability and higher energy efficiency.