230 - Semantic Segmentation of Landcover Dataset using U-Net
HTML-код
- Опубликовано: 17 ноя 2024
- Semantic Segmentation of Landcover Dataset by loading images in batches from the drive.
Code generated in the video can be downloaded from here:
github.com/bns...
For all code:
github.com/bns...
Dataset from: landcover.ai/
Labels:
0: Unlabeled background
1: Buildings
2: Woodlands
3: Water
You can use any U-net but this code demonstrates the use of pre-trained encoder in the U-net - available as part of segmentation models library.
To install the segmentation models library: pip install -U segmentation-models
If you are running into generic_utils error when loading segmentation models library watch this video to fix it: • Python tips and tricks... .
Prepare the data first:
1. Read large images and corresponding masks, divide them into smaller patches. And write the patches as images to the local drive.
2. Save only images and masks where masks have some decent amount of labels other than 0. Using blank images with label=0 is a waste of time and may bias the model towards unlabeled pixels.
3. Divide the sorted dataset from above into train and validation datasets.
4. You have to manually move some folders and rename them appropriately if you want to use ImageDataGenerator from keras.
After training, you can use the smooth blending process to segment large images.
Thanks!
Thank you very much Jacobus, I really appreciate your contribution.
Please like the video if you like the content. If you feel extra generous, click the 'THANKS' button.
Thank you so much for this tutorial. It is amazing. While running the code I got an error saying StopIteration while working with the generator next() how can I solve this ? thank you
We should call you semantic sreeni 😀😀😀 so helpful
If you are getting the error "IndexError: index 4 is out of bounds for axis 1 with size 4" when running the train_generator part, note that if you are using the new version of the Landcover dataset, you have to change the number of classes to 5, instead of 4.
num_class = 5 and n_classes = 5
Reference to the issues in the repository.
Amazing job. It would be wonderful if you can provide us with some tutorials for segmenting images of more than 3 channels.🙏🙏🙏
Thank you so much sir, your method of teaching and explaining each and every thing in the code is highly appreciated. I'm looking forward to learn much more from you.
You are most welcome
For anyone who might still be struggling with "IndexError: index 4 is out of bounds for axis 1 with size 4"
Change the num_classes in the Original Code from 4 to 5 ----->
Original Code Snippet: train_img_gen = trainGenerator(train_img_path, train_mask_path, num_class=4)
val_img_gen = trainGenerator(val_img_path, val_mask_path, num_class=4)
New Code Snippet: train_img_gen = trainGenerator(train_img_path, train_mask_path, num_class=5)
val_img_gen = trainGenerator(val_img_path, val_mask_path, num_class=5)
thank you 🥺🥺🥺🥺🥺
Thanks Sreeni, this was super useful. I had trouble using a generator for multiclass segmentation to read images from directory.
Thank you Dr. Sreeni, for your tutorials, cannot find anything better than this online. Can I use the same frame work with Vgg or Inception as Backbone?
Yes, definitely
I have error at [44] TypeError
Traceback (most recent call last)
in ()
1 temp_img = cv2.imread("data/images/M-34-51-C-d-4-1.tif") #3 channels / spectral bands
----> 2 plt.imshow(temp_img[:,:,1]) #View each channel...
3 temp_mask = cv2.imread("data/masks/M-34-51-C-d-4-1.tif") #3 channels but all same.
4 labels, count = np.unique(temp_mask[:,:,0], return_counts=True) #Check for each channel. All chanels are identical
5 print("Labels are: ", labels, " and the counts are: ", count)
TypeError: 'NoneType' object is not subscriptable
Thank you So much! Amazing Framework for my work. I really appreciate it.
You're very welcome! Kamsahamnida, I assume means thank you :)
In this vidio, 29:00, To use resnet34 backbone, we need to preprocessing the data the way exactly same before. I wonder how to use another backbone such as efficientnet. I tried switch resnet34 to other backbone, but the images look black. Thank you.
great viedo, please told me the scientific software that i can see the black tiff image, thanks again, this is the best i have ever watched!
You can use imageJ to view and process scientific images. imagej.net/software/fiji/
Thank you sir, your deep learning series is one of the best series so far. Sir please also make a video on pavement/road crack segmentation.
Thank you so much for making these videos, they really help me a lot!
Thank you, Dr. Sreeni!
Wow, thanks for making this video. I learned a lot and everything is clearly explained.
Glad to hear it!
THANKS, I love your explanation very much.
i have label my image mask in seven layer but when check the unique value in my numpy array it shows twelve value.I am confused why it happens.
Error: ( Unexpected result of `train_function` (Empty logs). Please use `Model.compile(..., run_eagerly=True)`, or `tf.config.run_functions_eagerly(True)` for more information of where went wrong, or file a issue/bug to `tf.keras`) How do we solve this?
Thank you so much!
Sir, can you help to solve the issue: IndexError: index 255 is out of bounds for axis 1 with size 2 ?
My masks consist of 2 classes only.
when i train inceptionv3unet model on landcover dataset i am geeting very low mean IOU
if the dataset only contains images in .tif but no mask for those corresponding images then how can we deal with it @DigitalSreeni
please help me out in this..!
Did you got an answer on that topic? I had the same question :/
@@kyosuke.t120 did you get it
UnidentifiedImageError: cannot identify image file I am getting this for my while using train generator for tif files after code x, y = next(train_img_gen).
I don't have a GPU on my laptop so I am using kaggle and google colab but the training takes a long time to finish in addition to, there is no enough memory therfore it leads to restart the session. What should I have to do?
I have different image sizes in my dataset, 1024 , 1000, 900 and 650. I want to divide them into 512 patches, if I used your method lots of the info will be lost. how to patchily them with minimum overlap and without loosing much of the info, any idea ? and thank you for these videos !!
Thanks sir. If you don't mind using pytorch backend I would say check monai . Btw the concepts in your video is crystal clear.
Thanks for the suggestion. Unfortunately, monai uses pytorch as you noted.
I am getting this error when i run prediction on large satellite image
Invalid shape (4697, 4127, 5) for image data
Thanks for the video it is very helpful, I followed your plan but I divided the images into 512 patches and everything went well but when I trained the model only train for 2 epoches and then gets atributeerror : 'minmaxscaler' object has no attribute 'min _'
Please help me solve this problem
labels:
0: Unlabeled background
1: Buildings
2: Woodlands
3: Water
n_classes=4
is it possible only to segment buildings and background? (classes=2),
Your video is really useful.
Besides, while running, I met the error "TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type float64 of argument 'x'.". How can I solve this?
did you get solution
hi Sreeni. thank you for the amazing video. I just need a small help. I'm still struggling with the fix you mentioned at the end of the video. I'm still getting the error "ValueError: cannot reshape array of size 1793064960 into shape (76,72,256,256,4)". I request you to please explain it more deliberately.
Hi, there. I am thankful to you for making such an informative videos. In your videos you always have 01 ground truth image against 01 image file. I am working on "Brain Tumor Segmentation" problem whereby we have 01 ground truth file against 04 images. I have two question
1. 01 image-01 ground truth case). Normally we specify 1 folder having set of image and 1 folder with set of ground truth files, how does network knows how to pick ground truth corresponding to an image?? I mean it can wrongly pick ground truth of some other image.
2. 04 images-01 ground truth case) Can you please make a video and explain (with code) how can i make neural network pick 04 images and its relevant ground truth for their respective folders. Again I fear that if the model pick wrong ground truth, it can produce wrong results.
Thanks
Please wait a couple more days for my video on segmenting Brats data set.
hai sir, i really happy on founding your video, but can i ask, what is the process need to be done if the dataset did not have the "mask" image/file? or do you have any video on how to do it? hopefully you can aswer my question. have a nice day sir :)
Did you got an answer on that topic? I had the same question :/
I am getting import error:dll load failed while importing cv2
Hi! Thank you so much for the video!! I am trying to use this code using my own data, but the model only predicts "black images". Does anyone know why? I would highly appreciate any comment.
Hello Sir @DigitalSreeni, I was trying to download the dataset from the mentioned source, however i was not able. I think they have removed the download link. Is it possible to for you to avail that data for us somehow?
That would be a great help.
Thank you!
I got this error when verifying the generator in training landcover keras augmentation
categorical[np.arange(n), y] = 1
IndexError: index 4 is out of bounds for axis 1 with size 4
could you explain this? How do you think I could solve this error? I am not good enough in Python but I need to understand, thank you.
Thanks for the amazing videos. I have a specific question: How could I deal with an image of a single area but with 15 bands (layers)? In this case, the mask would be only one. My problem is patching them and then reading them for training.
An image with 15 bands is similar to an RGB image that has 3 bands (channels) - except in your case you will have 15 channels. You can patch them the same way you patch RGB images, except (again) you will define 15 channels instead of 3.
@@DigitalSreeni But the U-net structure only accepts 3 channels, right?
Hi! I'm currently working on a quite similar project but stuck while patching the images. Instead of having RGB tiff image, I have RGBA tiff image. When I tried using patchify i think it change the image into uint8 and messed the image and ended up not look like the original rgb representation. I wonder if there's any solution to this problem? I tried to split the image cannals to emit the alpha band but still fail up to now.
Thanks!
hi, thank, you generate a name called keras_aug file,the images number reduced from 16443 to 15056, why ? i cannot find your code!
Hi, I tried recreating it in Colab but cv2.imwrite() is not saving the patched images & masks.
did you solve it?
for this line of code x, y = train_img_gen.__next__() for this file
/230_landcover_dataset_segmentation/training_landcover_keras_augmentation_V2.0.py i am getting the error TypeError: float() argument must be a string or a number, not 'TiffImageFile' please help
Thanks a lot, this is gold.
Good work!
thank you for this amazing content, sir.
hello training model on eoch take 15 hours for one epoch how can i fix it ??
I used the vanilla unet you implemented in a previous video, when I used batch size 16 a 100 epoch where run very fast with poor accuracy , I changed it to 1000 and got better result, would it get better result if I load the whole dataset and trained the model on it instead of a smaller batches ?
Thank you very much for the content. You make real problems easier and more accesible.
I am struggling with the last part of the code, the prediction for a new input. The problem is related to the cuda.
When i run the last part of the code it says:
2022 20:34:05.287381: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance‑critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022 20:34:05.838147: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 4632 MB memory: ‑> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022 20:34:42.348787: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8400
However, I followed the GPU for tensorflow installation steps on your video 217 ruclips.net/video/yLVFwAaFACk/видео.html
The check messages appears to be correct (you can read it at the end). However, it says that the tensorflow is optimised for oneDNN instead of cuDNN. The tensorflow version is 2.9.0 and the python 3.9.
I was looking for some solutions on the internet, one of them was to include the following code:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
It doesn't work.
I am new to the topic and honestly also a bit desperate. Could you please give me a hint on how to proceed or any idea of what is wrong with this?
Thanks a lot
2022-05-19 20:38:59.367245: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-05-19 20:38:59.964067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-19 20:38:59.969320: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-19 20:40:39.673713: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-19 20:40:39.674187: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-19 20:41:08.690288: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-19 20:42:34.174840: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 4632 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1
Hello, i appreciate your tuto, very helpful. Can I help me with Opensource material to annotating sentinel-2 images? Or GeoTiff...........
Hey great stuff. Every video ends on predictions, but could you do a short video on how to apply IoU scores to the predictions (images not in the test/train datasets) in a binary case to test how well the model is performing? If you've already done this, could you point me in the right direction? Thanks
Hey, I found this in one of his video don't renember which one :
#IoU for a single image
n_classes = 2
IOU_keras = MeanIoU(num_classes=n_classes)
IOU_keras.update_state(y_true, y_pred)
print("Mean IoU =", IOU_keras.result().numpy())
you can then use it in a loop to test the model performance I guess : )
I am not sure what you mean by applying IoU scores to predictions. To calculate IoU, you need ground truth and predictions. IoU is a metric that reflects the quality of our predictions. I have used IoU for binary classes, if that is your question.
I see the data used in this tutorial has been moved, the data link provided doesnt work . Can you help me with that?
Thanks for the good tutorials and one question, how can we use multiple masks? In satellite images, there are indicators that these indicators mean together, such as ndvi, tci, etc.
I am not sure what you mean by multiple masks. An image has a single ground truth so you work with single mask that contains information about a pixel. For example, a pixel or a collection of pixels correspond to a building or a tree or a road, etc. You can have multiple labels for a given pixel in which case the problem becomes multiclass multilabel semantic segmentation.
I have a question. Can you please reply to that.
We have 4 labels in masks. The unlabeled class(class 0), I have question regarding it. Do we need to remove that class 0 pixels from our training dataset because it is lowering the accuracy of the model. I am working on semantic segmentation related problem. I think my model is not predicting well due to the presence of unlabeled class (class 0). Removing/replacing that can increase the performance. What do you think. Am I going in right direction
Can I make a tutorial request regarding Google Earth Engine? As I start using satellite images in my study recently, found GEE is probabaly the way to go considering that I have limite storage and computing power with my PC. Thank you! Learnt a lot from you since I found your channel half a year ago :)
can you use patchify for 23 band images?
Strangly I get this error after training 4 epochs :
unknown: attributeerror: 'minmaxscaler' object has no attribute 'min_' traceback
@DigitalShreeni is there anyway you can help me out in this
First of all, thank you for your amazing job.
I think that in landcover_prepare_data.py line 170 "counts[0]" fetches the counts of the first value in vals. In the case of patches with no background , the first useful value in vals will be considered as background. If only one valid class is present in the patch the code will interpret as useless image.
Kind regards.
Thank you for making tough things so much easy. You are doing a great job! I want some guidance in Semantic Segmentation Case. How can I approach you?
Unfortunately, I do not have time to help out on personal projects. I wish I had that kind of time.
@@DigitalSreeni ok. No issues.
Question : Can we use this example to only detect a single class? Given the masks are modified to only work for one type of land feature (e.g water). What kind of modifications will be required?
I’ve done this. If you need help, let me know.
@@johnnysmith6876 please share the code
I want to use this model for flood mapping so can anybody tell what will be the no of classes for me in this case 1 or 2?
it often has errors!hi, thanks, i have a problem when apply your code, the error is cannot import name 'get_source_inputs' from 'keras.engine' (C:\Python39\lib\site-packages\keras\engine\__init__.py), i want to know how can i solve it?
Where ever you see keras.something in the code, change it to tensorflow.keras.something
I hope that fixes the issue.
You're amazing as always, thanks a lot for your hard efforts,
Did you share this 230- the code?, I didn't find it!
In some researches they use cutting images into tiles, Is this similar to patching?
How could we know the patch size 256, or 255, is the best without creating gap?
Is converting to categorical necessary for multi-class only, Or for both multi-class and one class for instance building footprint?
The code is available on my github page.
Cutting images to tiles is same as dividing images into patches.
You need to do the math about the right shape for your patches / tiles based on the input image. I divide my images into tiles of size divisible by 2**n (32, 64, 128, 256, 512, etc.).
Converting to categorical is necessary for multiclass if you plan on using cross entropy based loss functions that expect categorical inputs (categorical cross entropy, focal loss, etc.).
@@DigitalSreeni I really thankful to you, actually you're doing great by simplifying difficult things into very handy. Do you mean for building footprint extraction when the mask is only has one class categorical is needed? Hope you have time for building footprint extraction to be next video .
hi if you could provide the link to your weights that would be very helpful thanks
what changes should i have to make if my masks are color images and have 7 classes
Mask needs to be a single band input. Maybe convert to grayscale and check unique values and map them to your classes
How can I adapt this to binary masks? I mean what if my masks are binary?
This is the second I asked, is it possible to discuss this via email or chat Mr?
I am getting this error when i run prediction on large satellite image
Invalid shape (4697, 4127, 5) for image data can u resolve this error
I am getting the same error. Were you able to solve this?
Omg! This is too good ❤️
Thanks
Can we use Pix2pix to produces masks as doing an image to image translation and then combining the images will that do it ?? Please tell me if the approach I think is wrong !!
Pix2pix is a valid approach for semantic segmentation but not efficient compared to U-net.
thanks Sreeni. I got lot of knowledge bout semantic segmentation. But i have a question, How to implement the method with video input? do you have example code? thanks
Nothing tricky with videos. Videos are just a sequence of images, so if you manage read them into python, you can perform semantic segmentation.
@@DigitalSreeni oh okey Sir, thank you.
I didn't show the output folder while writing new images within the subdirectory. The code is executing but no output is shown in the output location. The code is:
cv2.imerite(root_directory+"256_patches/images/"+image_name+""pattch_+str(i)+str(j)+".tif", single_patch_img) The error shown:
False
Could you please let me know whats the problem?
did you solve it?
Sir I got inspired from your video and selected this as my final year project sir but , I am unable to execute it in Google colab , can you help me with the part of diving and saving it in drive .....
Use a subset of images or small images or small batches.
Hi Dr. Sreeni, I was following your image segmentation tutorials and i discovered that most of the datasets you were using already contain masks. I want to detect and segment tumors from MRI images of brain but the datasets I am using doesn't contain masks. How do I go about it? Is it compulsory to have masks available before performing segmentation?
I hope you see and answer this comment as soon as possible.
Thanks.
Please check my labeling videos, for example this one:
Labeling images for semantic segmentation using Label Studio
ruclips.net/video/UUP_omOSKuc/видео.html
@@DigitalSreeni Thank you very much sir.
Hi, sir i loved your video on semantic segmentation of landcover dataset. First of all thank u a lot for making this video. Sir i have been trying to implement the same on my system but encounter with an bug in the training section. I have tried with both the dataset version 0, as well as version 1, but getting an index error.
IndexError: index 4 is out of bounds for axis 1 with size 4
Sir it will be a great help if you could guide me how to debug it.
Thank and regard
Debarun Chakraborty
i get some error like that, so can you give the solution? thank you
Can u explain what is use of this project???
Really appreciate your work. Thank you. Please keep it coming.
I am working on a multiclass segmentation problem. In addition to the segmentation map for each of the objects, I also need a severity score of this detected object. This is like a multi task network which outputs segmentation maps and scores for each of the detected objects. If I have another smaller decoder that outputs a vector, the size of the vector would have to vary based on the number of objects detected.
I just can't find any ideas on how to architecture could be. I would grateful for any advice.
Thank you Dr. Sreeni for your tutorial. However I have a question related to the labeling. Do we need to define the label color of the classes first as shown in your previous video or not? Since in this video, you didn't define the label color
Can anyone tell me if it is normal that training for each Epoch takes approximately 2 hours?
On a CPU, yes.
@@DigitalSreeni Thanks!
Hi,this is very interesting video.However,I have try run the training_landcover_keras_augmentation_V2.0.py but this error happen. Can I know how to solve it?
Error:
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
This error has nothing to do with this python code. It appears to be your network issue, please verify.
Yes it is fue to my network issue.Still figure it out to solved the error.Thank you Dr.
i cannot install segmentation-models?
please help me with the below error Dr. .
Thank you in Advance.
Please solve my issue. (I am using python 3.10)
While i am running the image generator part of :- x, y = train_img_gen.__next__()
ValueError: Found array with 0 sample(s) (shape=(0, 3)) while a minimum of 1 is required by MinMaxScaler.
Did you Google search for the error? Here is a link you may find useful: stackoverflow.com/questions/53421626/valueerror-found-array-with-0-sample-s-shape-0-1-while-a-minimum-of-1-is
While i am running the image generator part of :- x, y = train_img_gen.__next__()
Found 16434 images belonging to 1 classes.
Found 16434 images belonging to 1 classes.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
----> 1 x, y = train_img_gen.__next__()
4 frames
/usr/local/lib/python3.7/dist-packages/keras/utils/image_utils.py in img_to_array(img, data_format, dtype)
298 # or (channel, height, width)
299 # but original PIL image has format (width, height, channel)
--> 300 x = np.asarray(img, dtype=dtype)
301 if len(x.shape) == 3:
302 if data_format == 'channels_first':
TypeError: float() argument must be a string or a number, not 'TiffImageFile'
Hey, were you able to resolve the error? I am facing the same issue.
I had the same error. Organizing the folders into subfolders as shown in first half of video helped my resolve this error. Hope this helps!
why my categories of landcover ai is 5 categories, while your categories are 4 ? i feel curiosity!
I did exactly what you say, but document doesn't creation
What dataset are you using please
where to get this mask data?
what about error index out of range
I have the same issue. I don’t know how to solve it
Thank you sir
Welcome
Thank you so much sir for this great video ,,,
Sir I got a error and I could not fix it from last few days ,
when I try to verify generator I by "x, y = train_img_gen.__next__()" by this line of code
I got this error ""*IndexError: index 4 is out of bounds for axis 1 with size 4*"
i have same error.. "
IndexError: index 100 is out of bounds for axis 1 with size 9"
Hey! I was facing the same error few days ago. print("Labels in the mask are : ", np.unique(mask_dataset)) to find the classes in your dataset. In his dataset, the total classes/labels are 4 but in ur dataset they are more
I was facing the same error, I came across that I was using Lancover Dataset Version 1 they use 5 classes including "roads" so it will work with Version 0 as it has a total of 4 classes
For anyone who still might be struggling with "IndexError: index 4 is out of bounds for axis 1 with size 4"
Change the num_classes in the Original Code from 4 to 5 ----->
Original Code Snippet: train_img_gen = trainGenerator(train_img_path, train_mask_path, num_class=4)
val_img_gen = trainGenerator(val_img_path, val_mask_path, num_class=4)
New Code Snippet: train_img_gen = trainGenerator(train_img_path, train_mask_path, num_class=5)
val_img_gen = trainGenerator(val_img_path, val_mask_path, num_class=5)
I can't access landcover.ai?
Sir, please open dataset for download
This is not my data set. I found some data on landcover when I recorded this video and for some reason that web page doesn't exist anymore. But the process I showed should work for any dataset and I am sure you can find some good ones on kaggle.
Why i can;t access landcover.ai?
Great work and awesome tutorial. I was able to replicate this on my own data no problem. However using the prediction smooth function seems to be limited to fairly small images. I tried to run it on a 4GB drone orthomosaic and it crashed due to lack of RAM. Is there a simple way to optimize that function so that it is able to handle much larger input images ?
Thank you so much
You're most welcome
@@DigitalSreeni While I run your code, the generator didn't work correctly and gave me this error message "ValueError: Found array with 0 sample(s) (shape=(0, 3)) while a minimum of 1 is required by MinMaxScaler."
What can I do to solve this?
Please make sure you are reading the data correctly, may be the path is wrong or you have a specific path but you are not working in the right directory. In any case, it looks like there are no samples (images) for minmax scaler.
@@PraySurvey Hey, were you able to resolve the error? I am facing the same issue.
sir kindly upload the code in github
It has been uploaded: github.com/bnsreenu/python_for_microscopists/tree/master/230_landcover_dataset_segmentation
Thanks for the video, my image is 6 bands can I use your code on it? as when I start testing it I go this error
imread_('data/image/image.tif'): can't read header: OpenCV(4.8.1) /io/opencv/modules/imgcodecs/src/grfmt_tiff.cpp:155: error: (-2:Unspecified error) in function 'int cv::TiffDecoder::normalizeChannelsNumber(int) const'
> Unsupported number of channels:
> 'channels >= 1 && channels
What is the usage of this......?
when i train inceptionv3unet model on landcover dataset i am geeting very low mean IOU
Thanks!
I had a question. I am training Unet on my custom dataset. I can use the data augmentation techniques as you have suggested. How much is the increase in the number of images during the training phase using augmentation? There are 7500 images in my training dataset after train_test_split.
Sata srī akāla Puranjit paaji. Tuhāḍā dhanavāda for the kind contribution.
Augmentation performs various image processing operations so that the same data can be presented in many different ways for the algorithm to generalize a bit more. It will not increase your accuracy, it will make it more generalized. In terms of by how much the data will increase, it depends on your number of steps per epoch. It keeps on generating data based on the steps per epoch. I recommend using steps per epoch as your total images divided by your batch size. For example if you batch size is 16 then steps per epoch would be 7500/15 (in your case). This presents all your 7500 images, transformed (augmented) about 468 times per epoch.
@@DigitalSreeni Sat sri akal sir,
Thank you so much for your detailed explanation on my doubt. Your videos are helping me a lot in my research work. Really appreciate that!!