Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
*.pyc
*.pth
.vscode
*.ckpt
*.onnx
*.pt
*.log
output
.idea
**__pycache__**
**.DS_Store**
**.DS_Store**
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions cfgs/lightstereo/lightstereo_s_kitti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions deploy/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__ = {
Expand All @@ -69,6 +70,7 @@
'CFNet': CFNet,
'CasGwcNet': CasGwcNet,
'CasPSMNet': CasPSMNet,
'StereoBaseGRU': StereoBaseGRU,
'LightStereo': LightStereo
}

Expand Down Expand Up @@ -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)
):
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ opencv-python
timm==0.4.12
scikit-image
thop
matplotlib
matplotlib
h5py
antialiased_cnns
kornia
onnx
4 changes: 2 additions & 2 deletions stereo/modeling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
'CasPSMNet': CasStereoTrainer,
'LightStereo': LightStereoTrainer,
'StereoBaseGRU': StereoBaseGRUTrainer,
# 'IInet': IINetTrainer,
'NMRF': NMRFTrainer
'IInet': IINetTrainer,
'NMRF': NMRFTrainer,
}


Expand Down
8 changes: 6 additions & 2 deletions tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down