[Feature] Add GDAL backend and Support LEVIR-CD Dataset#2903
[Feature] Add GDAL backend and Support LEVIR-CD Dataset#2903xiexinch merged 13 commits intoopen-mmlab:dev-1.xfrom Zoulinx:zlx/add_gdal_backend
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. |
xiexinch
left a comment
There was a problem hiding this comment.
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
| import warnings | ||
| from typing import Dict, Optional, Union | ||
|
|
||
| from osgeo import gdal |
There was a problem hiding this comment.
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
| docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmsegmentation/data mmsegmentation | ||
| ``` | ||
|
|
||
| ## Optional Dependencies |
There was a problem hiding this comment.
| ## 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.