Hello everyone,
this is part of the code for a cycleGAN model that I have implemented, and it is the part related to training
#=======================================================================================================================
# cycleGAN architecture...
Maybe I explained myself wrong. I wonder why the accuracy calculated with the Scikit-Learn metrics is not comparable with the one displayed during training.
Hello everyone,
In my implementation of a K-Fold Cross Validation, I find a difference between the accuracy calculated during each training and the average accuracy calculated through the metric functions of Scikit-Learn.
This is my code for the K-Fold Cross Validation and for the calculation...
Hi everyone,
I made an implementation of the cycleGAN model but I find a strange problem.
If I run the model with a PC supplied to the university it works, while on Colab, it saves me empty PNG files. Consider that I use a standard GPU on Colab.
This is my code to save the generated images...
Hello everyone,
I have this problem that I can't solve:
I have two types of images contained in two different folders. I have to create a dataset with these images and train a cycleGAN model, but for simplicity we assume that I want to print them on monitor and forget the cycleGAN.
My code is...
Oops! I forgot to update this post ...:-p
The problem was given by the 'Mathshow ()' function that adds additional spaces around the figure even if the axes are hidden.
I solved this way:
def img_from_nii(height, width, n_slice, label, in_path, temp_path):
filenames =...
If as Image class you mean that of Pillow, yes there is the save method, but it does not support 32-bit images and I lose quality.
By opening the image with any reader, I see the image in the correct size 256x256, but I also have two completely empty side bands.
I believe that the save method...
Hello everyone,
I have to extract a slice from a nii files and resize it with dimensions 256x256. Once this is done, I have to save it as a PNG image.
This is my code:
def img_from_nii(height, width, n_slice, label, in_path, temp_path):
filenames = os.listdir(in_path)
for i...
Hello!
For my project I need to converting some images from grayscale to RGB using Tesorflow. My code is this:
image_grayscale = tf.io.read_file('image_bw.png')
image_grayscale = tf.image.decode_png(image_grayscale, channels=1)
image_grayscale = tf.convert_to_tensor(image_grayscale[:,:,:3])...
Ok, I have the solution.
The size of the outputs of a CNN "conv" is given by the equation
$$o=\left ( \frac{i - k + 2p}{s} \right )+1$$
but, as in my case, for a transpose convolution "deconv" the size of the outputs is
$$o=s\left (i -1 \right )+ k - 2p$$
Then, with stride ##s=2##, the...
Hello everybody,
I have this problem:
starting from a vector of 100 random values, I have to generate an image of size 128x128x3 using a model consisting of a fully completely layer and 5 layer deconv.
This is my model
def generator_model(noise_dim):
n_layers = 5
k_w, k_h = [8, 8]...
I hope it can be done, but at the moment I don't know how.
Should the iterator be implemented directly in the loss function of the GAN discriminator?
def discriminator_model(strides, kernel_size, input_img, weight_initializer, downsample_layers):
rate = 0.2
filters =...