From 4a100533dddfce725462ba42f4e714196822ea2f Mon Sep 17 00:00:00 2001 From: lihyin Date: Mon, 25 Nov 2024 11:14:48 -0800 Subject: [PATCH 1/5] bug fix --- .gitignore | 3 +++ deploy/export.py | 2 +- requirements.txt | 5 ++++- stereo/modeling/__init__.py | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..93580b1c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +*.pth +.vscode \ No newline at end of file diff --git a/deploy/export.py b/deploy/export.py index cb4dbe9a..a764c312 100644 --- a/deploy/export.py +++ b/deploy/export.py @@ -38,7 +38,7 @@ # Network sys.path.append(str(ROOT.parent)) # add ROOT to PATH -from stereo.modeling import models, build_trainer +# from stereo.modeling import models, build_trainer from stereo.utils.common_utils import config_loader, create_logger, load_params_from_file from stereo.modeling.models.sttr.sttr import STTR diff --git a/requirements.txt b/requirements.txt index 89b0738f..0ef61858 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,7 @@ opencv-python timm==0.4.12 scikit-image thop -matplotlib \ No newline at end of file +matplotlib +h5py +antialiased_cnns +kornia \ No newline at end of file diff --git a/stereo/modeling/__init__.py b/stereo/modeling/__init__.py index 5b466c79..da72f48c 100644 --- a/stereo/modeling/__init__.py +++ b/stereo/modeling/__init__.py @@ -30,7 +30,7 @@ 'CasGwcNet': CasStereoTrainer, 'CasPSMNet': CasStereoTrainer, 'LightStereo': LightStereoTrainer, - 'StereoBaseGRU': StereoBaseGRUTrainer + 'StereoBaseGRU': StereoBaseGRUTrainer, 'IInet': IINetTrainer } From 23bdb8b0a097a5f7b8213347791ab47278bcb305 Mon Sep 17 00:00:00 2001 From: lihyin Date: Mon, 25 Nov 2024 14:30:44 -0800 Subject: [PATCH 2/5] bug fixes --- .gitignore | 6 +++++- deploy/export.py | 6 ++++-- requirements.txt | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 93580b1c..953cc44a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ *.pyc *.pth -.vscode \ No newline at end of file +.vscode +*.ckpt +*.onnx +*.pt +*.log \ No newline at end of file diff --git a/deploy/export.py b/deploy/export.py index a764c312..f7aa20d5 100644 --- a/deploy/export.py +++ b/deploy/export.py @@ -54,6 +54,7 @@ from stereo.modeling.models.casnet.cas_gwc import GwcNet as CasGwcNet from stereo.modeling.models.casnet.cas_psm import PSMNet as CasPSMNet from stereo.modeling.models.lightstereo.lightstereo import LightStereo as LightStereo +from stereo.modeling.models.stereobase.stereobase_gru import StereoBase as StereoBaseGRU __net__ = { @@ -69,6 +70,7 @@ 'CFNet': CFNet, 'CasGwcNet': CasGwcNet, 'CasPSMNet': CasPSMNet, + 'StereoBaseGRU': StereoBaseGRU, 'LightStereo': LightStereo } @@ -295,7 +297,7 @@ def run( int8=False, # CoreML INT8 quantization dynamic=False, # ONNX/TensorRT: dynamic axes simplify=True, # ONNX: simplify model - opset=12, # ONNX: opset version + opset=17, # ONNX: opset version verbose=False, # TensorRT: verbose log workspace=4, # TensorRT: workspace size (GB) ): @@ -403,7 +405,7 @@ def parse_opt(): parser.add_argument('--int8', action='store_true', help='CoreML INT8 quantization') parser.add_argument('--dynamic', action='store_true', help='ONNX/TensorRT: dynamic axes') parser.add_argument('--simplify', action='store_true', help='ONNX: simplify model') - parser.add_argument('--opset', type=int, default=12, help='ONNX: opset version') + parser.add_argument('--opset', type=int, default=17, help='ONNX: opset version') parser.add_argument('--verbose', action='store_true', help='TensorRT: verbose log'), parser.add_argument('--workspace', type=int, default=4, help='TensorRT: workspace size (GB)') parser.add_argument( diff --git a/requirements.txt b/requirements.txt index 0ef61858..d81a2654 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ thop matplotlib h5py antialiased_cnns -kornia \ No newline at end of file +kornia +onnx \ No newline at end of file From 7d238e464f899125d64254e669ccf9c8b540f738 Mon Sep 17 00:00:00 2001 From: lihyin Date: Thu, 5 Dec 2024 10:44:23 -0800 Subject: [PATCH 3/5] fix bugs that relates to train script --- .gitignore | 3 ++- cfgs/lightstereo/lightstereo_s_kitti.yaml | 4 ++-- tools/train.py | 8 ++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 953cc44a..7a473c18 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ *.ckpt *.onnx *.pt -*.log \ No newline at end of file +*.log +output \ No newline at end of file diff --git a/cfgs/lightstereo/lightstereo_s_kitti.yaml b/cfgs/lightstereo/lightstereo_s_kitti.yaml index f0e958ca..0fb10b02 100644 --- a/cfgs/lightstereo/lightstereo_s_kitti.yaml +++ b/cfgs/lightstereo/lightstereo_s_kitti.yaml @@ -6,7 +6,7 @@ DATA_CONFIG: EVALUATING: '', TESTING: '' } - DATA_PATH: /yourpath/KITTI12 + DATA_PATH: /home/lihang.ying/data/KITTI/KITTI_2012 RETURN_RIGHT_DISP: true - DATASET: KittiDataset @@ -15,7 +15,7 @@ DATA_CONFIG: EVALUATING: ./data/KITTI15/kitti15_val20.txt, TESTING: ./data/KITTI15/kitti15_test.txt } - DATA_PATH: /yourpath/KITTI5 + DATA_PATH: /home/lihang.ying/data/KITTI/KITTI_2015 RETURN_RIGHT_DISP: true DATA_TRANSFORM: diff --git a/tools/train.py b/tools/train.py index fa730dd8..3b36229a 100644 --- a/tools/train.py +++ b/tools/train.py @@ -47,7 +47,7 @@ def parse_config(): dataset_name = each.DATASET if dataset_name == 'KittiDataset': dataset_name = 'KittiDataset15' if 'kitti15' in each.DATA_SPLIT.EVALUATING else 'KittiDataset12' - each.DATA_PATH = DATA_PATH_DICT[dataset_name] + each.DATA_PATH = each['DATA_PATH'] args.run_mode = 'train' return args, cfgs @@ -74,7 +74,11 @@ def main(): # savedir args.output_dir = str(os.path.join(args.save_root_dir, args.exp_group_path, args.tag, args.extra_tag)) if os.path.exists(args.output_dir) and args.extra_tag != 'debug' and cfgs.MODEL.CKPT == -1: - raise Exception('There is already an exp with this name') + current_time = datetime.now() + formatted_time = current_time.strftime("%Y-%m-%d_%H%M%S") + + args.extra_tag = f'{args.extra_tag}_{formatted_time}' + # raise Exception('There is already an exp with this name') if args.dist_mode: dist.barrier() args.ckpt_dir = os.path.join(args.output_dir, 'ckpt') From 94828ef1d5919472953f502ce98a183a1c41e238 Mon Sep 17 00:00:00 2001 From: lihyin Date: Wed, 26 Feb 2025 15:48:27 -0800 Subject: [PATCH 4/5] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b1621440..62839184 100755 --- a/README.md +++ b/README.md @@ -76,4 +76,3 @@ Results and models are available in the [model zoo](docs/1.model_zoo.md). year={2024} } ``` -**Note**: This code is only used for academic purposes, people cannot use this code for anything that might be considered commercial use. From 09082eaf92fc68c5ff3ef51dafed7f1fb3e96490 Mon Sep 17 00:00:00 2001 From: lihyin Date: Wed, 26 Feb 2025 15:50:51 -0800 Subject: [PATCH 5/5] Add files via upload --- LICENSE.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..dd0a08bb --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Xianda Guo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.