Metal-semiconductor junctions play an important role in the development of electronic and optoelectronic devices. A Schottky junction photodetector based on two-dimensional (2D) materials is promising for self-powered photodetection with fast response speed and large signal-to-noise ratio. However, it usually suffers from an uncontrolled Schottky barrier due to the Fermi level pinning effect arising from the interface states. In this work, all-2D Schottky junctions with near-ideal Fermi level depinning are realized, attributed to the high-quality interface between 2D semimetals and semiconductors. We further demonstrate asymmetric diodes based on multilayer graphene/MoS2/PtSe2 with a current rectification ratio exceeding 105 and an ideality factor of 1.2. Scanning photocurrent mapping shows that the photocurrent generation mechanism in the heterostructure switches from photovoltaic effect to photogating effect at varying drain biases, indicating both energy conversion and optical sensing are realized in a single device. In the photovoltaic mode, the photodetector is self-powered with a response time smaller than 100 μs under the illumination of a 405 nm laser. In the photogating mode, the photodetector exhibits a high responsivity up to 460 A/W originating from a high photogain. Finally, the photodetector is employed for single-pixel imaging, demonstrating its high-contrast photodetection ability. This work provides insight into the development of high-performance self-powered photodetectors based on 2D Schottky junctions.