Time-domain astronomy has emerged as a vibrant research field in recent years, focusing on celestial objects that exhibit variable magnitudes or positions. Given the urgency of conducting follow-up observations for such objects, the development of an algorithm capable of detecting them and determining their magnitudes and positions has become imperative. Leveraging the advancements in deep neural networks, we present PNet, an end-to-end framework designed not only to detect celestial objects and extract their magnitudes and positions, but also to estimate the photometric uncertainty. PNet comprises two essential steps. First, it detects stars and retrieves their positions, magnitudes, and calibrated magnitudes. Subsequently, in the second phase, PNet estimates the uncertainty associated with the photometry results, serving as a valuable reference for the light-curve classification algorithm. Our algorithm has been tested using both simulated and real observation data, demonstrating the ability of PNet to deliver consistent and reliable outcomes. Integration of PNet into data-processing pipelines for time-domain astronomy holds significant potential for enhancing response speed and improving the detection capabilities for celestial objects with variable positions and magnitudes.