Resilience, the ability to maintain fundamental functionality amidst failures and errors, is crucial for complex networked systems. Most analytical approaches rely on predefined equations for node activity dynamics and simplifying assumptions on network topology, limiting their applicability to real-world systems. Here, we propose ResInf, a deep learning framework integrating transformers and graph neural networks to infer resilience directly from observational data. ResInf learns representations of node activity dynamics and network topology without simplifying assumptions, enabling accurate resilience inference and low-dimensional visualization. Experimental results show that ResInf significantly outperforms analytical methods, with an F1-score improvement of up to 41.59% over Gao-Barzel-Barabási framework and 14.32% over spectral dimension reduction. It also generalizes to unseen topologies and dynamics and maintains robust performance despite observational disturbances. Our findings suggest that ResInf addresses an important gap in resilience inference for real-world systems, offering a fresh perspective on incorporating data-driven approaches to complex network modeling.