In biometric authentication, the subject of distinguishing people by their gait is considered very important. However, it suffers from several challenges, including changing the angle of walking, wearing a coat, and wearing high shoes. The development of artificial intelligence, especially the subject of deep learning, has made a breakthrough in this field. In this research, a new technique was proposed that depends on the use of the conditional generative adversarial network in addition to the Resent networks in order to generate images. The new method relies on the side view angle because it generates various body characteristics. The framework can be divided into three parts: the first part is the process of extracting silhouettes, calculating the gait cycle, and then calculating gait energy images. The second part is generating images through conditional generative adversarial networks and discriminator models. The third part is the process of classifying images using recent networks. Experiments are performed on a public gait recognition dataset called the CASIA database to evaluate our framework. Results demonstrate that the proposed four-stage framework works better than cutting-edge methods, particularly in carrying-bag and wearing-coat sequences.