We were the first ones to implement an SRGAN way back in 2020 as part of our major project where there were no explanation videos like these..... Trust me it was a rough period
Hi Sreeni, thanks for this wonderfully in depth tutorial! I've trained the GAN based on the same dataset as yours, 128x128 for HR and 32x32 for LR. Is there a way for the model to predict photos of any aspect ratios without having to re-train with new data (3 days of running)?
Thank you Thank you. I ran the code using jupyter notebook. I ran it with different image set. it worked well about 30 ecpochs. I was able to tell SR image generated from low resolution images. The issue I had was that after runing around 25 epochs. I was not able to open jupyter notebook because it generated too may logs so the file size of jupyterlab became too big. I had to disable the loggin by calling tf.keras.utils.disable_interactive_logging() function. It did not crash after that.
Hi Sreeni, I find this video very interesting. I have quite a few questions: 1) why is the generator not complied? 2) Does VGG features work for grayscale scientific image? 3) In the combined model there is binary crossentropy loss and vgg loss. Why not only VGG loss given that discriminator was already compiled with binary crossentropy?
Hey, Sreeni. I had a quick question which is slightly unrelated to this particular video but related to GANs in general. I was wondering how we decide the dimensionality of the latent space. I’d imagine there’s some trade between getting better approximations of the training data vs training time, but I’m not too sure. Thanks!!
Thank you so much it means a lot for me I have been working on it from last 7 days and tried my level best to make my own code I have created too but I failed. At last I thought let's give it try for the very last time and boom 💥 Your this video I saw and I got what I want I hope so right now it's 1 O'clock at night so I will look into it by tomorrow but thankyou so much 🙏🙏🙏
Mr.Sreeni, Iam working on medical images, to use the features that extracted from vgg model , i should train the vgg model with my medical images and those features i should extract and use it . Iam I right, because ImageNet database doesnot contain any medical images.
Hi Sir, Your video is good to understand. Will it work for satellite images? If so, can you make a video on using satellite images, like VHR satellite images, to enhance low-sentinel images?
Thanks for your videos! I've seen some of your videos in Super resolution, processing whole slide images and OpenSlide. They have been really enlightening. I've been trying SR models (like EDSR) with cv2 in python on svs images (with OpenSlide). I saw in your video 266 how to use the DeepZoomGenerator to be able to read a high resolution image (40x or 20x magnification) by tiles/batches, to then operate over the tiles. But then I don't know how to reconstruct the enhanced image to compare it to the original, since simple adding all the tiles together would be simply too huge. You explicitly mentioned in your 267 video that you weren't going to talk about that there, but did you comment on it in another video?
Mr.Sreeni, Iam working on medical images, to use the features that extracted from vgg model in SRGAN training which you explained in the vedio, should I train the vgg model with my medical images(as ImageNet database doesnot contain any medical images) and then those features should I extract and use it .Pls reply sir
Is it possible to simply use a pretrained model and apply it to new individual images instead? Not sure why I should redo training with these thousands of images when I can save time by using a pretrained model.
If pretrained model works for you then no need to train it again. You need to train a model using your own data in case the pretrained model is not available or does not work well.
i am getting a error in line numble 283; g_loss, _, _ = gan_model.train_on_batch([lr_imgs, hr_imgs], [real_label, image_features]) TypeError: iteration over a 0-d array
How to predict any resolution image that bigger than 32x32? Decreasing to 32x32 and predicting isn't useful. And how to resume training with saved .h5 file?
I want to apply srgan method to my custom dataset in colab. I tried using your method but ram crashed everytime and I am not able to get a workable model. Can you please help regarding this matter please?
Hi Sreeni, Currently I am working on your code. So I have the same structure All images were resized to 128x128 to represent HR and 32x32 to represent LR but for the tomographic data. I don't think it's a problem. I replaced my data with yours and did the same thing. When I am going to run the code, got a ValueError ValueError: Input 0 of layer "functional_115" is incompatible with the layer: expected shape=(None, 128, 128, 3), found shape=(None, 64, 64, 3) Error in the line: gen_features = vgg(gen_img) Inside the function: def create_comb(gen_model, disc_model, vgg, lr_ip, hr_ip) Can you help me? It will be very helpful Thanks in advance
Hi Sreeni, I've studied your code and noticed a possible problem. The paper you referenced takes BGR images as training and testing data. Hence, the CNN network may be optimised for BGR data? In your code, you converted BGR to RGB.
It doesn't matter if the order is BGR or RGB or even in some other color space altogether - as long as you train and predict on data organized the same way.
Hello sir, As always your videos are amazing, knowledgeable, and mindblowing! When I generate a single super-resolution image the output is fine, but when I try creating a loop and save the images, I am getting an error for the gen_image = gen_image = generator.predict(src_image) line. Can you please help how to generate the SR images in bulk?
Hi, if you are experimenting with gans for super resolution, try to add gaussian noise between layers of your discriminator. The results are visually better and it also maximizes the psnr in validation
I am not very familiar with cycleGAN in particular. But the idea behind adding gaussian noise inside the discriminator is that it prevents the training from collapsing. The idea is that, at the very beginning, the generator generates garbages, which the discriminator can easily identify. If such case, you loose the purpose of antagonist. @@toufiqmusah6480 In short, I believe this should work for any kind of GAN architecture
Dear Sir, I am meeting with this error : ImportError: cannot import name 'leakyReLU' from 'keras.layers' (C:\Users\BOAZ\miniconda3\lib\site-packages\keras\layers\__init__.py)
I had to change the high resolution image array name from img_array -> hr_img_array. I was getting a (-215) error, I think there was a name conflict. Once I did the name change everything worked fine
Hey, I'm a huge fan of your content I even tell my friends about you and to support and follow you. . . Anyway I've noticed that you don't have a video about network pruning and quantization it would be great if you could explain those concepts and apply it in a real world example as well.
i am getting this error in line number 162 OpenCV(4.6.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor' can any one make it clear?
Thanks!
Thank you.
We were the first ones to implement an SRGAN way back in 2020 as part of our major project where there were no explanation videos like these..... Trust me it was a rough period
Congrats.
Well done man!
Hi Sreeni, thanks for this wonderfully in depth tutorial! I've trained the GAN based on the same dataset as yours, 128x128 for HR and 32x32 for LR. Is there a way for the model to predict photos of any aspect ratios without having to re-train with new data (3 days of running)?
Thank you Thank you. I ran the code using jupyter notebook. I ran it with different image set. it worked well about 30 ecpochs. I was able to tell SR image generated from low resolution images. The issue I had was that after runing around 25 epochs. I was not able to open jupyter notebook because it generated too may logs so the file size of jupyterlab became too big. I had to disable the loggin by calling tf.keras.utils.disable_interactive_logging() function. It did not crash after that.
Hi Sreeni, I find this video very interesting. I have quite a few questions: 1) why is the generator not complied? 2) Does VGG features work for grayscale scientific image? 3) In the combined model there is binary crossentropy loss and vgg loss. Why not only VGG loss given that discriminator was already compiled with binary crossentropy?
Hey, Sreeni. I had a quick question which is slightly unrelated to this particular video but related to GANs in general. I was wondering how we decide the dimensionality of the latent space. I’d imagine there’s some trade between getting better approximations of the training data vs training time, but I’m not too sure. Thanks!!
Hi, Your videos have been really really helpful. Thank you very much for sharing these with us.
Glad you like them!
Thank you so much it means a lot for me I have been working on it from last 7 days and tried my level best to make my own code I have created too but I failed.
At last I thought let's give it try for the very last time and boom 💥
Your this video I saw and I got what I want I hope so right now it's 1 O'clock at night so I will look into it by tomorrow but thankyou so much 🙏🙏🙏
Hey, Sreeni. I don't have time or hardware to train this model. Can you send me your weights file?. Thank for your work.
Mr.Sreeni, Iam working on medical images, to use the features that extracted from vgg model , i should train the vgg model with my medical images and those features i should extract and use it . Iam I right, because ImageNet database doesnot contain any medical images.
Hello! Love your work! What book do you recomend to buy that abord deep learning?
Hi Sir, Your video is good to understand. Will it work for satellite images? If so, can you make a video on using satellite images, like VHR satellite images, to enhance low-sentinel images?
Sir, Thanks for making the concepts more understandable. It will be really helpfull if you can create tutorials based on audio files too.
Why haven't you applied the Gaussian filter followed by downsampling of HR images to obtain the LR images? This is done in the given paper
Thanks for your videos! I've seen some of your videos in Super resolution, processing whole slide images and OpenSlide. They have been really enlightening.
I've been trying SR models (like EDSR) with cv2 in python on svs images (with OpenSlide). I saw in your video 266 how to use the DeepZoomGenerator to be able to read a high resolution image (40x or 20x magnification) by tiles/batches, to then operate over the tiles. But then I don't know how to reconstruct the enhanced image to compare it to the original, since simple adding all the tiles together would be simply too huge. You explicitly mentioned in your 267 video that you weren't going to talk about that there, but did you comment on it in another video?
Mr.Sreeni, Iam working on medical images, to use the features that extracted from vgg model in SRGAN training which you explained in the vedio, should I train the vgg model with my medical images(as ImageNet database doesnot contain any medical images) and then those features should I extract and use it .Pls reply sir
Impressive work! Thanks.
Is it possible to simply use a pretrained model and apply it to new individual images instead? Not sure why I should redo training with these thousands of images when I can save time by using a pretrained model.
If pretrained model works for you then no need to train it again. You need to train a model using your own data in case the pretrained model is not available or does not work well.
I have just one tiff image of farm fields taken using satellite. Can I use SRGAN to enhance the image resolution using that one single image.
Hey Sreeni, Please also make a video for ESRGAN in Keras
how to evaluate the generator model inside training loop. can I model.compile (first model/generator) and do model.evaluate?
Thank you, it's very helpful. can you tell what changes should i do to enlarge 128X128 image to 256 X 256?
i am getting a error in line numble 283;
g_loss, _, _ = gan_model.train_on_batch([lr_imgs, hr_imgs], [real_label, image_features])
TypeError: iteration over a 0-d array
How to display the output mage in OpenCV and save it. Whenever I tried to save it, I am getting just blank dark image. How to do that
How to predict any resolution image that bigger than 32x32? Decreasing to 32x32 and predicting isn't useful. And how to resume training with saved .h5 file?
You need to train the model on images at your desired resolution, unfortunately.
I want to apply srgan method to my custom dataset in colab. I tried using your method but ram crashed everytime and I am not able to get a workable model. Can you please help regarding this matter please?
Hi Sreeni, Currently I am working on your code. So I have the same structure All images were resized to 128x128 to represent HR and 32x32 to represent LR but for the tomographic data.
I don't think it's a problem. I replaced my data with yours and did the same thing.
When I am going to run the code, got a ValueError
ValueError: Input 0 of layer "functional_115" is incompatible with the layer: expected shape=(None, 128, 128, 3), found shape=(None, 64, 64, 3)
Error in the line: gen_features = vgg(gen_img)
Inside the function: def create_comb(gen_model, disc_model, vgg, lr_ip, hr_ip)
Can you help me? It will be very helpful
Thanks in advance
Hi Sreeni, what are your thoughts on ConvNext paper, and do you see any application to u-net
I have loaded the database but when I run the code it does not recognize it. Should I put it in the same path as the Python program?
Thank you
Thank you so much sir. Really REALLY grateful. Possible to run us through the SOTA in image super-resolution (EDVR)? Thanks again.
Hi Sreeni, I've studied your code and noticed a possible problem. The paper you referenced takes BGR images as training and testing data. Hence, the CNN network may be optimised for BGR data? In your code, you converted BGR to RGB.
It doesn't matter if the order is BGR or RGB or even in some other color space altogether - as long as you train and predict on data organized the same way.
@DigitalSreeni can you guide please how can we use hr images of size 512 x 512.
Thankyou.
Thank you so much for the video, can you please do person re-Id in the future?
Hello sir,
As always your videos are amazing, knowledgeable, and mindblowing!
When I generate a single super-resolution image the output is fine, but when I try creating a loop and save the images, I am getting an error for the gen_image = gen_image = generator.predict(src_image) line. Can you please help how to generate the SR images in bulk?
Hi, if you are experimenting with gans for super resolution, try to add gaussian noise between layers of your discriminator. The results are visually better and it also maximizes the psnr in validation
Great recommendation.
Do you by any input on the cycleGAN implementation? Will gaussian noise have any kind of effect in that regard?
I am not very familiar with cycleGAN in particular. But the idea behind adding gaussian noise inside the discriminator is that it prevents the training from collapsing. The idea is that, at the very beginning, the generator generates garbages, which the discriminator can easily identify. If such case, you loose the purpose of antagonist.
@@toufiqmusah6480
In short, I believe this should work for any kind of GAN architecture
When i try with epoch 20 when it reach epoch 5 it shows buffer error
Sir, can you make a video how we can process the LIDC-IDRI Lung cancer dataset.
please what size of ram hae you for training this model ?
Dear Sir, I am meeting with this error : ImportError: cannot import name 'leakyReLU' from 'keras.layers' (C:\Users\BOAZ\miniconda3\lib\site-packages\keras\layers\__init__.py)
can anyone provide the code link,the link given in the description has 100 of files,i cant understand it
Why in the comb model do you give hr_ip ?
I had to change the high resolution image array name from img_array -> hr_img_array. I was getting a (-215) error, I think there was a name conflict. Once I did the name change everything worked fine
Hi Thank you for the video it was so good ,Can we use GAN for anomaly detection in images?
I recently did some anomaly detection videos, please check them out. GANs may be used for that purpose but I haven't tried them myself.
can you share weights file generated by you
Great stuff!
what is the tensorflow version ??
Thanks❤🌺🌸
You're welcome 😊
Hey, I'm a huge fan of your content I even tell my friends about you and to support and follow you. . . Anyway I've noticed that you don't have a video about network pruning and quantization it would be great if you could explain those concepts and apply it in a real world example as well.
Added to my list. Thanks for the suggestion and of course thanks for telling your friends about my channel :)
Teşekkür ederim. Türkçe altyazılı olsaydı çok iyi olurdu
Haha now I can say enhance and it actually will work
You were wearing a very controversial t-shirt
i am getting this error in line number 162
OpenCV(4.6.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
can any one make it clear?
Looks like you are pointing to an empty array - make sure you are properly reading your images.