Modern computer vision tasks are achieved by first capturing and storing large-scale images and then performing the processing electronically, the paradigm of which has the fundamentally limited speed and power efficiency with the continuous increase of the data throughput and computational complexity. We propose to build the all-optical artificial intelligent for light-speed computing, which performs advanced computer vision tasks during the imaging so that the detector can directly measure the computed results. The proposed method uses light diffraction property to build the optical neural network, where the neuron function is achieved by tuning the optical diffraction with a nonlinear threshold. Since every target scene has different frequency components, the proposed diffractive neural network is trained to perform various filtering on different frequency components and achieves different transform functions for the target scenes. We demonstrate the proposed approach can be used for high-speed detecting and segmenting visual saliency objects of the microscopic samples and macroscopic scenes as well as performing the task of object classification. The low power consumption, light-speed processing, and high-throughput capability of the proposed approach can serve as significant support for high-performance computing and will find applications in self-driving automobile, video monitoring, and intelligent microscopy, etc.