A method for generating an avatar, comprising: acquiring a target image, in response to an image acquisition instruction input by a user; obtaining an avatar corresponding to the target image by a first generator; wherein the first generator is obtained by training based on a first sample image set and a second sample image set generated by a three dimensional model, wherein the first sample image set comprises a first sample image containing a real face; and the second sample image set comprises a second sample image rendered from a three dimensional model, wherein before the obtaining an avatar corresponding to the target image by a first generator, the method further comprises: detecting key points of a face in the target image, and determining a bounding box containing the key points; and the obtaining an avatar corresponding to the target image by a first generator comprises: inputting the key points at the bounding box and a preset position to the first generator; generating a first image by the first generator, wherein the first image comprises a target style feature and a content feature of the target image, and the target style feature is a style feature learned by the first generator from images of the second sample image set; extracting illumination information and low-frequency information in the target image; fusing the illumination information and the low-frequency information with information in a same level as the illumination information and the low-frequency information of the first image, to obtain a second image; and determining the second image as the avatar corresponding to the target image. acquiring a target image, in response to an image acquisition instruction input by a user; obtaining an avatar corresponding to the target image by a first generator; wherein the first generator is obtained by training based on a first sample image set and a second sample image set generated by a three dimensional model, wherein the first sample image set comprises a first sample image containing a real face; and the second sample image set comprises a second sample image rendered from a three dimensional model, wherein before the obtaining an avatar corresponding to the target image by a first generator, the method further comprises: detecting key points of a face in the target image, and determining a bounding box containing the key points; and the obtaining an avatar corresponding to the target image by a first generator comprises: inputting the key points at the bounding box and a preset position to the first generator; generating a first image by the first generator, wherein the first image comprises a target style feature and a content feature of the target image, and the target style feature is a style feature learned by the first generator from images of the second sample image set; extracting illumination information and low-frequency information in the target image; fusing the illumination information and the low-frequency information with information in a same level as the illumination information and the low-frequency information of the first image, to obtain a second image; and determining the second image as the avatar corresponding to the target image. detecting key points of a face in the target image, and determining a bounding box containing the key points; and the obtaining an avatar corresponding to the target image by a first generator comprises: inputting the key points at the bounding box and a preset position to the first generator; generating a first image by the first generator, wherein the first image comprises a target style feature and a content feature of the target image, and the target style feature is a style feature learned by the first generator from images of the second sample image set; extracting illumination information and low-frequency information in the target image; fusing the illumination information and the low-frequency information with information in a same level as the illumination information and the low-frequency information of the first image, to obtain a second image; and determining the second image as the avatar corresponding to the target image. inputting the key points at the bounding box and a preset position to the first generator; generating a first image by the first generator, wherein the first image comprises a target style feature and a content feature of the target image, and the target style feature is a style feature learned by the first generator from images of the second sample image set; extracting illumination information and low-frequency information in the target image; fusing the illumination information and the low-frequency information with information in a same level as the illumination information and the low-frequency information of the first image, to obtain a second image; and determining the second image as the avatar corresponding to the target image.