Method for obtaining an image with a restored object, the method comprising the steps of providing a training dataset with pairs of training images, each pair comprising a first training image with a complete building and a second training image, with the same building in a ruined state providing a generative adversarial network architecture comprising a generator network and a discriminator network training the generative adversarial network with the training dataset and performing a machine learning process from the training dataset providing the generative adversarial network with a first bidimensional image comprising a building in a ruined state processing the first bidimensional image by the generative adversarial network obtaining a second bidimensional image of the same size as the first bidimensional image, the second bidimensional image comprising a restored version of the building, the restored version of the building being produced by the trained generative adversarial network which, due to the training steps, is enabled to identify elements to be added to the building and the location where these elements are added, wherein the step of training the generative adversarial network comprises that a first group of pairs of images of the training dataset are used for a direct training of the generator network, where the first training image is used as an input and the second training image is used as an output; the method being characterized in that this first group of pairs of images of the training data set are used for a segmented training of the generator network, where the first training image is used as an input together with a segmented image, comprising an identification of different architectonic elements of the first training image. providing a training dataset with pairs of training images, each pair comprising a first training image with a complete building and a second training image, with the same building in a ruined state providing a generative adversarial network architecture comprising a generator network and a discriminator network training the generative adversarial network with the training dataset and performing a machine learning process from the training dataset providing the generative adversarial network with a first bidimensional image comprising a building in a ruined state processing the first bidimensional image by the generative adversarial network obtaining a second bidimensional image of the same size as the first bidimensional image, the second bidimensional image comprising a restored version of the building, the restored version of the building being produced by the trained generative adversarial network which, due to the training steps, is enabled to identify elements to be added to the building and the location where these elements are added, wherein the step of training the generative adversarial network comprises that a first group of pairs of images of the training dataset are used for a direct training of the generator network, where the first training image is used as an input and the second training image is used as an output; the method being characterized in that this first group of pairs of images of the training data set are used for a segmented training of the generator network, where the first training image is used as an input together with a segmented image, comprising an identification of different architectonic elements of the first training image.