-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add GDAL backend and Support LEVIR-CD Dataset #2903
Conversation
Good Job! |
I don't think |
Remote sensing images include more than tiff format files. For other files such as nc, hdf, img formats, the opencv library does not support reading and writing. GDAL library is the most comprehensive library for remote sensing field. |
I understand, but I'm not sure about the necessity of this implementation compared to adding a gdal backend to mmcv. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Zoulinx,
Thanks for your contribution, we really appreciate it!
I think we might add a document to introduce the osgeo
lib and show how to install it. Since this library is not necessary for most users, I think we should reduce the process of installing mmseg for other users, but for users interested in remote sensing image processing this documentation should be very important.
mmseg/datasets/transforms/loading.py
Outdated
@@ -2,6 +2,7 @@ | |||
import warnings | |||
from typing import Dict, Optional, Union | |||
|
|||
from osgeo import gdal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since many users may not use this library, this library should not be forced to be installed by users.
modified: mmseg/datasets/__init__.py modified: mmseg/datasets/basesegdataset.py modified: mmseg/datasets/transforms/__init__.py modified: mmseg/datasets/transforms/loading.py modified: mmseg/datasets/transforms/transforms.py
modified: docs/zh_cn/user_guides/2_dataset_prepare.md modified: tools/dataset_converters/levircd.py
docs/en/get_started.md
Outdated
@@ -195,6 +195,16 @@ Run it with | |||
docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmsegmentation/data mmsegmentation | |||
``` | |||
|
|||
## Optional Dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Optional Dependencies | |
### Optional Dependencies |
Hi, do you know about open-cd, a mmlab based change detection repo. 😄 |
Yes, I am aware of this excellent community project. I noticed that open-cd has rewritten almost all the transforms in order to implement the change detection functionality. In fact, introducing the albu library can provide a more convenient solution for handling transformations on multiple images. I suggest referring to another change detection library https://github.com/shinianzhihou/ChangeDetection from the community that utilizes albu. Furthermore, due to the diversity and complexity of remote sensing image data formats, using gdal instead of opencv as the raster driver can provide better compatibility for change detection tasks. |
) ## Motivation For support with reading multiple remote sensing image formats, please refer to https://gdal.org/drivers/raster/index.html. Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, CInt16, CInt32, CFloat32 and CFloat64 are supported for reading and writing. Support input of two images for change detection tasks, and support the LEVIR-CD dataset. ## Modification Add LoadSingleRSImageFromFile in 'mmseg/datasets/transforms/loading.py'. Load a single remote sensing image for object segmentation tasks. Add LoadMultipleRSImageFromFile in 'mmseg/datasets/transforms/loading.py'. Load two remote sensing images for change detection tasks. Add ConcatCDInput in 'mmseg/datasets/transforms/transforms.py'. Combine images that have been separately augmented for data enhancement. Add BaseCDDataset in 'mmseg/datasets/basesegdataset.py' Base class for datasets used in change detection tasks. --------- Co-authored-by: xiexinch <xiexinch@outlook.com>
Motivation
For support with reading multiple remote sensing image formats, please refer to https://gdal.org/drivers/raster/index.html.
Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, CInt16, CInt32, CFloat32 and CFloat64 are supported for reading and writing.
Support input of two images for change detection tasks, and support the LEVIR-CD dataset.
Modification
Add LoadSingleRSImageFromFile in 'mmseg/datasets/transforms/loading.py'.
Load a single remote sensing image for object segmentation tasks.
Add LoadMultipleRSImageFromFile in 'mmseg/datasets/transforms/loading.py'.
Load two remote sensing images for change detection tasks.
Add ConcatCDInput in 'mmseg/datasets/transforms/transforms.py'.
Combine images that have been separately augmented for data enhancement.
Add BaseCDDataset in 'mmseg/datasets/basesegdataset.py'
Base class for datasets used in change detection tasks.