In rock engineering, it is of great significance to study the failure mechanical behavior of rocks with holes. Using a combination of experiment and infrared detection, the strength, deformation, and infrared temperature evolution behavior of marble with elliptical holes under uniaxial compression were studied. The test results showed that as the vertical axis b of the ellipse increased, the peak intensity first decreased and then increased, and the minimum value appeared when the horizontal axis was equal to the vertical axis. The detection results of the infrared thermal imager showed that the maximum temperature, minimum temperature, and average temperature of the observation area in the loading stage showed a downward trend, and the range of change was between 0.02 °C and 1 °C. It was mainly due to the accumulation of energy in the loading process of the rock sample that caused the surface temperature of the specimen to decrease. In the brittle failure stage, macroscopic cracks appeared on the surface of the rock sample, which caused the energy accumulated inside to dissipate, thereby increasing the maximum temperature and average temperature of the rock sample. The average temperature increase was about 0.05 °C to about 0.19 °C. The evolution of infrared temperature was consistent with the mechanical characteristics of rock sample failure, indicating that infrared thermal imaging technology can provide effective monitoring for the study of rock mechanics. The research in this paper provides new ideas for further research on the basic characteristics of rock failure under uniaxial compression.