Initial commit
This commit is contained in:
commit
9d26680951
|
@ -0,0 +1,3 @@
|
|||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="$USER_HOME$/anaconda3" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,6 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="$USER_HOME$/anaconda3" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="$USER_HOME$/anaconda3" project-jdk-type="Python SDK" />
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Depth-Anything-V2-main.iml" filepath="$PROJECT_DIR$/.idea/Depth-Anything-V2-main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,51 @@
|
|||
# DA-2K Evaluation Benchmark
|
||||
|
||||
## Introduction
|
||||
|
||||

|
||||
|
||||
DA-2K is proposed in [Depth Anything V2](https://depth-anything-v2.github.io) to evaluate the relative depth estimation capability. It encompasses eight representative scenarios of `indoor`, `outdoor`, `non_real`, `transparent_reflective`, `adverse_style`, `aerial`, `underwater`, and `object`. It consists of 1K diverse high-quality images and 2K precise pair-wise relative depth annotations.
|
||||
|
||||
Please refer to our [paper](https://arxiv.org/abs/2406.09414) for details in constructing this benchmark.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Please first [download the benchmark](https://huggingface.co/datasets/depth-anything/DA-2K/tree/main).
|
||||
|
||||
All annotations are stored in `annotations.json`. The annotation file is a JSON object where each key is the path to an image file, and the value is a list of annotations associated with that image. Each annotation describes two points and identifies which point is closer to the camera. The structure is detailed below:
|
||||
|
||||
```
|
||||
{
|
||||
"image_path": [
|
||||
{
|
||||
"point1": [h1, w1], # (vertical position, horizontal position)
|
||||
"point2": [h2, w2], # (vertical position, horizontal position)
|
||||
"closer_point": "point1" # we always set "point1" as the closer one
|
||||
},
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
To visualize the annotations:
|
||||
```bash
|
||||
python visualize.py [--scene-type <type>]
|
||||
```
|
||||
|
||||
**Options**
|
||||
- `--scene-type <type>` (optional): Specify the scene type (`indoor`, `outdoor`, `non_real`, `transparent_reflective`, `adverse_style`, `aerial`, `underwater`, and `object`). Skip this argument or set <type> as `""` to include all scene types.
|
||||
|
||||
## Citation
|
||||
|
||||
If you find this benchmark useful, please consider citing:
|
||||
|
||||
```bibtex
|
||||
@article{depth_anything_v2,
|
||||
title={Depth Anything V2},
|
||||
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Zhao, Zhen and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
|
||||
journal={arXiv:2406.09414},
|
||||
year={2024}
|
||||
}
|
||||
```
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,201 @@
|
|||
<div align="center">
|
||||
<h1>Depth Anything V2</h1>
|
||||
|
||||
[**Lihe Yang**](https://liheyoung.github.io/)<sup>1</sup> · [**Bingyi Kang**](https://bingykang.github.io/)<sup>2†</sup> · [**Zilong Huang**](http://speedinghzl.github.io/)<sup>2</sup>
|
||||
<br>
|
||||
[**Zhen Zhao**](http://zhaozhen.me/) · [**Xiaogang Xu**](https://xiaogang00.github.io/) · [**Jiashi Feng**](https://sites.google.com/site/jshfeng/)<sup>2</sup> · [**Hengshuang Zhao**](https://hszhao.github.io/)<sup>1*</sup>
|
||||
|
||||
<sup>1</sup>HKU   <sup>2</sup>TikTok
|
||||
<br>
|
||||
†project lead *corresponding author
|
||||
|
||||
<a href="https://arxiv.org/abs/2406.09414"><img src='https://img.shields.io/badge/arXiv-Depth Anything V2-red' alt='Paper PDF'></a>
|
||||
<a href='https://depth-anything-v2.github.io'><img src='https://img.shields.io/badge/Project_Page-Depth Anything V2-green' alt='Project Page'></a>
|
||||
<a href='https://huggingface.co/spaces/depth-anything/Depth-Anything-V2'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Demo-blue'></a>
|
||||
<a href='https://huggingface.co/datasets/depth-anything/DA-2K'><img src='https://img.shields.io/badge/Benchmark-DA--2K-yellow' alt='Benchmark'></a>
|
||||
</div>
|
||||
|
||||
This work presents Depth Anything V2. It significantly outperforms [V1](https://github.com/LiheYoung/Depth-Anything) in fine-grained details and robustness. Compared with SD-based models, it enjoys faster inference speed, fewer parameters, and higher depth accuracy.
|
||||
|
||||

|
||||
|
||||
|
||||
## News
|
||||
- **2025-01-22:** [Video Depth Anything](https://videodepthanything.github.io) has been released. It generates consistent depth maps for super-long videos (e.g., over 5 minutes).
|
||||
- **2024-12-22:** [Prompt Depth Anything](https://promptda.github.io/) has been released. It supports 4K resolution metric depth estimation when low-res LiDAR is used to prompt the DA models.
|
||||
- **2024-07-06:** Depth Anything V2 is supported in [Transformers](https://github.com/huggingface/transformers/). See the [instructions](https://huggingface.co/docs/transformers/main/en/model_doc/depth_anything_v2) for convenient usage.
|
||||
- **2024-06-25:** Depth Anything is integrated into [Apple Core ML Models](https://developer.apple.com/machine-learning/models/). See the instructions ([V1](https://huggingface.co/apple/coreml-depth-anything-small), [V2](https://huggingface.co/apple/coreml-depth-anything-v2-small)) for usage.
|
||||
- **2024-06-22:** We release [smaller metric depth models](https://github.com/DepthAnything/Depth-Anything-V2/tree/main/metric_depth#pre-trained-models) based on Depth-Anything-V2-Small and Base.
|
||||
- **2024-06-20:** Our repository and project page are flagged by GitHub and removed from the public for 6 days. Sorry for the inconvenience.
|
||||
- **2024-06-14:** Paper, project page, code, models, demo, and benchmark are all released.
|
||||
|
||||
|
||||
## Pre-trained Models
|
||||
|
||||
We provide **four models** of varying scales for robust relative depth estimation:
|
||||
|
||||
| Model | Params | Checkpoint |
|
||||
|:-|-:|:-:|
|
||||
| Depth-Anything-V2-Small | 24.8M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Small/resolve/main/depth_anything_v2_vits.pth?download=true) |
|
||||
| Depth-Anything-V2-Base | 97.5M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Base/resolve/main/depth_anything_v2_vitb.pth?download=true) |
|
||||
| Depth-Anything-V2-Large | 335.3M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Large/resolve/main/depth_anything_v2_vitl.pth?download=true) |
|
||||
| Depth-Anything-V2-Giant | 1.3B | Coming soon |
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Prepraration
|
||||
|
||||
```bash
|
||||
git clone https://github.com/DepthAnything/Depth-Anything-V2
|
||||
cd Depth-Anything-V2
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Download the checkpoints listed [here](#pre-trained-models) and put them under the `checkpoints` directory.
|
||||
|
||||
### Use our models
|
||||
```python
|
||||
import cv2
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
encoder = 'vitl' # or 'vits', 'vitb', 'vitg'
|
||||
|
||||
model = DepthAnythingV2(**model_configs[encoder])
|
||||
model.load_state_dict(torch.load(f'checkpoints/depth_anything_v2_{encoder}.pth', map_location='cpu'))
|
||||
model = model.to(DEVICE).eval()
|
||||
|
||||
raw_img = cv2.imread('your/image/path')
|
||||
depth = model.infer_image(raw_img) # HxW raw depth map in numpy
|
||||
```
|
||||
|
||||
If you do not want to clone this repository, you can also load our models through [Transformers](https://github.com/huggingface/transformers/). Below is a simple code snippet. Please refer to the [official page](https://huggingface.co/docs/transformers/main/en/model_doc/depth_anything_v2) for more details.
|
||||
|
||||
- Note 1: Make sure you can connect to Hugging Face and have installed the latest Transformers.
|
||||
- Note 2: Due to the [upsampling difference](https://github.com/huggingface/transformers/pull/31522#issuecomment-2184123463) between OpenCV (we used) and Pillow (HF used), predictions may differ slightly. So you are more recommended to use our models through the way introduced above.
|
||||
```python
|
||||
from transformers import pipeline
|
||||
from PIL import Image
|
||||
|
||||
pipe = pipeline(task="depth-estimation", model="depth-anything/Depth-Anything-V2-Small-hf")
|
||||
image = Image.open('your/image/path')
|
||||
depth = pipe(image)["depth"]
|
||||
```
|
||||
|
||||
### Running script on *images*
|
||||
|
||||
```bash
|
||||
python run.py \
|
||||
--encoder <vits | vitb | vitl | vitg> \
|
||||
--img-path <path> --outdir <outdir> \
|
||||
[--input-size <size>] [--pred-only] [--grayscale]
|
||||
```
|
||||
Options:
|
||||
- `--img-path`: You can either 1) point it to an image directory storing all interested images, 2) point it to a single image, or 3) point it to a text file storing all image paths.
|
||||
- `--input-size` (optional): By default, we use input size `518` for model inference. ***You can increase the size for even more fine-grained results.***
|
||||
- `--pred-only` (optional): Only save the predicted depth map, without raw image.
|
||||
- `--grayscale` (optional): Save the grayscale depth map, without applying color palette.
|
||||
|
||||
For example:
|
||||
```bash
|
||||
python run.py --encoder vitl --img-path assets/examples --outdir depth_vis
|
||||
```
|
||||
|
||||
### Running script on *videos*
|
||||
|
||||
```bash
|
||||
python run_video.py \
|
||||
--encoder <vits | vitb | vitl | vitg> \
|
||||
--video-path assets/examples_video --outdir video_depth_vis \
|
||||
[--input-size <size>] [--pred-only] [--grayscale]
|
||||
```
|
||||
|
||||
***Our larger model has better temporal consistency on videos.***
|
||||
|
||||
### Gradio demo
|
||||
|
||||
To use our gradio demo locally:
|
||||
|
||||
```bash
|
||||
python app.py
|
||||
```
|
||||
|
||||
You can also try our [online demo](https://huggingface.co/spaces/Depth-Anything/Depth-Anything-V2).
|
||||
|
||||
***Note: Compared to V1, we have made a minor modification to the DINOv2-DPT architecture (originating from this [issue](https://github.com/LiheYoung/Depth-Anything/issues/81)).*** In V1, we *unintentionally* used features from the last four layers of DINOv2 for decoding. In V2, we use [intermediate features](https://github.com/DepthAnything/Depth-Anything-V2/blob/2cbc36a8ce2cec41d38ee51153f112e87c8e42d8/depth_anything_v2/dpt.py#L164-L169) instead. Although this modification did not improve details or accuracy, we decided to follow this common practice.
|
||||
|
||||
|
||||
## Fine-tuned to Metric Depth Estimation
|
||||
|
||||
Please refer to [metric depth estimation](./metric_depth).
|
||||
|
||||
|
||||
## DA-2K Evaluation Benchmark
|
||||
|
||||
Please refer to [DA-2K benchmark](./DA-2K.md).
|
||||
|
||||
|
||||
## Community Support
|
||||
|
||||
**We sincerely appreciate all the community support for our Depth Anything series. Thank you a lot!**
|
||||
|
||||
- Apple Core ML:
|
||||
- https://developer.apple.com/machine-learning/models
|
||||
- https://huggingface.co/apple/coreml-depth-anything-v2-small
|
||||
- https://huggingface.co/apple/coreml-depth-anything-small
|
||||
- Transformers:
|
||||
- https://huggingface.co/docs/transformers/main/en/model_doc/depth_anything_v2
|
||||
- https://huggingface.co/docs/transformers/main/en/model_doc/depth_anything
|
||||
- TensorRT:
|
||||
- https://github.com/spacewalk01/depth-anything-tensorrt
|
||||
- https://github.com/zhujiajian98/Depth-Anythingv2-TensorRT-python
|
||||
- ONNX: https://github.com/fabio-sim/Depth-Anything-ONNX
|
||||
- ComfyUI: https://github.com/kijai/ComfyUI-DepthAnythingV2
|
||||
- Transformers.js (real-time depth in web): https://huggingface.co/spaces/Xenova/webgpu-realtime-depth-estimation
|
||||
- Android:
|
||||
- https://github.com/shubham0204/Depth-Anything-Android
|
||||
- https://github.com/FeiGeChuanShu/ncnn-android-depth_anything
|
||||
|
||||
|
||||
## Acknowledgement
|
||||
|
||||
We are sincerely grateful to the awesome Hugging Face team ([@Pedro Cuenca](https://huggingface.co/pcuenq), [@Niels Rogge](https://huggingface.co/nielsr), [@Merve Noyan](https://huggingface.co/merve), [@Amy Roberts](https://huggingface.co/amyeroberts), et al.) for their huge efforts in supporting our models in Transformers and Apple Core ML.
|
||||
|
||||
We also thank the [DINOv2](https://github.com/facebookresearch/dinov2) team for contributing such impressive models to our community.
|
||||
|
||||
|
||||
## LICENSE
|
||||
|
||||
Depth-Anything-V2-Small model is under the Apache-2.0 license. Depth-Anything-V2-Base/Large/Giant models are under the CC-BY-NC-4.0 license.
|
||||
|
||||
|
||||
## Citation
|
||||
|
||||
If you find this project useful, please consider citing:
|
||||
|
||||
```bibtex
|
||||
@article{depth_anything_v2,
|
||||
title={Depth Anything V2},
|
||||
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Zhao, Zhen and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
|
||||
journal={arXiv:2406.09414},
|
||||
year={2024}
|
||||
}
|
||||
|
||||
@inproceedings{depth_anything_v1,
|
||||
title={Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data},
|
||||
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
|
||||
booktitle={CVPR},
|
||||
year={2024}
|
||||
}
|
||||
```
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,88 @@
|
|||
import glob
|
||||
import gradio as gr
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
import torch
|
||||
import tempfile
|
||||
from gradio_imageslider import ImageSlider
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
css = """
|
||||
#img-display-container {
|
||||
max-height: 100vh;
|
||||
}
|
||||
#img-display-input {
|
||||
max-height: 80vh;
|
||||
}
|
||||
#img-display-output {
|
||||
max-height: 80vh;
|
||||
}
|
||||
#download {
|
||||
height: 62px;
|
||||
}
|
||||
"""
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
encoder = 'vitl'
|
||||
model = DepthAnythingV2(**model_configs[encoder])
|
||||
state_dict = torch.load(f'checkpoints/depth_anything_v2_{encoder}.pth', map_location="cpu")
|
||||
model.load_state_dict(state_dict)
|
||||
model = model.to(DEVICE).eval()
|
||||
|
||||
title = "# Depth Anything V2"
|
||||
description = """Official demo for **Depth Anything V2**.
|
||||
Please refer to our [paper](https://arxiv.org/abs/2406.09414), [project page](https://depth-anything-v2.github.io), or [github](https://github.com/DepthAnything/Depth-Anything-V2) for more details."""
|
||||
|
||||
def predict_depth(image):
|
||||
return model.infer_image(image)
|
||||
|
||||
with gr.Blocks(css=css) as demo:
|
||||
gr.Markdown(title)
|
||||
gr.Markdown(description)
|
||||
gr.Markdown("### Depth Prediction demo")
|
||||
|
||||
with gr.Row():
|
||||
input_image = gr.Image(label="Input Image", type='numpy', elem_id='img-display-input')
|
||||
depth_image_slider = ImageSlider(label="Depth Map with Slider View", elem_id='img-display-output', position=0.5)
|
||||
submit = gr.Button(value="Compute Depth")
|
||||
gray_depth_file = gr.File(label="Grayscale depth map", elem_id="download",)
|
||||
raw_file = gr.File(label="16-bit raw output (can be considered as disparity)", elem_id="download",)
|
||||
|
||||
cmap = matplotlib.colormaps.get_cmap('Spectral_r')
|
||||
|
||||
def on_submit(image):
|
||||
original_image = image.copy()
|
||||
|
||||
h, w = image.shape[:2]
|
||||
|
||||
depth = predict_depth(image[:, :, ::-1])
|
||||
|
||||
raw_depth = Image.fromarray(depth.astype('uint16'))
|
||||
tmp_raw_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
||||
raw_depth.save(tmp_raw_depth.name)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
colored_depth = (cmap(depth)[:, :, :3] * 255).astype(np.uint8)
|
||||
|
||||
gray_depth = Image.fromarray(depth)
|
||||
tmp_gray_depth = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
||||
gray_depth.save(tmp_gray_depth.name)
|
||||
|
||||
return [(original_image, colored_depth), tmp_gray_depth.name, tmp_raw_depth.name]
|
||||
|
||||
submit.click(on_submit, inputs=[input_image], outputs=[depth_image_slider, gray_depth_file, raw_file])
|
||||
|
||||
example_files = glob.glob('assets/examples/*')
|
||||
examples = gr.Examples(examples=example_files, inputs=[input_image], outputs=[depth_image_slider, gray_depth_file, raw_file], fn=on_submit)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
demo.queue().launch()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,416 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the Apache License, Version 2.0
|
||||
# found in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/main/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/models/vision_transformer.py
|
||||
|
||||
from functools import partial
|
||||
import math
|
||||
import logging
|
||||
from typing import Sequence, Tuple, Union, Callable
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.utils.checkpoint
|
||||
from torch.nn.init import trunc_normal_
|
||||
|
||||
from .dinov2_layers import Mlp, PatchEmbed, SwiGLUFFNFused, MemEffAttention, NestedTensorBlock as Block
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
def named_apply(fn: Callable, module: nn.Module, name="", depth_first=True, include_root=False) -> nn.Module:
|
||||
if not depth_first and include_root:
|
||||
fn(module=module, name=name)
|
||||
for child_name, child_module in module.named_children():
|
||||
child_name = ".".join((name, child_name)) if name else child_name
|
||||
named_apply(fn=fn, module=child_module, name=child_name, depth_first=depth_first, include_root=True)
|
||||
if depth_first and include_root:
|
||||
fn(module=module, name=name)
|
||||
return module
|
||||
|
||||
|
||||
class BlockChunk(nn.ModuleList):
|
||||
def forward(self, x):
|
||||
for b in self:
|
||||
x = b(x)
|
||||
return x
|
||||
|
||||
|
||||
class DinoVisionTransformer(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
img_size=224,
|
||||
patch_size=16,
|
||||
in_chans=3,
|
||||
embed_dim=768,
|
||||
depth=12,
|
||||
num_heads=12,
|
||||
mlp_ratio=4.0,
|
||||
qkv_bias=True,
|
||||
ffn_bias=True,
|
||||
proj_bias=True,
|
||||
drop_path_rate=0.0,
|
||||
drop_path_uniform=False,
|
||||
init_values=None, # for layerscale: None or 0 => no layerscale
|
||||
embed_layer=PatchEmbed,
|
||||
act_layer=nn.GELU,
|
||||
block_fn=Block,
|
||||
ffn_layer="mlp",
|
||||
block_chunks=1,
|
||||
num_register_tokens=0,
|
||||
interpolate_antialias=False,
|
||||
interpolate_offset=0.1,
|
||||
):
|
||||
"""
|
||||
Args:
|
||||
img_size (int, tuple): input image size
|
||||
patch_size (int, tuple): patch size
|
||||
in_chans (int): number of input channels
|
||||
embed_dim (int): embedding dimension
|
||||
depth (int): depth of transformer
|
||||
num_heads (int): number of attention heads
|
||||
mlp_ratio (int): ratio of mlp hidden dim to embedding dim
|
||||
qkv_bias (bool): enable bias for qkv if True
|
||||
proj_bias (bool): enable bias for proj in attn if True
|
||||
ffn_bias (bool): enable bias for ffn if True
|
||||
drop_path_rate (float): stochastic depth rate
|
||||
drop_path_uniform (bool): apply uniform drop rate across blocks
|
||||
weight_init (str): weight init scheme
|
||||
init_values (float): layer-scale init values
|
||||
embed_layer (nn.Module): patch embedding layer
|
||||
act_layer (nn.Module): MLP activation layer
|
||||
block_fn (nn.Module): transformer block class
|
||||
ffn_layer (str): "mlp", "swiglu", "swiglufused" or "identity"
|
||||
block_chunks: (int) split block sequence into block_chunks units for FSDP wrap
|
||||
num_register_tokens: (int) number of extra cls tokens (so-called "registers")
|
||||
interpolate_antialias: (str) flag to apply anti-aliasing when interpolating positional embeddings
|
||||
interpolate_offset: (float) work-around offset to apply when interpolating positional embeddings
|
||||
"""
|
||||
super().__init__()
|
||||
norm_layer = partial(nn.LayerNorm, eps=1e-6)
|
||||
|
||||
self.num_features = self.embed_dim = embed_dim # num_features for consistency with other models
|
||||
self.num_tokens = 1
|
||||
self.n_blocks = depth
|
||||
self.num_heads = num_heads
|
||||
self.patch_size = patch_size
|
||||
self.num_register_tokens = num_register_tokens
|
||||
self.interpolate_antialias = interpolate_antialias
|
||||
self.interpolate_offset = interpolate_offset
|
||||
|
||||
self.patch_embed = embed_layer(img_size=img_size, patch_size=patch_size, in_chans=in_chans, embed_dim=embed_dim)
|
||||
num_patches = self.patch_embed.num_patches
|
||||
|
||||
self.cls_token = nn.Parameter(torch.zeros(1, 1, embed_dim))
|
||||
self.pos_embed = nn.Parameter(torch.zeros(1, num_patches + self.num_tokens, embed_dim))
|
||||
assert num_register_tokens >= 0
|
||||
self.register_tokens = (
|
||||
nn.Parameter(torch.zeros(1, num_register_tokens, embed_dim)) if num_register_tokens else None
|
||||
)
|
||||
|
||||
if drop_path_uniform is True:
|
||||
dpr = [drop_path_rate] * depth
|
||||
else:
|
||||
dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth)] # stochastic depth decay rule
|
||||
|
||||
if ffn_layer == "mlp":
|
||||
logger.info("using MLP layer as FFN")
|
||||
ffn_layer = Mlp
|
||||
elif ffn_layer == "swiglufused" or ffn_layer == "swiglu":
|
||||
logger.info("using SwiGLU layer as FFN")
|
||||
ffn_layer = SwiGLUFFNFused
|
||||
elif ffn_layer == "identity":
|
||||
logger.info("using Identity layer as FFN")
|
||||
|
||||
def f(*args, **kwargs):
|
||||
return nn.Identity()
|
||||
|
||||
ffn_layer = f
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
blocks_list = [
|
||||
block_fn(
|
||||
dim=embed_dim,
|
||||
num_heads=num_heads,
|
||||
mlp_ratio=mlp_ratio,
|
||||
qkv_bias=qkv_bias,
|
||||
proj_bias=proj_bias,
|
||||
ffn_bias=ffn_bias,
|
||||
drop_path=dpr[i],
|
||||
norm_layer=norm_layer,
|
||||
act_layer=act_layer,
|
||||
ffn_layer=ffn_layer,
|
||||
init_values=init_values,
|
||||
)
|
||||
for i in range(depth)
|
||||
]
|
||||
if block_chunks > 0:
|
||||
self.chunked_blocks = True
|
||||
chunked_blocks = []
|
||||
chunksize = depth // block_chunks
|
||||
for i in range(0, depth, chunksize):
|
||||
# this is to keep the block index consistent if we chunk the block list
|
||||
chunked_blocks.append([nn.Identity()] * i + blocks_list[i : i + chunksize])
|
||||
self.blocks = nn.ModuleList([BlockChunk(p) for p in chunked_blocks])
|
||||
else:
|
||||
self.chunked_blocks = False
|
||||
self.blocks = nn.ModuleList(blocks_list)
|
||||
|
||||
self.norm = norm_layer(embed_dim)
|
||||
self.head = nn.Identity()
|
||||
|
||||
self.mask_token = nn.Parameter(torch.zeros(1, embed_dim))
|
||||
|
||||
self.init_weights()
|
||||
|
||||
def init_weights(self):
|
||||
trunc_normal_(self.pos_embed, std=0.02)
|
||||
nn.init.normal_(self.cls_token, std=1e-6)
|
||||
if self.register_tokens is not None:
|
||||
nn.init.normal_(self.register_tokens, std=1e-6)
|
||||
named_apply(init_weights_vit_timm, self)
|
||||
|
||||
def interpolate_pos_encoding(self, x, w, h):
|
||||
previous_dtype = x.dtype
|
||||
npatch = x.shape[1] - 1
|
||||
N = self.pos_embed.shape[1] - 1
|
||||
if npatch == N and w == h:
|
||||
return self.pos_embed
|
||||
pos_embed = self.pos_embed.float()
|
||||
class_pos_embed = pos_embed[:, 0]
|
||||
patch_pos_embed = pos_embed[:, 1:]
|
||||
dim = x.shape[-1]
|
||||
w0 = w // self.patch_size
|
||||
h0 = h // self.patch_size
|
||||
# we add a small number to avoid floating point error in the interpolation
|
||||
# see discussion at https://github.com/facebookresearch/dino/issues/8
|
||||
# DINOv2 with register modify the interpolate_offset from 0.1 to 0.0
|
||||
w0, h0 = w0 + self.interpolate_offset, h0 + self.interpolate_offset
|
||||
# w0, h0 = w0 + 0.1, h0 + 0.1
|
||||
|
||||
sqrt_N = math.sqrt(N)
|
||||
sx, sy = float(w0) / sqrt_N, float(h0) / sqrt_N
|
||||
patch_pos_embed = nn.functional.interpolate(
|
||||
patch_pos_embed.reshape(1, int(sqrt_N), int(sqrt_N), dim).permute(0, 3, 1, 2),
|
||||
scale_factor=(sx, sy),
|
||||
# (int(w0), int(h0)), # to solve the upsampling shape issue
|
||||
mode="bicubic"
|
||||
)
|
||||
# antialias=self.interpolate_antialias
|
||||
# )
|
||||
|
||||
assert int(w0) == patch_pos_embed.shape[-2]
|
||||
assert int(h0) == patch_pos_embed.shape[-1]
|
||||
patch_pos_embed = patch_pos_embed.permute(0, 2, 3, 1).view(1, -1, dim)
|
||||
return torch.cat((class_pos_embed.unsqueeze(0), patch_pos_embed), dim=1).to(previous_dtype)
|
||||
|
||||
def prepare_tokens_with_masks(self, x, masks=None):
|
||||
B, nc, w, h = x.shape
|
||||
x = self.patch_embed(x)
|
||||
if masks is not None:
|
||||
x = torch.where(masks.unsqueeze(-1), self.mask_token.to(x.dtype).unsqueeze(0), x)
|
||||
|
||||
x = torch.cat((self.cls_token.expand(x.shape[0], -1, -1), x), dim=1)
|
||||
x = x + self.interpolate_pos_encoding(x, w, h)
|
||||
|
||||
if self.register_tokens is not None:
|
||||
x = torch.cat(
|
||||
(
|
||||
x[:, :1],
|
||||
self.register_tokens.expand(x.shape[0], -1, -1),
|
||||
x[:, 1:],
|
||||
),
|
||||
dim=1,
|
||||
)
|
||||
|
||||
return x
|
||||
|
||||
def forward_features_list(self, x_list, masks_list):
|
||||
x = [self.prepare_tokens_with_masks(x, masks) for x, masks in zip(x_list, masks_list)]
|
||||
for blk in self.blocks:
|
||||
x = blk(x)
|
||||
|
||||
all_x = x
|
||||
output = []
|
||||
for x, masks in zip(all_x, masks_list):
|
||||
x_norm = self.norm(x)
|
||||
output.append(
|
||||
{
|
||||
"x_norm_clstoken": x_norm[:, 0],
|
||||
"x_norm_regtokens": x_norm[:, 1 : self.num_register_tokens + 1],
|
||||
"x_norm_patchtokens": x_norm[:, self.num_register_tokens + 1 :],
|
||||
"x_prenorm": x,
|
||||
"masks": masks,
|
||||
}
|
||||
)
|
||||
return output
|
||||
|
||||
def forward_features(self, x, masks=None):
|
||||
if isinstance(x, list):
|
||||
return self.forward_features_list(x, masks)
|
||||
|
||||
x = self.prepare_tokens_with_masks(x, masks)
|
||||
|
||||
for blk in self.blocks:
|
||||
x = blk(x)
|
||||
|
||||
x_norm = self.norm(x)
|
||||
return {
|
||||
"x_norm_clstoken": x_norm[:, 0],
|
||||
"x_norm_regtokens": x_norm[:, 1 : self.num_register_tokens + 1],
|
||||
"x_norm_patchtokens": x_norm[:, self.num_register_tokens + 1 :],
|
||||
"x_prenorm": x,
|
||||
"masks": masks,
|
||||
}
|
||||
|
||||
def _get_intermediate_layers_not_chunked(self, x, n=1):
|
||||
x = self.prepare_tokens_with_masks(x)
|
||||
# If n is an int, take the n last blocks. If it's a list, take them
|
||||
output, total_block_len = [], len(self.blocks)
|
||||
blocks_to_take = range(total_block_len - n, total_block_len) if isinstance(n, int) else n
|
||||
for i, blk in enumerate(self.blocks):
|
||||
x = blk(x)
|
||||
if i in blocks_to_take:
|
||||
output.append(x)
|
||||
assert len(output) == len(blocks_to_take), f"only {len(output)} / {len(blocks_to_take)} blocks found"
|
||||
return output
|
||||
|
||||
def _get_intermediate_layers_chunked(self, x, n=1):
|
||||
x = self.prepare_tokens_with_masks(x)
|
||||
output, i, total_block_len = [], 0, len(self.blocks[-1])
|
||||
# If n is an int, take the n last blocks. If it's a list, take them
|
||||
blocks_to_take = range(total_block_len - n, total_block_len) if isinstance(n, int) else n
|
||||
for block_chunk in self.blocks:
|
||||
for blk in block_chunk[i:]: # Passing the nn.Identity()
|
||||
x = blk(x)
|
||||
if i in blocks_to_take:
|
||||
output.append(x)
|
||||
i += 1
|
||||
assert len(output) == len(blocks_to_take), f"only {len(output)} / {len(blocks_to_take)} blocks found"
|
||||
return output
|
||||
|
||||
def get_intermediate_layers(
|
||||
self,
|
||||
x: torch.Tensor,
|
||||
n: Union[int, Sequence] = 1, # Layers or n last layers to take
|
||||
reshape: bool = False,
|
||||
return_class_token: bool = False,
|
||||
norm=True
|
||||
) -> Tuple[Union[torch.Tensor, Tuple[torch.Tensor]]]:
|
||||
if self.chunked_blocks:
|
||||
outputs = self._get_intermediate_layers_chunked(x, n)
|
||||
else:
|
||||
outputs = self._get_intermediate_layers_not_chunked(x, n)
|
||||
if norm:
|
||||
outputs = [self.norm(out) for out in outputs]
|
||||
class_tokens = [out[:, 0] for out in outputs]
|
||||
outputs = [out[:, 1 + self.num_register_tokens:] for out in outputs]
|
||||
if reshape:
|
||||
B, _, w, h = x.shape
|
||||
outputs = [
|
||||
out.reshape(B, w // self.patch_size, h // self.patch_size, -1).permute(0, 3, 1, 2).contiguous()
|
||||
for out in outputs
|
||||
]
|
||||
if return_class_token:
|
||||
return tuple(zip(outputs, class_tokens))
|
||||
return tuple(outputs)
|
||||
|
||||
def forward(self, *args, is_training=False, **kwargs):
|
||||
ret = self.forward_features(*args, **kwargs)
|
||||
if is_training:
|
||||
return ret
|
||||
else:
|
||||
return self.head(ret["x_norm_clstoken"])
|
||||
|
||||
|
||||
def init_weights_vit_timm(module: nn.Module, name: str = ""):
|
||||
"""ViT weight initialization, original timm impl (for reproducibility)"""
|
||||
if isinstance(module, nn.Linear):
|
||||
trunc_normal_(module.weight, std=0.02)
|
||||
if module.bias is not None:
|
||||
nn.init.zeros_(module.bias)
|
||||
|
||||
|
||||
def vit_small(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=384,
|
||||
depth=12,
|
||||
num_heads=6,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_base(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=768,
|
||||
depth=12,
|
||||
num_heads=12,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_large(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=1024,
|
||||
depth=24,
|
||||
num_heads=16,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_giant2(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
"""
|
||||
Close to ViT-giant, with embed-dim 1536 and 24 heads => embed-dim per head 64
|
||||
"""
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=1536,
|
||||
depth=40,
|
||||
num_heads=24,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def DINOv2(model_name):
|
||||
model_zoo = {
|
||||
"vits": vit_small,
|
||||
"vitb": vit_base,
|
||||
"vitl": vit_large,
|
||||
"vitg": vit_giant2
|
||||
}
|
||||
|
||||
return model_zoo[model_name](
|
||||
img_size=518,
|
||||
patch_size=14,
|
||||
init_values=1.0,
|
||||
ffn_layer="mlp" if model_name != "vitg" else "swiglufused",
|
||||
block_chunks=0,
|
||||
num_register_tokens=0,
|
||||
interpolate_antialias=False,
|
||||
interpolate_offset=0.1
|
||||
)
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from .mlp import Mlp
|
||||
from .patch_embed import PatchEmbed
|
||||
from .swiglu_ffn import SwiGLUFFN, SwiGLUFFNFused
|
||||
from .block import NestedTensorBlock
|
||||
from .attention import MemEffAttention
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,83 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/models/vision_transformer.py
|
||||
|
||||
import logging
|
||||
|
||||
from torch import Tensor
|
||||
from torch import nn
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import memory_efficient_attention, unbind, fmha
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
logger.warning("xFormers not available")
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class Attention(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
num_heads: int = 8,
|
||||
qkv_bias: bool = False,
|
||||
proj_bias: bool = True,
|
||||
attn_drop: float = 0.0,
|
||||
proj_drop: float = 0.0,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.num_heads = num_heads
|
||||
head_dim = dim // num_heads
|
||||
self.scale = head_dim**-0.5
|
||||
|
||||
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
||||
self.attn_drop = nn.Dropout(attn_drop)
|
||||
self.proj = nn.Linear(dim, dim, bias=proj_bias)
|
||||
self.proj_drop = nn.Dropout(proj_drop)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
B, N, C = x.shape
|
||||
qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
|
||||
|
||||
q, k, v = qkv[0] * self.scale, qkv[1], qkv[2]
|
||||
attn = q @ k.transpose(-2, -1)
|
||||
|
||||
attn = attn.softmax(dim=-1)
|
||||
attn = self.attn_drop(attn)
|
||||
|
||||
x = (attn @ v).transpose(1, 2).reshape(B, N, C)
|
||||
x = self.proj(x)
|
||||
x = self.proj_drop(x)
|
||||
return x
|
||||
|
||||
|
||||
class MemEffAttention(Attention):
|
||||
def forward(self, x: Tensor, attn_bias=None) -> Tensor:
|
||||
if not XFORMERS_AVAILABLE:
|
||||
assert attn_bias is None, "xFormers is required for nested tensors usage"
|
||||
return super().forward(x)
|
||||
|
||||
B, N, C = x.shape
|
||||
qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads)
|
||||
|
||||
q, k, v = unbind(qkv, 2)
|
||||
|
||||
x = memory_efficient_attention(q, k, v, attn_bias=attn_bias)
|
||||
x = x.reshape([B, N, C])
|
||||
|
||||
x = self.proj(x)
|
||||
x = self.proj_drop(x)
|
||||
return x
|
||||
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/patch_embed.py
|
||||
|
||||
import logging
|
||||
from typing import Callable, List, Any, Tuple, Dict
|
||||
|
||||
import torch
|
||||
from torch import nn, Tensor
|
||||
|
||||
from .attention import Attention, MemEffAttention
|
||||
from .drop_path import DropPath
|
||||
from .layer_scale import LayerScale
|
||||
from .mlp import Mlp
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import fmha
|
||||
from xformers.ops import scaled_index_add, index_select_cat
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
logger.warning("xFormers not available")
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class Block(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
num_heads: int,
|
||||
mlp_ratio: float = 4.0,
|
||||
qkv_bias: bool = False,
|
||||
proj_bias: bool = True,
|
||||
ffn_bias: bool = True,
|
||||
drop: float = 0.0,
|
||||
attn_drop: float = 0.0,
|
||||
init_values=None,
|
||||
drop_path: float = 0.0,
|
||||
act_layer: Callable[..., nn.Module] = nn.GELU,
|
||||
norm_layer: Callable[..., nn.Module] = nn.LayerNorm,
|
||||
attn_class: Callable[..., nn.Module] = Attention,
|
||||
ffn_layer: Callable[..., nn.Module] = Mlp,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
# print(f"biases: qkv: {qkv_bias}, proj: {proj_bias}, ffn: {ffn_bias}")
|
||||
self.norm1 = norm_layer(dim)
|
||||
self.attn = attn_class(
|
||||
dim,
|
||||
num_heads=num_heads,
|
||||
qkv_bias=qkv_bias,
|
||||
proj_bias=proj_bias,
|
||||
attn_drop=attn_drop,
|
||||
proj_drop=drop,
|
||||
)
|
||||
self.ls1 = LayerScale(dim, init_values=init_values) if init_values else nn.Identity()
|
||||
self.drop_path1 = DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
|
||||
|
||||
self.norm2 = norm_layer(dim)
|
||||
mlp_hidden_dim = int(dim * mlp_ratio)
|
||||
self.mlp = ffn_layer(
|
||||
in_features=dim,
|
||||
hidden_features=mlp_hidden_dim,
|
||||
act_layer=act_layer,
|
||||
drop=drop,
|
||||
bias=ffn_bias,
|
||||
)
|
||||
self.ls2 = LayerScale(dim, init_values=init_values) if init_values else nn.Identity()
|
||||
self.drop_path2 = DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
|
||||
|
||||
self.sample_drop_ratio = drop_path
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
def attn_residual_func(x: Tensor) -> Tensor:
|
||||
return self.ls1(self.attn(self.norm1(x)))
|
||||
|
||||
def ffn_residual_func(x: Tensor) -> Tensor:
|
||||
return self.ls2(self.mlp(self.norm2(x)))
|
||||
|
||||
if self.training and self.sample_drop_ratio > 0.1:
|
||||
# the overhead is compensated only for a drop path rate larger than 0.1
|
||||
x = drop_add_residual_stochastic_depth(
|
||||
x,
|
||||
residual_func=attn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
)
|
||||
x = drop_add_residual_stochastic_depth(
|
||||
x,
|
||||
residual_func=ffn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
)
|
||||
elif self.training and self.sample_drop_ratio > 0.0:
|
||||
x = x + self.drop_path1(attn_residual_func(x))
|
||||
x = x + self.drop_path1(ffn_residual_func(x)) # FIXME: drop_path2
|
||||
else:
|
||||
x = x + attn_residual_func(x)
|
||||
x = x + ffn_residual_func(x)
|
||||
return x
|
||||
|
||||
|
||||
def drop_add_residual_stochastic_depth(
|
||||
x: Tensor,
|
||||
residual_func: Callable[[Tensor], Tensor],
|
||||
sample_drop_ratio: float = 0.0,
|
||||
) -> Tensor:
|
||||
# 1) extract subset using permutation
|
||||
b, n, d = x.shape
|
||||
sample_subset_size = max(int(b * (1 - sample_drop_ratio)), 1)
|
||||
brange = (torch.randperm(b, device=x.device))[:sample_subset_size]
|
||||
x_subset = x[brange]
|
||||
|
||||
# 2) apply residual_func to get residual
|
||||
residual = residual_func(x_subset)
|
||||
|
||||
x_flat = x.flatten(1)
|
||||
residual = residual.flatten(1)
|
||||
|
||||
residual_scale_factor = b / sample_subset_size
|
||||
|
||||
# 3) add the residual
|
||||
x_plus_residual = torch.index_add(x_flat, 0, brange, residual.to(dtype=x.dtype), alpha=residual_scale_factor)
|
||||
return x_plus_residual.view_as(x)
|
||||
|
||||
|
||||
def get_branges_scales(x, sample_drop_ratio=0.0):
|
||||
b, n, d = x.shape
|
||||
sample_subset_size = max(int(b * (1 - sample_drop_ratio)), 1)
|
||||
brange = (torch.randperm(b, device=x.device))[:sample_subset_size]
|
||||
residual_scale_factor = b / sample_subset_size
|
||||
return brange, residual_scale_factor
|
||||
|
||||
|
||||
def add_residual(x, brange, residual, residual_scale_factor, scaling_vector=None):
|
||||
if scaling_vector is None:
|
||||
x_flat = x.flatten(1)
|
||||
residual = residual.flatten(1)
|
||||
x_plus_residual = torch.index_add(x_flat, 0, brange, residual.to(dtype=x.dtype), alpha=residual_scale_factor)
|
||||
else:
|
||||
x_plus_residual = scaled_index_add(
|
||||
x, brange, residual.to(dtype=x.dtype), scaling=scaling_vector, alpha=residual_scale_factor
|
||||
)
|
||||
return x_plus_residual
|
||||
|
||||
|
||||
attn_bias_cache: Dict[Tuple, Any] = {}
|
||||
|
||||
|
||||
def get_attn_bias_and_cat(x_list, branges=None):
|
||||
"""
|
||||
this will perform the index select, cat the tensors, and provide the attn_bias from cache
|
||||
"""
|
||||
batch_sizes = [b.shape[0] for b in branges] if branges is not None else [x.shape[0] for x in x_list]
|
||||
all_shapes = tuple((b, x.shape[1]) for b, x in zip(batch_sizes, x_list))
|
||||
if all_shapes not in attn_bias_cache.keys():
|
||||
seqlens = []
|
||||
for b, x in zip(batch_sizes, x_list):
|
||||
for _ in range(b):
|
||||
seqlens.append(x.shape[1])
|
||||
attn_bias = fmha.BlockDiagonalMask.from_seqlens(seqlens)
|
||||
attn_bias._batch_sizes = batch_sizes
|
||||
attn_bias_cache[all_shapes] = attn_bias
|
||||
|
||||
if branges is not None:
|
||||
cat_tensors = index_select_cat([x.flatten(1) for x in x_list], branges).view(1, -1, x_list[0].shape[-1])
|
||||
else:
|
||||
tensors_bs1 = tuple(x.reshape([1, -1, *x.shape[2:]]) for x in x_list)
|
||||
cat_tensors = torch.cat(tensors_bs1, dim=1)
|
||||
|
||||
return attn_bias_cache[all_shapes], cat_tensors
|
||||
|
||||
|
||||
def drop_add_residual_stochastic_depth_list(
|
||||
x_list: List[Tensor],
|
||||
residual_func: Callable[[Tensor, Any], Tensor],
|
||||
sample_drop_ratio: float = 0.0,
|
||||
scaling_vector=None,
|
||||
) -> Tensor:
|
||||
# 1) generate random set of indices for dropping samples in the batch
|
||||
branges_scales = [get_branges_scales(x, sample_drop_ratio=sample_drop_ratio) for x in x_list]
|
||||
branges = [s[0] for s in branges_scales]
|
||||
residual_scale_factors = [s[1] for s in branges_scales]
|
||||
|
||||
# 2) get attention bias and index+concat the tensors
|
||||
attn_bias, x_cat = get_attn_bias_and_cat(x_list, branges)
|
||||
|
||||
# 3) apply residual_func to get residual, and split the result
|
||||
residual_list = attn_bias.split(residual_func(x_cat, attn_bias=attn_bias)) # type: ignore
|
||||
|
||||
outputs = []
|
||||
for x, brange, residual, residual_scale_factor in zip(x_list, branges, residual_list, residual_scale_factors):
|
||||
outputs.append(add_residual(x, brange, residual, residual_scale_factor, scaling_vector).view_as(x))
|
||||
return outputs
|
||||
|
||||
|
||||
class NestedTensorBlock(Block):
|
||||
def forward_nested(self, x_list: List[Tensor]) -> List[Tensor]:
|
||||
"""
|
||||
x_list contains a list of tensors to nest together and run
|
||||
"""
|
||||
assert isinstance(self.attn, MemEffAttention)
|
||||
|
||||
if self.training and self.sample_drop_ratio > 0.0:
|
||||
|
||||
def attn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.attn(self.norm1(x), attn_bias=attn_bias)
|
||||
|
||||
def ffn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.mlp(self.norm2(x))
|
||||
|
||||
x_list = drop_add_residual_stochastic_depth_list(
|
||||
x_list,
|
||||
residual_func=attn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
scaling_vector=self.ls1.gamma if isinstance(self.ls1, LayerScale) else None,
|
||||
)
|
||||
x_list = drop_add_residual_stochastic_depth_list(
|
||||
x_list,
|
||||
residual_func=ffn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
scaling_vector=self.ls2.gamma if isinstance(self.ls1, LayerScale) else None,
|
||||
)
|
||||
return x_list
|
||||
else:
|
||||
|
||||
def attn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.ls1(self.attn(self.norm1(x), attn_bias=attn_bias))
|
||||
|
||||
def ffn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.ls2(self.mlp(self.norm2(x)))
|
||||
|
||||
attn_bias, x = get_attn_bias_and_cat(x_list)
|
||||
x = x + attn_residual_func(x, attn_bias=attn_bias)
|
||||
x = x + ffn_residual_func(x)
|
||||
return attn_bias.split(x)
|
||||
|
||||
def forward(self, x_or_x_list):
|
||||
if isinstance(x_or_x_list, Tensor):
|
||||
return super().forward(x_or_x_list)
|
||||
elif isinstance(x_or_x_list, list):
|
||||
assert XFORMERS_AVAILABLE, "Please install xFormers for nested tensors usage"
|
||||
return self.forward_nested(x_or_x_list)
|
||||
else:
|
||||
raise AssertionError
|
|
@ -0,0 +1,35 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/drop.py
|
||||
|
||||
|
||||
from torch import nn
|
||||
|
||||
|
||||
def drop_path(x, drop_prob: float = 0.0, training: bool = False):
|
||||
if drop_prob == 0.0 or not training:
|
||||
return x
|
||||
keep_prob = 1 - drop_prob
|
||||
shape = (x.shape[0],) + (1,) * (x.ndim - 1) # work with diff dim tensors, not just 2D ConvNets
|
||||
random_tensor = x.new_empty(shape).bernoulli_(keep_prob)
|
||||
if keep_prob > 0.0:
|
||||
random_tensor.div_(keep_prob)
|
||||
output = x * random_tensor
|
||||
return output
|
||||
|
||||
|
||||
class DropPath(nn.Module):
|
||||
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks)."""
|
||||
|
||||
def __init__(self, drop_prob=None):
|
||||
super(DropPath, self).__init__()
|
||||
self.drop_prob = drop_prob
|
||||
|
||||
def forward(self, x):
|
||||
return drop_path(x, self.drop_prob, self.training)
|
|
@ -0,0 +1,28 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# Modified from: https://github.com/huggingface/pytorch-image-models/blob/main/timm/models/vision_transformer.py#L103-L110
|
||||
|
||||
from typing import Union
|
||||
|
||||
import torch
|
||||
from torch import Tensor
|
||||
from torch import nn
|
||||
|
||||
|
||||
class LayerScale(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
init_values: Union[float, Tensor] = 1e-5,
|
||||
inplace: bool = False,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.inplace = inplace
|
||||
self.gamma = nn.Parameter(init_values * torch.ones(dim))
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
return x.mul_(self.gamma) if self.inplace else x * self.gamma
|
|
@ -0,0 +1,41 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/mlp.py
|
||||
|
||||
|
||||
from typing import Callable, Optional
|
||||
|
||||
from torch import Tensor, nn
|
||||
|
||||
|
||||
class Mlp(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = nn.GELU,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
self.fc1 = nn.Linear(in_features, hidden_features, bias=bias)
|
||||
self.act = act_layer()
|
||||
self.fc2 = nn.Linear(hidden_features, out_features, bias=bias)
|
||||
self.drop = nn.Dropout(drop)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
x = self.fc1(x)
|
||||
x = self.act(x)
|
||||
x = self.drop(x)
|
||||
x = self.fc2(x)
|
||||
x = self.drop(x)
|
||||
return x
|
|
@ -0,0 +1,89 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/patch_embed.py
|
||||
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
|
||||
from torch import Tensor
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
def make_2tuple(x):
|
||||
if isinstance(x, tuple):
|
||||
assert len(x) == 2
|
||||
return x
|
||||
|
||||
assert isinstance(x, int)
|
||||
return (x, x)
|
||||
|
||||
|
||||
class PatchEmbed(nn.Module):
|
||||
"""
|
||||
2D image to patch embedding: (B,C,H,W) -> (B,N,D)
|
||||
|
||||
Args:
|
||||
img_size: Image size.
|
||||
patch_size: Patch token size.
|
||||
in_chans: Number of input image channels.
|
||||
embed_dim: Number of linear projection output channels.
|
||||
norm_layer: Normalization layer.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
img_size: Union[int, Tuple[int, int]] = 224,
|
||||
patch_size: Union[int, Tuple[int, int]] = 16,
|
||||
in_chans: int = 3,
|
||||
embed_dim: int = 768,
|
||||
norm_layer: Optional[Callable] = None,
|
||||
flatten_embedding: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
|
||||
image_HW = make_2tuple(img_size)
|
||||
patch_HW = make_2tuple(patch_size)
|
||||
patch_grid_size = (
|
||||
image_HW[0] // patch_HW[0],
|
||||
image_HW[1] // patch_HW[1],
|
||||
)
|
||||
|
||||
self.img_size = image_HW
|
||||
self.patch_size = patch_HW
|
||||
self.patches_resolution = patch_grid_size
|
||||
self.num_patches = patch_grid_size[0] * patch_grid_size[1]
|
||||
|
||||
self.in_chans = in_chans
|
||||
self.embed_dim = embed_dim
|
||||
|
||||
self.flatten_embedding = flatten_embedding
|
||||
|
||||
self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=patch_HW, stride=patch_HW)
|
||||
self.norm = norm_layer(embed_dim) if norm_layer else nn.Identity()
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
_, _, H, W = x.shape
|
||||
patch_H, patch_W = self.patch_size
|
||||
|
||||
assert H % patch_H == 0, f"Input image height {H} is not a multiple of patch height {patch_H}"
|
||||
assert W % patch_W == 0, f"Input image width {W} is not a multiple of patch width: {patch_W}"
|
||||
|
||||
x = self.proj(x) # B C H W
|
||||
H, W = x.size(2), x.size(3)
|
||||
x = x.flatten(2).transpose(1, 2) # B HW C
|
||||
x = self.norm(x)
|
||||
if not self.flatten_embedding:
|
||||
x = x.reshape(-1, H, W, self.embed_dim) # B H W C
|
||||
return x
|
||||
|
||||
def flops(self) -> float:
|
||||
Ho, Wo = self.patches_resolution
|
||||
flops = Ho * Wo * self.embed_dim * self.in_chans * (self.patch_size[0] * self.patch_size[1])
|
||||
if self.norm is not None:
|
||||
flops += Ho * Wo * self.embed_dim
|
||||
return flops
|
|
@ -0,0 +1,63 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from typing import Callable, Optional
|
||||
|
||||
from torch import Tensor, nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
||||
class SwiGLUFFN(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = None,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
self.w12 = nn.Linear(in_features, 2 * hidden_features, bias=bias)
|
||||
self.w3 = nn.Linear(hidden_features, out_features, bias=bias)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
x12 = self.w12(x)
|
||||
x1, x2 = x12.chunk(2, dim=-1)
|
||||
hidden = F.silu(x1) * x2
|
||||
return self.w3(hidden)
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import SwiGLU
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
SwiGLU = SwiGLUFFN
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class SwiGLUFFNFused(SwiGLU):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = None,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
hidden_features = (int(hidden_features * 2 / 3) + 7) // 8 * 8
|
||||
super().__init__(
|
||||
in_features=in_features,
|
||||
hidden_features=hidden_features,
|
||||
out_features=out_features,
|
||||
bias=bias,
|
||||
)
|
|
@ -0,0 +1,221 @@
|
|||
import cv2
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
from torchvision.transforms import Compose
|
||||
|
||||
from .dinov2 import DINOv2
|
||||
from .util.blocks import FeatureFusionBlock, _make_scratch
|
||||
from .util.transform import Resize, NormalizeImage, PrepareForNet
|
||||
|
||||
|
||||
def _make_fusion_block(features, use_bn, size=None):
|
||||
return FeatureFusionBlock(
|
||||
features,
|
||||
nn.ReLU(False),
|
||||
deconv=False,
|
||||
bn=use_bn,
|
||||
expand=False,
|
||||
align_corners=True,
|
||||
size=size,
|
||||
)
|
||||
|
||||
|
||||
class ConvBlock(nn.Module):
|
||||
def __init__(self, in_feature, out_feature):
|
||||
super().__init__()
|
||||
|
||||
self.conv_block = nn.Sequential(
|
||||
nn.Conv2d(in_feature, out_feature, kernel_size=3, stride=1, padding=1),
|
||||
nn.BatchNorm2d(out_feature),
|
||||
nn.ReLU(True)
|
||||
)
|
||||
|
||||
def forward(self, x):
|
||||
return self.conv_block(x)
|
||||
|
||||
|
||||
class DPTHead(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_channels,
|
||||
features=256,
|
||||
use_bn=False,
|
||||
out_channels=[256, 512, 1024, 1024],
|
||||
use_clstoken=False
|
||||
):
|
||||
super(DPTHead, self).__init__()
|
||||
|
||||
self.use_clstoken = use_clstoken
|
||||
|
||||
self.projects = nn.ModuleList([
|
||||
nn.Conv2d(
|
||||
in_channels=in_channels,
|
||||
out_channels=out_channel,
|
||||
kernel_size=1,
|
||||
stride=1,
|
||||
padding=0,
|
||||
) for out_channel in out_channels
|
||||
])
|
||||
|
||||
self.resize_layers = nn.ModuleList([
|
||||
nn.ConvTranspose2d(
|
||||
in_channels=out_channels[0],
|
||||
out_channels=out_channels[0],
|
||||
kernel_size=4,
|
||||
stride=4,
|
||||
padding=0),
|
||||
nn.ConvTranspose2d(
|
||||
in_channels=out_channels[1],
|
||||
out_channels=out_channels[1],
|
||||
kernel_size=2,
|
||||
stride=2,
|
||||
padding=0),
|
||||
nn.Identity(),
|
||||
nn.Conv2d(
|
||||
in_channels=out_channels[3],
|
||||
out_channels=out_channels[3],
|
||||
kernel_size=3,
|
||||
stride=2,
|
||||
padding=1)
|
||||
])
|
||||
|
||||
if use_clstoken:
|
||||
self.readout_projects = nn.ModuleList()
|
||||
for _ in range(len(self.projects)):
|
||||
self.readout_projects.append(
|
||||
nn.Sequential(
|
||||
nn.Linear(2 * in_channels, in_channels),
|
||||
nn.GELU()))
|
||||
|
||||
self.scratch = _make_scratch(
|
||||
out_channels,
|
||||
features,
|
||||
groups=1,
|
||||
expand=False,
|
||||
)
|
||||
|
||||
self.scratch.stem_transpose = None
|
||||
|
||||
self.scratch.refinenet1 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet2 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet3 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet4 = _make_fusion_block(features, use_bn)
|
||||
|
||||
head_features_1 = features
|
||||
head_features_2 = 32
|
||||
|
||||
self.scratch.output_conv1 = nn.Conv2d(head_features_1, head_features_1 // 2, kernel_size=3, stride=1, padding=1)
|
||||
self.scratch.output_conv2 = nn.Sequential(
|
||||
nn.Conv2d(head_features_1 // 2, head_features_2, kernel_size=3, stride=1, padding=1),
|
||||
nn.ReLU(True),
|
||||
nn.Conv2d(head_features_2, 1, kernel_size=1, stride=1, padding=0),
|
||||
nn.ReLU(True),
|
||||
nn.Identity(),
|
||||
)
|
||||
|
||||
def forward(self, out_features, patch_h, patch_w):
|
||||
out = []
|
||||
for i, x in enumerate(out_features):
|
||||
if self.use_clstoken:
|
||||
x, cls_token = x[0], x[1]
|
||||
readout = cls_token.unsqueeze(1).expand_as(x)
|
||||
x = self.readout_projects[i](torch.cat((x, readout), -1))
|
||||
else:
|
||||
x = x[0]
|
||||
|
||||
x = x.permute(0, 2, 1).reshape((x.shape[0], x.shape[-1], patch_h, patch_w))
|
||||
|
||||
x = self.projects[i](x)
|
||||
x = self.resize_layers[i](x)
|
||||
|
||||
out.append(x)
|
||||
|
||||
layer_1, layer_2, layer_3, layer_4 = out
|
||||
|
||||
layer_1_rn = self.scratch.layer1_rn(layer_1)
|
||||
layer_2_rn = self.scratch.layer2_rn(layer_2)
|
||||
layer_3_rn = self.scratch.layer3_rn(layer_3)
|
||||
layer_4_rn = self.scratch.layer4_rn(layer_4)
|
||||
|
||||
path_4 = self.scratch.refinenet4(layer_4_rn, size=layer_3_rn.shape[2:])
|
||||
path_3 = self.scratch.refinenet3(path_4, layer_3_rn, size=layer_2_rn.shape[2:])
|
||||
path_2 = self.scratch.refinenet2(path_3, layer_2_rn, size=layer_1_rn.shape[2:])
|
||||
path_1 = self.scratch.refinenet1(path_2, layer_1_rn)
|
||||
|
||||
out = self.scratch.output_conv1(path_1)
|
||||
out = F.interpolate(out, (int(patch_h * 14), int(patch_w * 14)), mode="bilinear", align_corners=True)
|
||||
out = self.scratch.output_conv2(out)
|
||||
|
||||
return out
|
||||
|
||||
|
||||
class DepthAnythingV2(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
encoder='vitl',
|
||||
features=256,
|
||||
out_channels=[256, 512, 1024, 1024],
|
||||
use_bn=False,
|
||||
use_clstoken=False
|
||||
):
|
||||
super(DepthAnythingV2, self).__init__()
|
||||
|
||||
self.intermediate_layer_idx = {
|
||||
'vits': [2, 5, 8, 11],
|
||||
'vitb': [2, 5, 8, 11],
|
||||
'vitl': [4, 11, 17, 23],
|
||||
'vitg': [9, 19, 29, 39]
|
||||
}
|
||||
|
||||
self.encoder = encoder
|
||||
self.pretrained = DINOv2(model_name=encoder)
|
||||
|
||||
self.depth_head = DPTHead(self.pretrained.embed_dim, features, use_bn, out_channels=out_channels, use_clstoken=use_clstoken)
|
||||
|
||||
def forward(self, x):
|
||||
patch_h, patch_w = x.shape[-2] // 14, x.shape[-1] // 14
|
||||
|
||||
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
|
||||
|
||||
depth = self.depth_head(features, patch_h, patch_w)
|
||||
depth = F.relu(depth)
|
||||
|
||||
return depth.squeeze(1)
|
||||
|
||||
@torch.no_grad()
|
||||
def infer_image(self, raw_image, input_size=518):
|
||||
image, (h, w) = self.image2tensor(raw_image, input_size)
|
||||
|
||||
depth = self.forward(image)
|
||||
|
||||
depth = F.interpolate(depth[:, None], (h, w), mode="bilinear", align_corners=True)[0, 0]
|
||||
|
||||
return depth.cpu().numpy()
|
||||
|
||||
def image2tensor(self, raw_image, input_size=518):
|
||||
transform = Compose([
|
||||
Resize(
|
||||
width=input_size,
|
||||
height=input_size,
|
||||
resize_target=False,
|
||||
keep_aspect_ratio=True,
|
||||
ensure_multiple_of=14,
|
||||
resize_method='lower_bound',
|
||||
image_interpolation_method=cv2.INTER_CUBIC,
|
||||
),
|
||||
NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
||||
PrepareForNet(),
|
||||
])
|
||||
|
||||
h, w = raw_image.shape[:2]
|
||||
|
||||
image = cv2.cvtColor(raw_image, cv2.COLOR_BGR2RGB) / 255.0
|
||||
|
||||
image = transform({'image': image})['image']
|
||||
image = torch.from_numpy(image).unsqueeze(0)
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
image = image.to(DEVICE)
|
||||
|
||||
return image, (h, w)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,148 @@
|
|||
import torch.nn as nn
|
||||
|
||||
|
||||
def _make_scratch(in_shape, out_shape, groups=1, expand=False):
|
||||
scratch = nn.Module()
|
||||
|
||||
out_shape1 = out_shape
|
||||
out_shape2 = out_shape
|
||||
out_shape3 = out_shape
|
||||
if len(in_shape) >= 4:
|
||||
out_shape4 = out_shape
|
||||
|
||||
if expand:
|
||||
out_shape1 = out_shape
|
||||
out_shape2 = out_shape * 2
|
||||
out_shape3 = out_shape * 4
|
||||
if len(in_shape) >= 4:
|
||||
out_shape4 = out_shape * 8
|
||||
|
||||
scratch.layer1_rn = nn.Conv2d(in_shape[0], out_shape1, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
scratch.layer2_rn = nn.Conv2d(in_shape[1], out_shape2, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
scratch.layer3_rn = nn.Conv2d(in_shape[2], out_shape3, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
if len(in_shape) >= 4:
|
||||
scratch.layer4_rn = nn.Conv2d(in_shape[3], out_shape4, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
|
||||
return scratch
|
||||
|
||||
|
||||
class ResidualConvUnit(nn.Module):
|
||||
"""Residual convolution module.
|
||||
"""
|
||||
|
||||
def __init__(self, features, activation, bn):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
features (int): number of features
|
||||
"""
|
||||
super().__init__()
|
||||
|
||||
self.bn = bn
|
||||
|
||||
self.groups=1
|
||||
|
||||
self.conv1 = nn.Conv2d(features, features, kernel_size=3, stride=1, padding=1, bias=True, groups=self.groups)
|
||||
|
||||
self.conv2 = nn.Conv2d(features, features, kernel_size=3, stride=1, padding=1, bias=True, groups=self.groups)
|
||||
|
||||
if self.bn == True:
|
||||
self.bn1 = nn.BatchNorm2d(features)
|
||||
self.bn2 = nn.BatchNorm2d(features)
|
||||
|
||||
self.activation = activation
|
||||
|
||||
self.skip_add = nn.quantized.FloatFunctional()
|
||||
|
||||
def forward(self, x):
|
||||
"""Forward pass.
|
||||
|
||||
Args:
|
||||
x (tensor): input
|
||||
|
||||
Returns:
|
||||
tensor: output
|
||||
"""
|
||||
|
||||
out = self.activation(x)
|
||||
out = self.conv1(out)
|
||||
if self.bn == True:
|
||||
out = self.bn1(out)
|
||||
|
||||
out = self.activation(out)
|
||||
out = self.conv2(out)
|
||||
if self.bn == True:
|
||||
out = self.bn2(out)
|
||||
|
||||
if self.groups > 1:
|
||||
out = self.conv_merge(out)
|
||||
|
||||
return self.skip_add.add(out, x)
|
||||
|
||||
|
||||
class FeatureFusionBlock(nn.Module):
|
||||
"""Feature fusion block.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
features,
|
||||
activation,
|
||||
deconv=False,
|
||||
bn=False,
|
||||
expand=False,
|
||||
align_corners=True,
|
||||
size=None
|
||||
):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
features (int): number of features
|
||||
"""
|
||||
super(FeatureFusionBlock, self).__init__()
|
||||
|
||||
self.deconv = deconv
|
||||
self.align_corners = align_corners
|
||||
|
||||
self.groups=1
|
||||
|
||||
self.expand = expand
|
||||
out_features = features
|
||||
if self.expand == True:
|
||||
out_features = features // 2
|
||||
|
||||
self.out_conv = nn.Conv2d(features, out_features, kernel_size=1, stride=1, padding=0, bias=True, groups=1)
|
||||
|
||||
self.resConfUnit1 = ResidualConvUnit(features, activation, bn)
|
||||
self.resConfUnit2 = ResidualConvUnit(features, activation, bn)
|
||||
|
||||
self.skip_add = nn.quantized.FloatFunctional()
|
||||
|
||||
self.size=size
|
||||
|
||||
def forward(self, *xs, size=None):
|
||||
"""Forward pass.
|
||||
|
||||
Returns:
|
||||
tensor: output
|
||||
"""
|
||||
output = xs[0]
|
||||
|
||||
if len(xs) == 2:
|
||||
res = self.resConfUnit1(xs[1])
|
||||
output = self.skip_add.add(output, res)
|
||||
|
||||
output = self.resConfUnit2(output)
|
||||
|
||||
if (size is None) and (self.size is None):
|
||||
modifier = {"scale_factor": 2}
|
||||
elif size is None:
|
||||
modifier = {"size": self.size}
|
||||
else:
|
||||
modifier = {"size": size}
|
||||
|
||||
output = nn.functional.interpolate(output, **modifier, mode="bilinear", align_corners=self.align_corners)
|
||||
|
||||
output = self.out_conv(output)
|
||||
|
||||
return output
|
|
@ -0,0 +1,158 @@
|
|||
import numpy as np
|
||||
import cv2
|
||||
|
||||
|
||||
class Resize(object):
|
||||
"""Resize sample to given size (width, height).
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
width,
|
||||
height,
|
||||
resize_target=True,
|
||||
keep_aspect_ratio=False,
|
||||
ensure_multiple_of=1,
|
||||
resize_method="lower_bound",
|
||||
image_interpolation_method=cv2.INTER_AREA,
|
||||
):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
width (int): desired output width
|
||||
height (int): desired output height
|
||||
resize_target (bool, optional):
|
||||
True: Resize the full sample (image, mask, target).
|
||||
False: Resize image only.
|
||||
Defaults to True.
|
||||
keep_aspect_ratio (bool, optional):
|
||||
True: Keep the aspect ratio of the input sample.
|
||||
Output sample might not have the given width and height, and
|
||||
resize behaviour depends on the parameter 'resize_method'.
|
||||
Defaults to False.
|
||||
ensure_multiple_of (int, optional):
|
||||
Output width and height is constrained to be multiple of this parameter.
|
||||
Defaults to 1.
|
||||
resize_method (str, optional):
|
||||
"lower_bound": Output will be at least as large as the given size.
|
||||
"upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
|
||||
"minimal": Scale as least as possible. (Output size might be smaller than given size.)
|
||||
Defaults to "lower_bound".
|
||||
"""
|
||||
self.__width = width
|
||||
self.__height = height
|
||||
|
||||
self.__resize_target = resize_target
|
||||
self.__keep_aspect_ratio = keep_aspect_ratio
|
||||
self.__multiple_of = ensure_multiple_of
|
||||
self.__resize_method = resize_method
|
||||
self.__image_interpolation_method = image_interpolation_method
|
||||
|
||||
def constrain_to_multiple_of(self, x, min_val=0, max_val=None):
|
||||
y = (np.round(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if max_val is not None and y > max_val:
|
||||
y = (np.floor(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if y < min_val:
|
||||
y = (np.ceil(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
return y
|
||||
|
||||
def get_size(self, width, height):
|
||||
# determine new height and width
|
||||
scale_height = self.__height / height
|
||||
scale_width = self.__width / width
|
||||
|
||||
if self.__keep_aspect_ratio:
|
||||
if self.__resize_method == "lower_bound":
|
||||
# scale such that output size is lower bound
|
||||
if scale_width > scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "upper_bound":
|
||||
# scale such that output size is upper bound
|
||||
if scale_width < scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "minimal":
|
||||
# scale as least as possbile
|
||||
if abs(1 - scale_width) < abs(1 - scale_height):
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
else:
|
||||
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
||||
|
||||
if self.__resize_method == "lower_bound":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height, min_val=self.__height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width, min_val=self.__width)
|
||||
elif self.__resize_method == "upper_bound":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height, max_val=self.__height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width, max_val=self.__width)
|
||||
elif self.__resize_method == "minimal":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width)
|
||||
else:
|
||||
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
||||
|
||||
return (new_width, new_height)
|
||||
|
||||
def __call__(self, sample):
|
||||
width, height = self.get_size(sample["image"].shape[1], sample["image"].shape[0])
|
||||
|
||||
# resize sample
|
||||
sample["image"] = cv2.resize(sample["image"], (width, height), interpolation=self.__image_interpolation_method)
|
||||
|
||||
if self.__resize_target:
|
||||
if "depth" in sample:
|
||||
sample["depth"] = cv2.resize(sample["depth"], (width, height), interpolation=cv2.INTER_NEAREST)
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = cv2.resize(sample["mask"].astype(np.float32), (width, height), interpolation=cv2.INTER_NEAREST)
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class NormalizeImage(object):
|
||||
"""Normlize image by given mean and std.
|
||||
"""
|
||||
|
||||
def __init__(self, mean, std):
|
||||
self.__mean = mean
|
||||
self.__std = std
|
||||
|
||||
def __call__(self, sample):
|
||||
sample["image"] = (sample["image"] - self.__mean) / self.__std
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class PrepareForNet(object):
|
||||
"""Prepare sample for usage as network input.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def __call__(self, sample):
|
||||
image = np.transpose(sample["image"], (2, 0, 1))
|
||||
sample["image"] = np.ascontiguousarray(image).astype(np.float32)
|
||||
|
||||
if "depth" in sample:
|
||||
depth = sample["depth"].astype(np.float32)
|
||||
sample["depth"] = np.ascontiguousarray(depth)
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = sample["mask"].astype(np.float32)
|
||||
sample["mask"] = np.ascontiguousarray(sample["mask"])
|
||||
|
||||
return sample
|
|
@ -0,0 +1,273 @@
|
|||
import cv2
|
||||
import rawpy
|
||||
from PIL import Image
|
||||
from tqdm import tqdm
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import argparse
|
||||
import numpy as np
|
||||
import os
|
||||
import torch
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
from utils import specify_name_group_blade,get_name
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2')
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
args = parser.parse_args()
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**model_configs[args.encoder])
|
||||
depth_anything.load_state_dict(
|
||||
torch.load(f'checkpoints/depth_anything_v2_{args.encoder}.pth', map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
print("model loaded")
|
||||
def extraction_win_lamina_mask(raw_image):
|
||||
# 前面读的都是RGB图像,深度估计需要BGR,即下面是把RGB→BGR
|
||||
raw_image = cv2.cvtColor(raw_image, cv2.COLOR_BGR2RGB)
|
||||
|
||||
depth = depth_anything.infer_image(raw_image, args.input_size)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
_, otsu_mask = cv2.threshold(depth, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
|
||||
return otsu_mask
|
||||
|
||||
|
||||
def check_overexposure(image, lamina_mask,threshold):
|
||||
"""
|
||||
检查图像中是否有过曝区域
|
||||
:param image: 输入图像
|
||||
:param threshold: 亮度值的阈值,像素值超过该值则认为是过曝区域
|
||||
:return: 一个二值图像,过曝区域为白色,其它区域为黑色
|
||||
"""
|
||||
# 转换为浮动数据类型并归一化
|
||||
image_float = image.astype(np.float32)
|
||||
|
||||
# 获取每个像素的亮度值(可以使用 YUV 或 RGB 亮度)
|
||||
gray_image = cv2.cvtColor(image_float, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
# 标记过曝区域,亮度大于阈值的像素为过曝区域
|
||||
overexposure_mask = gray_image > threshold
|
||||
|
||||
overexposure_mask = (lamina_mask == 255) & overexposure_mask #只取叶片的亮光区mask
|
||||
|
||||
overexposure_number = np.sum(overexposure_mask * 1)
|
||||
overexposed_pixels = gray_image[overexposure_mask]
|
||||
# 计算曝光区域的平均亮度
|
||||
if overexposed_pixels.size > 0:
|
||||
avg_overexposed_value = np.mean(overexposed_pixels)
|
||||
else:
|
||||
avg_overexposed_value = 0 # 如果没有曝光区域,返回 0
|
||||
|
||||
return overexposure_mask, avg_overexposed_value,overexposure_number
|
||||
|
||||
def check_shawn(image,lamina_mask, threshold):
|
||||
"""
|
||||
检查图像中是否有阴影区域
|
||||
:param image: 输入图像
|
||||
:param threshold: 亮度值的阈值,像素值小于该值则认为是过阴影域
|
||||
:return: 一个二值图像,过曝区域为白色,其它区域为黑色
|
||||
"""
|
||||
|
||||
# 转换为浮动数据类型并归一化
|
||||
image_float = image.astype(np.float32)
|
||||
# 获取每个像素的亮度值(可以使用 YUV 或 RGB 亮度)
|
||||
gray_image = cv2.cvtColor(image_float, cv2.COLOR_BGR2GRAY)
|
||||
# 标记阴影区域,亮度小于阈值的像素为阴影区域
|
||||
shawn_mask = gray_image < threshold
|
||||
|
||||
shawn_mask = (lamina_mask == 255) & shawn_mask
|
||||
|
||||
shawn_number = np.sum(shawn_mask * 1)
|
||||
shawn_pixels = gray_image[shawn_mask]
|
||||
# 计算阴影区域的平均亮度
|
||||
if shawn_pixels.size > 0:
|
||||
avg_shawn_value = np.mean(shawn_pixels)
|
||||
else:
|
||||
avg_shawn_value = 0
|
||||
|
||||
return shawn_mask, avg_shawn_value,shawn_number
|
||||
|
||||
def smooth_overexposed_regions(image, overexposure_mask, kernel_size=(15, 15)):
|
||||
"""
|
||||
对过曝区域进行平滑处理,修复与周围区域的过渡
|
||||
:param image: 输入图像
|
||||
:param overexposure_mask: 过曝区域的掩码
|
||||
:param kernel_size: 高斯核大小
|
||||
:return: 平滑过曝区域后的图像
|
||||
"""
|
||||
# 使用高斯模糊平滑过曝区域和周围区域
|
||||
smoothed_image = cv2.GaussianBlur(image, kernel_size, 0)
|
||||
|
||||
# 将平滑后的图像和原始图像合成,修复过曝区域
|
||||
fixed_image = np.where(overexposure_mask[..., None] == 255, image,smoothed_image)
|
||||
|
||||
return fixed_image
|
||||
|
||||
def bilateral_filter_adjustment(image, high_light_mask, d=15, sigma_color=75, sigma_space=75):
|
||||
"""
|
||||
使用双边滤波器平滑高光区域与周围区域的过渡
|
||||
:param image: 输入图像
|
||||
:param high_light_mask: 高光区域的掩码
|
||||
:param d: 邻域的直径
|
||||
:param sigma_color: 颜色空间的标准差
|
||||
:param sigma_space: 坐标空间的标准差
|
||||
:return: 平滑后的图像
|
||||
"""
|
||||
# 对整个图像应用双边滤波
|
||||
filtered_image = cv2.bilateralFilter(image, d, sigma_color, sigma_space)
|
||||
|
||||
# 合成平滑后的图像和原图,保留非高光部分
|
||||
final_image = np.where(high_light_mask[..., None] == 0, image, filtered_image)
|
||||
|
||||
return final_image
|
||||
|
||||
def adjust_highlights_shadows(image, threshold_shawn,threshold):
|
||||
|
||||
lamina_mask = extraction_win_lamina_mask(image)
|
||||
|
||||
shawn_mask,avg_shawn_value,shawn_number = check_shawn(image,lamina_mask,threshold_shawn)
|
||||
# 调整亮度,gamma < 1 时变亮,gamma > 1 时变暗
|
||||
gamma = 1 - (threshold_shawn-avg_shawn_value)/255.0
|
||||
# print('阴影区调整的gama: '+str(gamma))#+str('\n'))
|
||||
lookup_table = np.array([((i / 255.0) ** gamma) * 255 for i in range(256)]).astype('uint8')
|
||||
# 应用 gamma 校正
|
||||
if shawn_number !=0:
|
||||
image[shawn_mask == True] = cv2.LUT(image[shawn_mask == True], lookup_table)
|
||||
gamma_corrected_image = image
|
||||
else:
|
||||
gamma_corrected_image = image
|
||||
#gamma_corrected_image = cv2.LUT(image, lookup_table)
|
||||
|
||||
#寻找过爆区域
|
||||
overexposure_mask,avg_overexposed_value,overexposure_number = check_overexposure(gamma_corrected_image,lamina_mask,threshold)
|
||||
reduction_factor = 1-(avg_overexposed_value-threshold) / 255
|
||||
#reduction_factor = (avg_overexposed_value/255)*scale
|
||||
# print("降低曝光区比例:" + str(reduction_factor))
|
||||
|
||||
# 调整亮度,gamma < 1 时变亮(越小越亮),gamma > 1 时变暗(越大越暗),
|
||||
print((1+reduction_factor))
|
||||
lookup_table = np.array([((i / 255.0) ** (1+reduction_factor)) * 255 for i in range(256)]).astype('uint8')
|
||||
# 应用 gamma 校正
|
||||
if overexposure_number !=0:
|
||||
gamma_corrected_image[overexposure_mask == True] = cv2.LUT(gamma_corrected_image[overexposure_mask == True], lookup_table)
|
||||
|
||||
|
||||
#gamma_corrected_image[overexposure_mask == True] = np.clip(gamma_corrected_image[overexposure_mask == True] * reduction_factor, 0, 255)
|
||||
|
||||
|
||||
#smoothed_image = smooth_overexposed_regions(gamma_corrected_image, overexposure_mask)
|
||||
#smoothed_image = bilateral_filter_adjustment(gamma_corrected_image, overexposure_mask, d=15, sigma_color=75, sigma_space=75)
|
||||
|
||||
return gamma_corrected_image
|
||||
|
||||
|
||||
def process_single_image(input_path, output_path, gamma, threshold, no_auto_bright,config=None):
|
||||
|
||||
if input_path.lower().endswith(('.arw', '.dng')):
|
||||
with rawpy.imread(input_path) as raw:
|
||||
# 获取 RGB 图像数据
|
||||
rgb_image = raw.postprocess(use_camera_wb=True, no_auto_bright=no_auto_bright, output_bps=16)
|
||||
rgb_image = np.uint8(rgb_image / 256)
|
||||
|
||||
if rgb_image is not None:
|
||||
adjusted_image = adjust_highlights_shadows(rgb_image, gamma, threshold)
|
||||
# 使用 Pillow 创建图像
|
||||
image = Image.fromarray(adjusted_image)
|
||||
# print(exif)
|
||||
image.save(output_path[:-4]+".JPG" , format='JPEG', quality=100,)#'JPEG',exif=exif
|
||||
else:
|
||||
print(f"Failed to read image: {input_path}")
|
||||
else:
|
||||
exif = Image.open(input_path).getexif()
|
||||
image_pil = Image.open(input_path)
|
||||
image = np.array(image_pil)
|
||||
if image is not None:
|
||||
adjusted_image = adjust_highlights_shadows(image, gamma, threshold)
|
||||
images = Image.fromarray(adjusted_image)
|
||||
images.save(output_path, 'JPEG', quality=100,exif=exif)
|
||||
else:
|
||||
print(f"Failed to read image: {input_path}")
|
||||
|
||||
def process_images(input_dir, output_dir,gamma,threshold,no_auto_bright,config=None):
|
||||
all_files = []
|
||||
# with tqdm(total=len(all_files), desc="Processing images", unit="file") as pbar:
|
||||
for root, dirs, files in os.walk(input_dir):
|
||||
for file in files:
|
||||
if file.lower().endswith(('.png', '.jpg', '.jpeg','.arw','.dng')):
|
||||
# print(file)
|
||||
input_path = os.path.join(root, file)
|
||||
output_subdir = os.path.join(output_dir, os.path.relpath(root, input_dir))
|
||||
|
||||
os.makedirs(output_subdir, exist_ok=True)
|
||||
if len(dirs) == 0 or dirs[0] == 'CaptureOne':
|
||||
# 图片目录 file为叶片图片
|
||||
forward = '-'.join(os.path.normpath(root).split('/')[-2:])
|
||||
else:
|
||||
# 机组目录 file为机组图片
|
||||
forward = os.path.normpath(root).split('/')[-1] + '-xxx'
|
||||
output_path = os.path.join(output_subdir, get_name(config,forward,file))
|
||||
all_files.append((input_path, output_path))
|
||||
# pbar.update(1)
|
||||
with tqdm(total=len(all_files), desc="Processing images", unit="file") as pbar:
|
||||
with ThreadPoolExecutor() as executor:
|
||||
futures = []
|
||||
for input_path, output_path in all_files:
|
||||
future = executor.submit(process_single_image, input_path, output_path, gamma, threshold,no_auto_bright,config)
|
||||
future.add_done_callback(lambda _: pbar.update(1))
|
||||
futures.append(future)
|
||||
for future in futures:
|
||||
future.result()
|
||||
|
||||
# if file.lower().endswith(('.arw','.dng')):
|
||||
# with rawpy.imread(input_path) as raw:
|
||||
# # 获取 RGB 图像数据
|
||||
# rgb_image = raw.postprocess(use_camera_wb=True, no_auto_bright=no_auto_bright, output_bps=16)
|
||||
# rgb_image = np.uint8(rgb_image / 256)
|
||||
#
|
||||
# if rgb_image is not None:
|
||||
# adjusted_image = adjust_highlights_shadows(rgb_image,gamma,threshold)
|
||||
# # 使用 Pillow 创建图像
|
||||
# image = Image.fromarray(adjusted_image)
|
||||
# image.save(os.path.splitext(output_path)[0]+'.JPG', 'JPEG', quality=100)
|
||||
# else:
|
||||
# print(f"Failed to read image: {input_path}")
|
||||
# else:
|
||||
# #image = cv2.imread(input_path)
|
||||
# image_pil = Image.open(input_path)
|
||||
# image = np.array(image_pil)
|
||||
# if image is not None:
|
||||
# adjusted_image = adjust_highlights_shadows(image, gamma,threshold)
|
||||
# images = Image.fromarray(adjusted_image)
|
||||
# images.save(output_path, 'JPEG', quality=100)
|
||||
# else:
|
||||
# print(f"Failed to read image: {input_path}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# input_dir = input("请输入处理图片路径: ")
|
||||
# output_dir = input("请输入保存图片路径: ")
|
||||
root = tk.Tk()
|
||||
root.withdraw() # 不显示主窗口
|
||||
# 打开文件选择对话框
|
||||
input_dir = filedialog.askdirectory(title="请选择需要处理图片的文件夹,将会处理此文件夹中所有图片")
|
||||
#output_dir = filedialog.askdirectory(title="请选择处理后保存的文件夹,处理后与处理前文件命名与路径相同")
|
||||
output_dir = input_dir+"+调整"
|
||||
|
||||
# if not os.path.exists(output_dir):
|
||||
# os.makedirs(output_dir,exist_ok=True)
|
||||
|
||||
# gamma = float(input("请输入筛选阴影区阈值(0~255),建议120~200,优先160,若阴影亮度调高效果不明显可以调大值: "))
|
||||
# threshold = float(input("请输入筛选爆光区阈值(0~255),建议240~254,优先245,若曝光区亮度降低不明显或区域较大可以调小: "))
|
||||
gamma = 180
|
||||
threshold = 253
|
||||
no_auto_bright = False
|
||||
process_images(input_dir, output_dir,gamma,threshold,no_auto_bright)
|
||||
print("处理完成,输出路径:", output_dir)
|
|
@ -0,0 +1,114 @@
|
|||
# Depth Anything V2 for Metric Depth Estimation
|
||||
|
||||

|
||||
|
||||
We here provide a simple codebase to fine-tune our Depth Anything V2 pre-trained encoder for metric depth estimation. Built on our powerful encoder, we use a simple DPT head to regress the depth. We fine-tune our pre-trained encoder on synthetic Hypersim / Virtual KITTI datasets for indoor / outdoor metric depth estimation, respectively.
|
||||
|
||||
|
||||
# Pre-trained Models
|
||||
|
||||
We provide **six metric depth models** of three scales for indoor and outdoor scenes, respectively.
|
||||
|
||||
| Base Model | Params | Indoor (Hypersim) | Outdoor (Virtual KITTI 2) |
|
||||
|:-|-:|:-:|:-:|
|
||||
| Depth-Anything-V2-Small | 24.8M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Small/resolve/main/depth_anything_v2_metric_hypersim_vits.pth?download=true) | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Small/resolve/main/depth_anything_v2_metric_vkitti_vits.pth?download=true) |
|
||||
| Depth-Anything-V2-Base | 97.5M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Base/resolve/main/depth_anything_v2_metric_hypersim_vitb.pth?download=true) | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Base/resolve/main/depth_anything_v2_metric_vkitti_vitb.pth?download=true) |
|
||||
| Depth-Anything-V2-Large | 335.3M | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-Hypersim-Large/resolve/main/depth_anything_v2_metric_hypersim_vitl.pth?download=true) | [Download](https://huggingface.co/depth-anything/Depth-Anything-V2-Metric-VKITTI-Large/resolve/main/depth_anything_v2_metric_vkitti_vitl.pth?download=true) |
|
||||
|
||||
*We recommend to first try our larger models (if computational cost is affordable) and the indoor version.*
|
||||
|
||||
## Usage
|
||||
|
||||
### Prepraration
|
||||
|
||||
```bash
|
||||
git clone https://github.com/DepthAnything/Depth-Anything-V2
|
||||
cd Depth-Anything-V2/metric_depth
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Download the checkpoints listed [here](#pre-trained-models) and put them under the `checkpoints` directory.
|
||||
|
||||
### Use our models
|
||||
```python
|
||||
import cv2
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]}
|
||||
}
|
||||
|
||||
encoder = 'vitl' # or 'vits', 'vitb'
|
||||
dataset = 'hypersim' # 'hypersim' for indoor model, 'vkitti' for outdoor model
|
||||
max_depth = 20 # 20 for indoor model, 80 for outdoor model
|
||||
|
||||
model = DepthAnythingV2(**{**model_configs[encoder], 'max_depth': max_depth})
|
||||
model.load_state_dict(torch.load(f'checkpoints/depth_anything_v2_metric_{dataset}_{encoder}.pth', map_location='cpu'))
|
||||
model.eval()
|
||||
|
||||
raw_img = cv2.imread('your/image/path')
|
||||
depth = model.infer_image(raw_img) # HxW depth map in meters in numpy
|
||||
```
|
||||
|
||||
### Running script on images
|
||||
|
||||
Here, we take the `vitl` encoder as an example. You can also use `vitb` or `vits` encoders.
|
||||
|
||||
```bash
|
||||
# indoor scenes
|
||||
python run.py \
|
||||
--encoder vitl \
|
||||
--load-from checkpoints/depth_anything_v2_metric_hypersim_vitl.pth \
|
||||
--max-depth 20 \
|
||||
--img-path <path> --outdir <outdir> [--input-size <size>] [--save-numpy]
|
||||
|
||||
# outdoor scenes
|
||||
python run.py \
|
||||
--encoder vitl \
|
||||
--load-from checkpoints/depth_anything_v2_metric_vkitti_vitl.pth \
|
||||
--max-depth 80 \
|
||||
--img-path <path> --outdir <outdir> [--input-size <size>] [--save-numpy]
|
||||
```
|
||||
|
||||
### Project 2D images to point clouds:
|
||||
|
||||
```bash
|
||||
python depth_to_pointcloud.py \
|
||||
--encoder vitl \
|
||||
--load-from checkpoints/depth_anything_v2_metric_hypersim_vitl.pth \
|
||||
--max-depth 20 \
|
||||
--img-path <path> --outdir <outdir>
|
||||
```
|
||||
|
||||
### Reproduce training
|
||||
|
||||
Please first prepare the [Hypersim](https://github.com/apple/ml-hypersim) and [Virtual KITTI 2](https://europe.naverlabs.com/research/computer-vision/proxy-virtual-worlds-vkitti-2/) datasets. Then:
|
||||
|
||||
```bash
|
||||
bash dist_train.sh
|
||||
```
|
||||
|
||||
|
||||
## Citation
|
||||
|
||||
If you find this project useful, please consider citing:
|
||||
|
||||
```bibtex
|
||||
@article{depth_anything_v2,
|
||||
title={Depth Anything V2},
|
||||
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Zhao, Zhen and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
|
||||
journal={arXiv:2406.09414},
|
||||
year={2024}
|
||||
}
|
||||
|
||||
@inproceedings{depth_anything_v1,
|
||||
title={Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data},
|
||||
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
|
||||
booktitle={CVPR},
|
||||
year={2024}
|
||||
}
|
||||
```
|
Binary file not shown.
After Width: | Height: | Size: 8.8 MiB |
|
@ -0,0 +1,74 @@
|
|||
import cv2
|
||||
import h5py
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.utils.data import Dataset
|
||||
from torchvision.transforms import Compose
|
||||
|
||||
from dataset.transform import Resize, NormalizeImage, PrepareForNet, Crop
|
||||
|
||||
|
||||
def hypersim_distance_to_depth(npyDistance):
|
||||
intWidth, intHeight, fltFocal = 1024, 768, 886.81
|
||||
|
||||
npyImageplaneX = np.linspace((-0.5 * intWidth) + 0.5, (0.5 * intWidth) - 0.5, intWidth).reshape(
|
||||
1, intWidth).repeat(intHeight, 0).astype(np.float32)[:, :, None]
|
||||
npyImageplaneY = np.linspace((-0.5 * intHeight) + 0.5, (0.5 * intHeight) - 0.5,
|
||||
intHeight).reshape(intHeight, 1).repeat(intWidth, 1).astype(np.float32)[:, :, None]
|
||||
npyImageplaneZ = np.full([intHeight, intWidth, 1], fltFocal, np.float32)
|
||||
npyImageplane = np.concatenate(
|
||||
[npyImageplaneX, npyImageplaneY, npyImageplaneZ], 2)
|
||||
|
||||
npyDepth = npyDistance / np.linalg.norm(npyImageplane, 2, 2) * fltFocal
|
||||
return npyDepth
|
||||
|
||||
|
||||
class Hypersim(Dataset):
|
||||
def __init__(self, filelist_path, mode, size=(518, 518)):
|
||||
|
||||
self.mode = mode
|
||||
self.size = size
|
||||
|
||||
with open(filelist_path, 'r') as f:
|
||||
self.filelist = f.read().splitlines()
|
||||
|
||||
net_w, net_h = size
|
||||
self.transform = Compose([
|
||||
Resize(
|
||||
width=net_w,
|
||||
height=net_h,
|
||||
resize_target=True if mode == 'train' else False,
|
||||
keep_aspect_ratio=True,
|
||||
ensure_multiple_of=14,
|
||||
resize_method='lower_bound',
|
||||
image_interpolation_method=cv2.INTER_CUBIC,
|
||||
),
|
||||
NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
||||
PrepareForNet(),
|
||||
] + ([Crop(size[0])] if self.mode == 'train' else []))
|
||||
|
||||
def __getitem__(self, item):
|
||||
img_path = self.filelist[item].split(' ')[0]
|
||||
depth_path = self.filelist[item].split(' ')[1]
|
||||
|
||||
image = cv2.imread(img_path)
|
||||
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) / 255.0
|
||||
|
||||
depth_fd = h5py.File(depth_path, "r")
|
||||
distance_meters = np.array(depth_fd['dataset'])
|
||||
depth = hypersim_distance_to_depth(distance_meters)
|
||||
|
||||
sample = self.transform({'image': image, 'depth': depth})
|
||||
|
||||
sample['image'] = torch.from_numpy(sample['image'])
|
||||
sample['depth'] = torch.from_numpy(sample['depth'])
|
||||
|
||||
sample['valid_mask'] = (torch.isnan(sample['depth']) == 0)
|
||||
sample['depth'][sample['valid_mask'] == 0] = 0
|
||||
|
||||
sample['image_path'] = self.filelist[item].split(' ')[0]
|
||||
|
||||
return sample
|
||||
|
||||
def __len__(self):
|
||||
return len(self.filelist)
|
|
@ -0,0 +1,57 @@
|
|||
import cv2
|
||||
import torch
|
||||
from torch.utils.data import Dataset
|
||||
from torchvision.transforms import Compose
|
||||
|
||||
from dataset.transform import Resize, NormalizeImage, PrepareForNet
|
||||
|
||||
|
||||
class KITTI(Dataset):
|
||||
def __init__(self, filelist_path, mode, size=(518, 518)):
|
||||
if mode != 'val':
|
||||
raise NotImplementedError
|
||||
|
||||
self.mode = mode
|
||||
self.size = size
|
||||
|
||||
with open(filelist_path, 'r') as f:
|
||||
self.filelist = f.read().splitlines()
|
||||
|
||||
net_w, net_h = size
|
||||
self.transform = Compose([
|
||||
Resize(
|
||||
width=net_w,
|
||||
height=net_h,
|
||||
resize_target=True if mode == 'train' else False,
|
||||
keep_aspect_ratio=True,
|
||||
ensure_multiple_of=14,
|
||||
resize_method='lower_bound',
|
||||
image_interpolation_method=cv2.INTER_CUBIC,
|
||||
),
|
||||
NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
||||
PrepareForNet(),
|
||||
])
|
||||
|
||||
def __getitem__(self, item):
|
||||
img_path = self.filelist[item].split(' ')[0]
|
||||
depth_path = self.filelist[item].split(' ')[1]
|
||||
|
||||
image = cv2.imread(img_path)
|
||||
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) / 255.0
|
||||
|
||||
depth = cv2.imread(depth_path, cv2.IMREAD_UNCHANGED).astype('float32')
|
||||
|
||||
sample = self.transform({'image': image, 'depth': depth})
|
||||
|
||||
sample['image'] = torch.from_numpy(sample['image'])
|
||||
sample['depth'] = torch.from_numpy(sample['depth'])
|
||||
sample['depth'] = sample['depth'] / 256.0 # convert in meters
|
||||
|
||||
sample['valid_mask'] = sample['depth'] > 0
|
||||
|
||||
sample['image_path'] = self.filelist[item].split(' ')[0]
|
||||
|
||||
return sample
|
||||
|
||||
def __len__(self):
|
||||
return len(self.filelist)
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,652 @@
|
|||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000069.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000069.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000054.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000054.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000057.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000057.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000030.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000030.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000027.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000027.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000012.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000012.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000015.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000015.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000039.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000039.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000009.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000009.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000051.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000051.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000060.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000060.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000021.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000021.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000024.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000024.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000045.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000045.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000018.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000018.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000006.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000006.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0002_sync/image_02/data/0000000063.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0002_sync/proj_depth/groundtruth/image_02/0000000063.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000016.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000016.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000032.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000032.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000064.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000064.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000080.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000080.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000096.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000096.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000112.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000112.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000128.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000128.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000144.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000144.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000160.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000160.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000176.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000176.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000196.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000196.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000212.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000212.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000228.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000228.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000244.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000244.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000260.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000260.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000276.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000276.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000292.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000292.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000308.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000308.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000324.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000324.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000340.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000340.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000356.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000356.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000372.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000372.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0009_sync/image_02/data/0000000388.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0009_sync/proj_depth/groundtruth/image_02/0000000388.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000090.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000090.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000050.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000050.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000110.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000110.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000115.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000115.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000060.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000060.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000105.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000105.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000125.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000125.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000020.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000020.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000085.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000085.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000080.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000080.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000065.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000065.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000095.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000095.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000130.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000130.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000100.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000100.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000010.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000010.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000030.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000030.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000135.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000135.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000040.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000040.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000005.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000005.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000120.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000120.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000045.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000045.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0013_sync/image_02/data/0000000035.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0013_sync/proj_depth/groundtruth/image_02/0000000035.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000069.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000069.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000057.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000057.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000012.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000012.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000072.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000072.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000018.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000018.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000063.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000063.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000015.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000015.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000066.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000066.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000006.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000006.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000060.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000060.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000009.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000009.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000021.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000021.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000075.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000075.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000027.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000027.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000045.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000045.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000078.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000078.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000051.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000051.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000054.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000054.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0020_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0020_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000018.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000018.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000090.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000090.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000126.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000126.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000378.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000378.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000288.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000288.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000198.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000198.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000450.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000450.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000144.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000144.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000072.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000072.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000252.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000252.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000180.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000180.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000432.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000432.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000396.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000396.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000054.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000054.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000468.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000468.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000306.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000306.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000108.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000108.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000162.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000162.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000342.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000342.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000270.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000270.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000414.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000414.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000216.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000216.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000360.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000360.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0023_sync/image_02/data/0000000324.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0023_sync/proj_depth/groundtruth/image_02/0000000324.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000077.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000077.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000035.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000035.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000091.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000091.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000112.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000112.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000007.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000007.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000175.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000175.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000098.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000098.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000133.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000133.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000161.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000161.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000014.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000014.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000126.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000126.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000168.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000168.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000084.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000084.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000140.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000140.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000049.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000049.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000182.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000182.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000147.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000147.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000056.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000056.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000063.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000063.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000021.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000021.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000119.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000119.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0027_sync/image_02/data/0000000028.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0027_sync/proj_depth/groundtruth/image_02/0000000028.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000380.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000380.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000394.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000394.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000324.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000324.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000268.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000268.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000366.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000366.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000296.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000296.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000014.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000014.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000028.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000028.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000182.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000182.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000168.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000168.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000196.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000196.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000140.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000140.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000084.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000084.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000056.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000056.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000112.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000112.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000352.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000352.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000126.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000126.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000310.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000310.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000154.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000154.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000098.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000098.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000408.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000408.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0029_sync/image_02/data/0000000338.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0029_sync/proj_depth/groundtruth/image_02/0000000338.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000128.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000128.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000192.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000192.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000032.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000032.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000352.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000352.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000608.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000608.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000224.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000224.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000576.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000576.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000672.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000672.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000064.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000064.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000448.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000448.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000704.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000704.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000640.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000640.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000512.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000512.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000768.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000768.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000160.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000160.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000416.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000416.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000480.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000480.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000288.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000288.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000544.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000544.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000096.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000096.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000384.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000384.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000256.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000256.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0036_sync/image_02/data/0000000320.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_26_drive_0036_sync/proj_depth/groundtruth/image_02/0000000320.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000005.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000005.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000010.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000010.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000015.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000015.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000020.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000020.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000025.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000025.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000030.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000030.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000035.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000035.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000040.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000040.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000045.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000045.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000050.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000050.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000055.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000055.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000060.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000060.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000065.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000065.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000075.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000075.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000080.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000080.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000085.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000085.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000090.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000090.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000095.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000095.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000100.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000100.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000105.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000105.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000110.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000110.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0046_sync/image_02/data/0000000115.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0046_sync/proj_depth/groundtruth/image_02/0000000115.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000005.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000005.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000006.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000006.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000007.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000007.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000008.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000008.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000009.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000009.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000010.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000010.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000011.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000011.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000012.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000012.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000013.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000013.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000014.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000014.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000015.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000015.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0048_sync/image_02/data/0000000016.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0048_sync/proj_depth/groundtruth/image_02/0000000016.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000046.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000046.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000014.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000014.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000028.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000028.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000026.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000026.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000050.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000050.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000040.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000040.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000008.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000008.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000016.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000016.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000044.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000044.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000018.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000018.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000032.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000032.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000010.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000010.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000020.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000020.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000052.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000052.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000006.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000006.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000030.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000030.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000012.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000012.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000038.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000038.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0052_sync/image_02/data/0000000022.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0052_sync/proj_depth/groundtruth/image_02/0000000022.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000011.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000011.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000242.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000242.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000253.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000253.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000286.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000286.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000154.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000154.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000099.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000099.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000220.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000220.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000022.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000022.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000077.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000077.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000187.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000187.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000143.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000143.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000066.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000066.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000176.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000176.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000110.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000110.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000275.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000275.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000264.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000264.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000198.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000198.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000055.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000055.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000088.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000088.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000121.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000121.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000209.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000209.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000165.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000165.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000231.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000231.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0056_sync/image_02/data/0000000044.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0056_sync/proj_depth/groundtruth/image_02/0000000044.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000056.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000056.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000344.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000344.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000358.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000358.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000316.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000316.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000238.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000238.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000098.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000098.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000112.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000112.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000028.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000028.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000014.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000014.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000330.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000330.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000154.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000154.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000042.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000042.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000302.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000302.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000182.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000182.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000288.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000288.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000140.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000140.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000274.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000274.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000224.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000224.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000196.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000196.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000126.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000126.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000084.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000084.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000210.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000210.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0059_sync/image_02/data/0000000070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0059_sync/proj_depth/groundtruth/image_02/0000000070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000528.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000528.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000308.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000308.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000044.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000044.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000352.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000352.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000066.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000066.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000506.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000506.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000176.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000176.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000022.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000022.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000242.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000242.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000462.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000462.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000418.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000418.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000110.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000110.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000440.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000440.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000396.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000396.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000154.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000154.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000374.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000374.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000088.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000088.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000286.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000286.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000550.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000550.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000264.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000264.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000220.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000220.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000330.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000330.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000484.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000484.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0064_sync/image_02/data/0000000198.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0064_sync/proj_depth/groundtruth/image_02/0000000198.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000283.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000283.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000361.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000361.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000270.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000270.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000127.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000127.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000205.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000205.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000218.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000218.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000153.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000153.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000335.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000335.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000192.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000192.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000348.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000348.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000101.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000101.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000049.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000049.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000179.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000179.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000140.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000140.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000374.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000374.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000322.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000322.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000309.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000309.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000244.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000244.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000062.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000062.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000257.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000257.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000088.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000088.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000114.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000114.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000075.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000075.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000296.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000296.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0084_sync/image_02/data/0000000231.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0084_sync/proj_depth/groundtruth/image_02/0000000231.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000007.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000007.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000196.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000196.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000439.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000439.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000169.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000169.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000115.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000115.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000034.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000034.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000304.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000304.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000331.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000331.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000277.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000277.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000520.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000520.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000682.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000682.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000628.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000628.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000088.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000088.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000601.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000601.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000574.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000574.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000223.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000223.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000655.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000655.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000358.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000358.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000412.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000412.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000142.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000142.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000385.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000385.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000061.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000061.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000493.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000493.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000466.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000466.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0086_sync/image_02/data/0000000250.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0086_sync/proj_depth/groundtruth/image_02/0000000250.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000016.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000016.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000032.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000032.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000064.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000064.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000080.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000080.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000096.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000096.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000112.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000112.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000128.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000128.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000144.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000144.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000160.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000160.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000176.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000176.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000192.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000192.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000208.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000208.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000224.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000224.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000240.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000240.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000256.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000256.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000305.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000305.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000321.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000321.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000337.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000337.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000353.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000353.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000369.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000369.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000385.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000385.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000401.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000401.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0093_sync/image_02/data/0000000417.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0093_sync/proj_depth/groundtruth/image_02/0000000417.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000019.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000019.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000038.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000038.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000057.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000057.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000076.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000076.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000095.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000095.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000114.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000114.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000133.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000133.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000152.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000152.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000171.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000171.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000190.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000190.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000209.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000209.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000228.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000228.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000247.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000247.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000266.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000266.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000285.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000285.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000304.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000304.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000323.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000323.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000342.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000342.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000361.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000361.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000380.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000380.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000399.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000399.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000418.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000418.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000437.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000437.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0096_sync/image_02/data/0000000456.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0096_sync/proj_depth/groundtruth/image_02/0000000456.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000692.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000692.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000930.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000930.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000760.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000760.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000896.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000896.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000284.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000284.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000148.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000148.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000522.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000522.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000794.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000794.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000624.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000624.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000726.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000726.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000216.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000216.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000318.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000318.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000488.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000488.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000590.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000590.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000454.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000454.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000862.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000862.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000386.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000386.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000352.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000352.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000420.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000420.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000658.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000658.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000828.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000828.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000556.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000556.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000114.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000114.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000182.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000182.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0101_sync/image_02/data/0000000080.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0101_sync/proj_depth/groundtruth/image_02/0000000080.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000015.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000015.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000035.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000035.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000043.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000043.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000051.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000051.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000059.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000059.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000067.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000067.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000075.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000075.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000083.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000083.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000091.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000091.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000099.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000099.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000107.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000107.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000115.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000115.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000123.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000123.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000131.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000131.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000139.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000139.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000147.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000147.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000155.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000155.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000163.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000163.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000171.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000171.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000179.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000179.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000187.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000187.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000195.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000195.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000203.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000203.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000211.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000211.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0106_sync/image_02/data/0000000219.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0106_sync/proj_depth/groundtruth/image_02/0000000219.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000312.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000312.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000494.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000494.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000104.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000104.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000130.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000130.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000156.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000156.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000182.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000182.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000598.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000598.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000416.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000416.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000364.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000364.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000026.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000026.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000078.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000078.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000572.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000572.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000468.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000468.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000260.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000260.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000624.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000624.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000234.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000234.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000442.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000442.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000390.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000390.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000546.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000546.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000286.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000286.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000338.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000338.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000208.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000208.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000650.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000650.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_26/2011_09_26_drive_0117_sync/image_02/data/0000000052.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_26_drive_0117_sync/proj_depth/groundtruth/image_02/0000000052.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000024.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000024.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000021.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000021.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000051.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000051.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000018.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000018.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000090.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000090.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000045.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000045.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000054.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000054.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000012.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000012.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000039.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000039.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000009.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000009.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000030.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000030.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000078.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000078.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000060.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000060.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000048.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000048.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000084.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000084.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000081.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000081.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000006.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000006.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000057.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000057.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000072.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000072.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000087.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000087.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_28/2011_09_28_drive_0002_sync/image_02/data/0000000063.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_28_drive_0002_sync/proj_depth/groundtruth/image_02/0000000063.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000252.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000252.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000540.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000540.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000036.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000036.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000360.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000360.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000807.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000807.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000879.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000879.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000288.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000288.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000771.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000771.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000216.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000216.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000951.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000951.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000324.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000324.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000432.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000432.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000504.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000504.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000576.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000576.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000108.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000108.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000180.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000180.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000072.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000072.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000612.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000612.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000915.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000915.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000735.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000735.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000144.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000144.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000396.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000396.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_29/2011_09_29_drive_0071_sync/image_02/data/0000000468.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_29_drive_0071_sync/proj_depth/groundtruth/image_02/0000000468.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000132.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000132.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000011.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000011.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000154.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000154.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000022.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000022.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000242.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000242.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000198.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000198.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000176.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000176.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000231.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000231.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000220.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000220.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000088.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000088.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000143.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000143.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000055.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000055.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000187.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000187.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000110.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000110.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000044.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000044.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000077.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000077.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000066.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000066.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000165.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000165.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000264.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000264.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000253.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000253.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000209.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000209.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0016_sync/image_02/data/0000000121.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_09_30_drive_0016_sync/proj_depth/groundtruth/image_02/0000000121.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000107.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000107.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002247.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002247.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001391.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001391.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000535.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000535.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001819.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001819.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001177.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001177.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000428.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000428.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001926.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001926.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000749.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000749.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001284.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001284.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002140.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002140.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001605.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001605.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001498.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001498.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000642.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000642.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002740.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002740.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002419.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002419.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000856.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000856.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002526.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002526.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001712.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001712.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000001070.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000001070.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002033.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002033.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000214.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000214.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000000963.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000000963.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0018_sync/image_02/data/0000002633.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0018_sync/proj_depth/groundtruth/image_02/0000002633.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000533.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000533.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000001040.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000001040.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000082.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000082.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000205.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000205.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000835.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000835.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000451.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000451.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000164.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000164.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000794.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000794.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000328.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000328.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000615.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000615.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000917.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000917.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000369.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000369.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000287.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000287.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000123.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000123.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000876.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000876.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000410.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000410.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000492.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000492.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000958.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000958.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000656.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000656.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000753.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000753.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000574.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000574.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000001081.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000001081.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000041.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000041.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_09_30/2011_09_30_drive_0027_sync/image_02/data/0000000246.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_09_30_drive_0027_sync/proj_depth/groundtruth/image_02/0000000246.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000002906.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000002906.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000002544.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000002544.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000000362.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000000362.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000004535.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000004535.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000000734.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000000734.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000001096.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000001096.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000004173.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000004173.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000000543.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000000543.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000001277.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000001277.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000004354.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000004354.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000001458.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000001458.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000001820.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000001820.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003449.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003449.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003268.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003268.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000000915.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000000915.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000002363.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000002363.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000002725.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000002725.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000000181.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000000181.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000001639.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000001639.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003992.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003992.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003087.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003087.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000002001.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000002001.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003811.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003811.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0027_sync/image_02/data/0000003630.png /mnt/bn/liheyang/Kitti/data_depth_annotated/train/2011_10_03_drive_0027_sync/proj_depth/groundtruth/image_02/0000003630.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000096.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000096.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000800.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000800.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000320.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000320.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000576.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000576.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000480.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000480.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000640.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000640.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000032.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000032.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000384.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000384.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000160.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000160.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000704.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000704.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000736.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000736.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000672.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000672.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000064.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000064.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000288.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000288.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000352.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000352.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000512.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000512.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000544.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000544.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000608.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000608.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000128.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000128.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000224.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000224.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000416.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000416.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000192.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000192.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000448.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000448.png
|
||||
/mnt/bn/liheyang/Kitti/raw_data/2011_10_03/2011_10_03_drive_0047_sync/image_02/data/0000000768.png /mnt/bn/liheyang/Kitti/data_depth_annotated/val/2011_10_03_drive_0047_sync/proj_depth/groundtruth/image_02/0000000768.png
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,277 @@
|
|||
import cv2
|
||||
import math
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
||||
def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
|
||||
"""Rezise the sample to ensure the given size. Keeps aspect ratio.
|
||||
|
||||
Args:
|
||||
sample (dict): sample
|
||||
size (tuple): image size
|
||||
|
||||
Returns:
|
||||
tuple: new size
|
||||
"""
|
||||
shape = list(sample["disparity"].shape)
|
||||
|
||||
if shape[0] >= size[0] and shape[1] >= size[1]:
|
||||
return sample
|
||||
|
||||
scale = [0, 0]
|
||||
scale[0] = size[0] / shape[0]
|
||||
scale[1] = size[1] / shape[1]
|
||||
|
||||
scale = max(scale)
|
||||
|
||||
shape[0] = math.ceil(scale * shape[0])
|
||||
shape[1] = math.ceil(scale * shape[1])
|
||||
|
||||
# resize
|
||||
sample["image"] = cv2.resize(
|
||||
sample["image"], tuple(shape[::-1]), interpolation=image_interpolation_method
|
||||
)
|
||||
|
||||
sample["disparity"] = cv2.resize(
|
||||
sample["disparity"], tuple(shape[::-1]), interpolation=cv2.INTER_NEAREST
|
||||
)
|
||||
sample["mask"] = cv2.resize(
|
||||
sample["mask"].astype(np.float32),
|
||||
tuple(shape[::-1]),
|
||||
interpolation=cv2.INTER_NEAREST,
|
||||
)
|
||||
sample["mask"] = sample["mask"].astype(bool)
|
||||
|
||||
return tuple(shape)
|
||||
|
||||
|
||||
class Resize(object):
|
||||
"""Resize sample to given size (width, height).
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
width,
|
||||
height,
|
||||
resize_target=True,
|
||||
keep_aspect_ratio=False,
|
||||
ensure_multiple_of=1,
|
||||
resize_method="lower_bound",
|
||||
image_interpolation_method=cv2.INTER_AREA,
|
||||
):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
width (int): desired output width
|
||||
height (int): desired output height
|
||||
resize_target (bool, optional):
|
||||
True: Resize the full sample (image, mask, target).
|
||||
False: Resize image only.
|
||||
Defaults to True.
|
||||
keep_aspect_ratio (bool, optional):
|
||||
True: Keep the aspect ratio of the input sample.
|
||||
Output sample might not have the given width and height, and
|
||||
resize behaviour depends on the parameter 'resize_method'.
|
||||
Defaults to False.
|
||||
ensure_multiple_of (int, optional):
|
||||
Output width and height is constrained to be multiple of this parameter.
|
||||
Defaults to 1.
|
||||
resize_method (str, optional):
|
||||
"lower_bound": Output will be at least as large as the given size.
|
||||
"upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
|
||||
"minimal": Scale as least as possible. (Output size might be smaller than given size.)
|
||||
Defaults to "lower_bound".
|
||||
"""
|
||||
self.__width = width
|
||||
self.__height = height
|
||||
|
||||
self.__resize_target = resize_target
|
||||
self.__keep_aspect_ratio = keep_aspect_ratio
|
||||
self.__multiple_of = ensure_multiple_of
|
||||
self.__resize_method = resize_method
|
||||
self.__image_interpolation_method = image_interpolation_method
|
||||
|
||||
def constrain_to_multiple_of(self, x, min_val=0, max_val=None):
|
||||
y = (np.round(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if max_val is not None and y > max_val:
|
||||
y = (np.floor(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if y < min_val:
|
||||
y = (np.ceil(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
return y
|
||||
|
||||
def get_size(self, width, height):
|
||||
# determine new height and width
|
||||
scale_height = self.__height / height
|
||||
scale_width = self.__width / width
|
||||
|
||||
if self.__keep_aspect_ratio:
|
||||
if self.__resize_method == "lower_bound":
|
||||
# scale such that output size is lower bound
|
||||
if scale_width > scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "upper_bound":
|
||||
# scale such that output size is upper bound
|
||||
if scale_width < scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "minimal":
|
||||
# scale as least as possbile
|
||||
if abs(1 - scale_width) < abs(1 - scale_height):
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
else:
|
||||
raise ValueError(
|
||||
f"resize_method {self.__resize_method} not implemented"
|
||||
)
|
||||
|
||||
if self.__resize_method == "lower_bound":
|
||||
new_height = self.constrain_to_multiple_of(
|
||||
scale_height * height, min_val=self.__height
|
||||
)
|
||||
new_width = self.constrain_to_multiple_of(
|
||||
scale_width * width, min_val=self.__width
|
||||
)
|
||||
elif self.__resize_method == "upper_bound":
|
||||
new_height = self.constrain_to_multiple_of(
|
||||
scale_height * height, max_val=self.__height
|
||||
)
|
||||
new_width = self.constrain_to_multiple_of(
|
||||
scale_width * width, max_val=self.__width
|
||||
)
|
||||
elif self.__resize_method == "minimal":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width)
|
||||
else:
|
||||
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
||||
|
||||
return (new_width, new_height)
|
||||
|
||||
def __call__(self, sample):
|
||||
width, height = self.get_size(
|
||||
sample["image"].shape[1], sample["image"].shape[0]
|
||||
)
|
||||
|
||||
# resize sample
|
||||
sample["image"] = cv2.resize(
|
||||
sample["image"],
|
||||
(width, height),
|
||||
interpolation=self.__image_interpolation_method,
|
||||
)
|
||||
|
||||
if self.__resize_target:
|
||||
if "disparity" in sample:
|
||||
sample["disparity"] = cv2.resize(
|
||||
sample["disparity"],
|
||||
(width, height),
|
||||
interpolation=cv2.INTER_NEAREST,
|
||||
)
|
||||
|
||||
if "depth" in sample:
|
||||
sample["depth"] = cv2.resize(
|
||||
sample["depth"], (width, height), interpolation=cv2.INTER_NEAREST
|
||||
)
|
||||
|
||||
if "semseg_mask" in sample:
|
||||
# sample["semseg_mask"] = cv2.resize(
|
||||
# sample["semseg_mask"], (width, height), interpolation=cv2.INTER_NEAREST
|
||||
# )
|
||||
sample["semseg_mask"] = F.interpolate(torch.from_numpy(sample["semseg_mask"]).float()[None, None, ...], (height, width), mode='nearest').numpy()[0, 0]
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = cv2.resize(
|
||||
sample["mask"].astype(np.float32),
|
||||
(width, height),
|
||||
interpolation=cv2.INTER_NEAREST,
|
||||
)
|
||||
# sample["mask"] = sample["mask"].astype(bool)
|
||||
|
||||
# print(sample['image'].shape, sample['depth'].shape)
|
||||
return sample
|
||||
|
||||
|
||||
class NormalizeImage(object):
|
||||
"""Normlize image by given mean and std.
|
||||
"""
|
||||
|
||||
def __init__(self, mean, std):
|
||||
self.__mean = mean
|
||||
self.__std = std
|
||||
|
||||
def __call__(self, sample):
|
||||
sample["image"] = (sample["image"] - self.__mean) / self.__std
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class PrepareForNet(object):
|
||||
"""Prepare sample for usage as network input.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def __call__(self, sample):
|
||||
image = np.transpose(sample["image"], (2, 0, 1))
|
||||
sample["image"] = np.ascontiguousarray(image).astype(np.float32)
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = sample["mask"].astype(np.float32)
|
||||
sample["mask"] = np.ascontiguousarray(sample["mask"])
|
||||
|
||||
if "depth" in sample:
|
||||
depth = sample["depth"].astype(np.float32)
|
||||
sample["depth"] = np.ascontiguousarray(depth)
|
||||
|
||||
if "semseg_mask" in sample:
|
||||
sample["semseg_mask"] = sample["semseg_mask"].astype(np.float32)
|
||||
sample["semseg_mask"] = np.ascontiguousarray(sample["semseg_mask"])
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class Crop(object):
|
||||
"""Crop sample for batch-wise training. Image is of shape CxHxW
|
||||
"""
|
||||
|
||||
def __init__(self, size):
|
||||
if isinstance(size, int):
|
||||
self.size = (size, size)
|
||||
else:
|
||||
self.size = size
|
||||
|
||||
def __call__(self, sample):
|
||||
h, w = sample['image'].shape[-2:]
|
||||
assert h >= self.size[0] and w >= self.size[1], 'Wrong size'
|
||||
|
||||
h_start = np.random.randint(0, h - self.size[0] + 1)
|
||||
w_start = np.random.randint(0, w - self.size[1] + 1)
|
||||
h_end = h_start + self.size[0]
|
||||
w_end = w_start + self.size[1]
|
||||
|
||||
sample['image'] = sample['image'][:, h_start: h_end, w_start: w_end]
|
||||
|
||||
if "depth" in sample:
|
||||
sample["depth"] = sample["depth"][h_start: h_end, w_start: w_end]
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = sample["mask"][h_start: h_end, w_start: w_end]
|
||||
|
||||
if "semseg_mask" in sample:
|
||||
sample["semseg_mask"] = sample["semseg_mask"][h_start: h_end, w_start: w_end]
|
||||
|
||||
return sample
|
|
@ -0,0 +1,54 @@
|
|||
import cv2
|
||||
import torch
|
||||
from torch.utils.data import Dataset
|
||||
from torchvision.transforms import Compose
|
||||
|
||||
from dataset.transform import Resize, NormalizeImage, PrepareForNet, Crop
|
||||
|
||||
|
||||
class VKITTI2(Dataset):
|
||||
def __init__(self, filelist_path, mode, size=(518, 518)):
|
||||
|
||||
self.mode = mode
|
||||
self.size = size
|
||||
|
||||
with open(filelist_path, 'r') as f:
|
||||
self.filelist = f.read().splitlines()
|
||||
|
||||
net_w, net_h = size
|
||||
self.transform = Compose([
|
||||
Resize(
|
||||
width=net_w,
|
||||
height=net_h,
|
||||
resize_target=True if mode == 'train' else False,
|
||||
keep_aspect_ratio=True,
|
||||
ensure_multiple_of=14,
|
||||
resize_method='lower_bound',
|
||||
image_interpolation_method=cv2.INTER_CUBIC,
|
||||
),
|
||||
NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
||||
PrepareForNet(),
|
||||
] + ([Crop(size[0])] if self.mode == 'train' else []))
|
||||
|
||||
def __getitem__(self, item):
|
||||
img_path = self.filelist[item].split(' ')[0]
|
||||
depth_path = self.filelist[item].split(' ')[1]
|
||||
|
||||
image = cv2.imread(img_path)
|
||||
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) / 255.0
|
||||
|
||||
depth = cv2.imread(depth_path, cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) / 100.0 # cm to m
|
||||
|
||||
sample = self.transform({'image': image, 'depth': depth})
|
||||
|
||||
sample['image'] = torch.from_numpy(sample['image'])
|
||||
sample['depth'] = torch.from_numpy(sample['depth'])
|
||||
|
||||
sample['valid_mask'] = (sample['depth'] <= 80)
|
||||
|
||||
sample['image_path'] = self.filelist[item].split(' ')[0]
|
||||
|
||||
return sample
|
||||
|
||||
def __len__(self):
|
||||
return len(self.filelist)
|
|
@ -0,0 +1,415 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the Apache License, Version 2.0
|
||||
# found in the LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/main/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/models/vision_transformer.py
|
||||
|
||||
from functools import partial
|
||||
import math
|
||||
import logging
|
||||
from typing import Sequence, Tuple, Union, Callable
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.utils.checkpoint
|
||||
from torch.nn.init import trunc_normal_
|
||||
|
||||
from .dinov2_layers import Mlp, PatchEmbed, SwiGLUFFNFused, MemEffAttention, NestedTensorBlock as Block
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
def named_apply(fn: Callable, module: nn.Module, name="", depth_first=True, include_root=False) -> nn.Module:
|
||||
if not depth_first and include_root:
|
||||
fn(module=module, name=name)
|
||||
for child_name, child_module in module.named_children():
|
||||
child_name = ".".join((name, child_name)) if name else child_name
|
||||
named_apply(fn=fn, module=child_module, name=child_name, depth_first=depth_first, include_root=True)
|
||||
if depth_first and include_root:
|
||||
fn(module=module, name=name)
|
||||
return module
|
||||
|
||||
|
||||
class BlockChunk(nn.ModuleList):
|
||||
def forward(self, x):
|
||||
for b in self:
|
||||
x = b(x)
|
||||
return x
|
||||
|
||||
|
||||
class DinoVisionTransformer(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
img_size=224,
|
||||
patch_size=16,
|
||||
in_chans=3,
|
||||
embed_dim=768,
|
||||
depth=12,
|
||||
num_heads=12,
|
||||
mlp_ratio=4.0,
|
||||
qkv_bias=True,
|
||||
ffn_bias=True,
|
||||
proj_bias=True,
|
||||
drop_path_rate=0.0,
|
||||
drop_path_uniform=False,
|
||||
init_values=None, # for layerscale: None or 0 => no layerscale
|
||||
embed_layer=PatchEmbed,
|
||||
act_layer=nn.GELU,
|
||||
block_fn=Block,
|
||||
ffn_layer="mlp",
|
||||
block_chunks=1,
|
||||
num_register_tokens=0,
|
||||
interpolate_antialias=False,
|
||||
interpolate_offset=0.1,
|
||||
):
|
||||
"""
|
||||
Args:
|
||||
img_size (int, tuple): input image size
|
||||
patch_size (int, tuple): patch size
|
||||
in_chans (int): number of input channels
|
||||
embed_dim (int): embedding dimension
|
||||
depth (int): depth of transformer
|
||||
num_heads (int): number of attention heads
|
||||
mlp_ratio (int): ratio of mlp hidden dim to embedding dim
|
||||
qkv_bias (bool): enable bias for qkv if True
|
||||
proj_bias (bool): enable bias for proj in attn if True
|
||||
ffn_bias (bool): enable bias for ffn if True
|
||||
drop_path_rate (float): stochastic depth rate
|
||||
drop_path_uniform (bool): apply uniform drop rate across blocks
|
||||
weight_init (str): weight init scheme
|
||||
init_values (float): layer-scale init values
|
||||
embed_layer (nn.Module): patch embedding layer
|
||||
act_layer (nn.Module): MLP activation layer
|
||||
block_fn (nn.Module): transformer block class
|
||||
ffn_layer (str): "mlp", "swiglu", "swiglufused" or "identity"
|
||||
block_chunks: (int) split block sequence into block_chunks units for FSDP wrap
|
||||
num_register_tokens: (int) number of extra cls tokens (so-called "registers")
|
||||
interpolate_antialias: (str) flag to apply anti-aliasing when interpolating positional embeddings
|
||||
interpolate_offset: (float) work-around offset to apply when interpolating positional embeddings
|
||||
"""
|
||||
super().__init__()
|
||||
norm_layer = partial(nn.LayerNorm, eps=1e-6)
|
||||
|
||||
self.num_features = self.embed_dim = embed_dim # num_features for consistency with other models
|
||||
self.num_tokens = 1
|
||||
self.n_blocks = depth
|
||||
self.num_heads = num_heads
|
||||
self.patch_size = patch_size
|
||||
self.num_register_tokens = num_register_tokens
|
||||
self.interpolate_antialias = interpolate_antialias
|
||||
self.interpolate_offset = interpolate_offset
|
||||
|
||||
self.patch_embed = embed_layer(img_size=img_size, patch_size=patch_size, in_chans=in_chans, embed_dim=embed_dim)
|
||||
num_patches = self.patch_embed.num_patches
|
||||
|
||||
self.cls_token = nn.Parameter(torch.zeros(1, 1, embed_dim))
|
||||
self.pos_embed = nn.Parameter(torch.zeros(1, num_patches + self.num_tokens, embed_dim))
|
||||
assert num_register_tokens >= 0
|
||||
self.register_tokens = (
|
||||
nn.Parameter(torch.zeros(1, num_register_tokens, embed_dim)) if num_register_tokens else None
|
||||
)
|
||||
|
||||
if drop_path_uniform is True:
|
||||
dpr = [drop_path_rate] * depth
|
||||
else:
|
||||
dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth)] # stochastic depth decay rule
|
||||
|
||||
if ffn_layer == "mlp":
|
||||
logger.info("using MLP layer as FFN")
|
||||
ffn_layer = Mlp
|
||||
elif ffn_layer == "swiglufused" or ffn_layer == "swiglu":
|
||||
logger.info("using SwiGLU layer as FFN")
|
||||
ffn_layer = SwiGLUFFNFused
|
||||
elif ffn_layer == "identity":
|
||||
logger.info("using Identity layer as FFN")
|
||||
|
||||
def f(*args, **kwargs):
|
||||
return nn.Identity()
|
||||
|
||||
ffn_layer = f
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
blocks_list = [
|
||||
block_fn(
|
||||
dim=embed_dim,
|
||||
num_heads=num_heads,
|
||||
mlp_ratio=mlp_ratio,
|
||||
qkv_bias=qkv_bias,
|
||||
proj_bias=proj_bias,
|
||||
ffn_bias=ffn_bias,
|
||||
drop_path=dpr[i],
|
||||
norm_layer=norm_layer,
|
||||
act_layer=act_layer,
|
||||
ffn_layer=ffn_layer,
|
||||
init_values=init_values,
|
||||
)
|
||||
for i in range(depth)
|
||||
]
|
||||
if block_chunks > 0:
|
||||
self.chunked_blocks = True
|
||||
chunked_blocks = []
|
||||
chunksize = depth // block_chunks
|
||||
for i in range(0, depth, chunksize):
|
||||
# this is to keep the block index consistent if we chunk the block list
|
||||
chunked_blocks.append([nn.Identity()] * i + blocks_list[i : i + chunksize])
|
||||
self.blocks = nn.ModuleList([BlockChunk(p) for p in chunked_blocks])
|
||||
else:
|
||||
self.chunked_blocks = False
|
||||
self.blocks = nn.ModuleList(blocks_list)
|
||||
|
||||
self.norm = norm_layer(embed_dim)
|
||||
self.head = nn.Identity()
|
||||
|
||||
self.mask_token = nn.Parameter(torch.zeros(1, embed_dim))
|
||||
|
||||
self.init_weights()
|
||||
|
||||
def init_weights(self):
|
||||
trunc_normal_(self.pos_embed, std=0.02)
|
||||
nn.init.normal_(self.cls_token, std=1e-6)
|
||||
if self.register_tokens is not None:
|
||||
nn.init.normal_(self.register_tokens, std=1e-6)
|
||||
named_apply(init_weights_vit_timm, self)
|
||||
|
||||
def interpolate_pos_encoding(self, x, w, h):
|
||||
previous_dtype = x.dtype
|
||||
npatch = x.shape[1] - 1
|
||||
N = self.pos_embed.shape[1] - 1
|
||||
if npatch == N and w == h:
|
||||
return self.pos_embed
|
||||
pos_embed = self.pos_embed.float()
|
||||
class_pos_embed = pos_embed[:, 0]
|
||||
patch_pos_embed = pos_embed[:, 1:]
|
||||
dim = x.shape[-1]
|
||||
w0 = w // self.patch_size
|
||||
h0 = h // self.patch_size
|
||||
# we add a small number to avoid floating point error in the interpolation
|
||||
# see discussion at https://github.com/facebookresearch/dino/issues/8
|
||||
# DINOv2 with register modify the interpolate_offset from 0.1 to 0.0
|
||||
w0, h0 = w0 + self.interpolate_offset, h0 + self.interpolate_offset
|
||||
# w0, h0 = w0 + 0.1, h0 + 0.1
|
||||
|
||||
sqrt_N = math.sqrt(N)
|
||||
sx, sy = float(w0) / sqrt_N, float(h0) / sqrt_N
|
||||
patch_pos_embed = nn.functional.interpolate(
|
||||
patch_pos_embed.reshape(1, int(sqrt_N), int(sqrt_N), dim).permute(0, 3, 1, 2),
|
||||
scale_factor=(sx, sy),
|
||||
# (int(w0), int(h0)), # to solve the upsampling shape issue
|
||||
mode="bicubic",
|
||||
antialias=self.interpolate_antialias
|
||||
)
|
||||
|
||||
assert int(w0) == patch_pos_embed.shape[-2]
|
||||
assert int(h0) == patch_pos_embed.shape[-1]
|
||||
patch_pos_embed = patch_pos_embed.permute(0, 2, 3, 1).view(1, -1, dim)
|
||||
return torch.cat((class_pos_embed.unsqueeze(0), patch_pos_embed), dim=1).to(previous_dtype)
|
||||
|
||||
def prepare_tokens_with_masks(self, x, masks=None):
|
||||
B, nc, w, h = x.shape
|
||||
x = self.patch_embed(x)
|
||||
if masks is not None:
|
||||
x = torch.where(masks.unsqueeze(-1), self.mask_token.to(x.dtype).unsqueeze(0), x)
|
||||
|
||||
x = torch.cat((self.cls_token.expand(x.shape[0], -1, -1), x), dim=1)
|
||||
x = x + self.interpolate_pos_encoding(x, w, h)
|
||||
|
||||
if self.register_tokens is not None:
|
||||
x = torch.cat(
|
||||
(
|
||||
x[:, :1],
|
||||
self.register_tokens.expand(x.shape[0], -1, -1),
|
||||
x[:, 1:],
|
||||
),
|
||||
dim=1,
|
||||
)
|
||||
|
||||
return x
|
||||
|
||||
def forward_features_list(self, x_list, masks_list):
|
||||
x = [self.prepare_tokens_with_masks(x, masks) for x, masks in zip(x_list, masks_list)]
|
||||
for blk in self.blocks:
|
||||
x = blk(x)
|
||||
|
||||
all_x = x
|
||||
output = []
|
||||
for x, masks in zip(all_x, masks_list):
|
||||
x_norm = self.norm(x)
|
||||
output.append(
|
||||
{
|
||||
"x_norm_clstoken": x_norm[:, 0],
|
||||
"x_norm_regtokens": x_norm[:, 1 : self.num_register_tokens + 1],
|
||||
"x_norm_patchtokens": x_norm[:, self.num_register_tokens + 1 :],
|
||||
"x_prenorm": x,
|
||||
"masks": masks,
|
||||
}
|
||||
)
|
||||
return output
|
||||
|
||||
def forward_features(self, x, masks=None):
|
||||
if isinstance(x, list):
|
||||
return self.forward_features_list(x, masks)
|
||||
|
||||
x = self.prepare_tokens_with_masks(x, masks)
|
||||
|
||||
for blk in self.blocks:
|
||||
x = blk(x)
|
||||
|
||||
x_norm = self.norm(x)
|
||||
return {
|
||||
"x_norm_clstoken": x_norm[:, 0],
|
||||
"x_norm_regtokens": x_norm[:, 1 : self.num_register_tokens + 1],
|
||||
"x_norm_patchtokens": x_norm[:, self.num_register_tokens + 1 :],
|
||||
"x_prenorm": x,
|
||||
"masks": masks,
|
||||
}
|
||||
|
||||
def _get_intermediate_layers_not_chunked(self, x, n=1):
|
||||
x = self.prepare_tokens_with_masks(x)
|
||||
# If n is an int, take the n last blocks. If it's a list, take them
|
||||
output, total_block_len = [], len(self.blocks)
|
||||
blocks_to_take = range(total_block_len - n, total_block_len) if isinstance(n, int) else n
|
||||
for i, blk in enumerate(self.blocks):
|
||||
x = blk(x)
|
||||
if i in blocks_to_take:
|
||||
output.append(x)
|
||||
assert len(output) == len(blocks_to_take), f"only {len(output)} / {len(blocks_to_take)} blocks found"
|
||||
return output
|
||||
|
||||
def _get_intermediate_layers_chunked(self, x, n=1):
|
||||
x = self.prepare_tokens_with_masks(x)
|
||||
output, i, total_block_len = [], 0, len(self.blocks[-1])
|
||||
# If n is an int, take the n last blocks. If it's a list, take them
|
||||
blocks_to_take = range(total_block_len - n, total_block_len) if isinstance(n, int) else n
|
||||
for block_chunk in self.blocks:
|
||||
for blk in block_chunk[i:]: # Passing the nn.Identity()
|
||||
x = blk(x)
|
||||
if i in blocks_to_take:
|
||||
output.append(x)
|
||||
i += 1
|
||||
assert len(output) == len(blocks_to_take), f"only {len(output)} / {len(blocks_to_take)} blocks found"
|
||||
return output
|
||||
|
||||
def get_intermediate_layers(
|
||||
self,
|
||||
x: torch.Tensor,
|
||||
n: Union[int, Sequence] = 1, # Layers or n last layers to take
|
||||
reshape: bool = False,
|
||||
return_class_token: bool = False,
|
||||
norm=True
|
||||
) -> Tuple[Union[torch.Tensor, Tuple[torch.Tensor]]]:
|
||||
if self.chunked_blocks:
|
||||
outputs = self._get_intermediate_layers_chunked(x, n)
|
||||
else:
|
||||
outputs = self._get_intermediate_layers_not_chunked(x, n)
|
||||
if norm:
|
||||
outputs = [self.norm(out) for out in outputs]
|
||||
class_tokens = [out[:, 0] for out in outputs]
|
||||
outputs = [out[:, 1 + self.num_register_tokens:] for out in outputs]
|
||||
if reshape:
|
||||
B, _, w, h = x.shape
|
||||
outputs = [
|
||||
out.reshape(B, w // self.patch_size, h // self.patch_size, -1).permute(0, 3, 1, 2).contiguous()
|
||||
for out in outputs
|
||||
]
|
||||
if return_class_token:
|
||||
return tuple(zip(outputs, class_tokens))
|
||||
return tuple(outputs)
|
||||
|
||||
def forward(self, *args, is_training=False, **kwargs):
|
||||
ret = self.forward_features(*args, **kwargs)
|
||||
if is_training:
|
||||
return ret
|
||||
else:
|
||||
return self.head(ret["x_norm_clstoken"])
|
||||
|
||||
|
||||
def init_weights_vit_timm(module: nn.Module, name: str = ""):
|
||||
"""ViT weight initialization, original timm impl (for reproducibility)"""
|
||||
if isinstance(module, nn.Linear):
|
||||
trunc_normal_(module.weight, std=0.02)
|
||||
if module.bias is not None:
|
||||
nn.init.zeros_(module.bias)
|
||||
|
||||
|
||||
def vit_small(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=384,
|
||||
depth=12,
|
||||
num_heads=6,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_base(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=768,
|
||||
depth=12,
|
||||
num_heads=12,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_large(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=1024,
|
||||
depth=24,
|
||||
num_heads=16,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def vit_giant2(patch_size=16, num_register_tokens=0, **kwargs):
|
||||
"""
|
||||
Close to ViT-giant, with embed-dim 1536 and 24 heads => embed-dim per head 64
|
||||
"""
|
||||
model = DinoVisionTransformer(
|
||||
patch_size=patch_size,
|
||||
embed_dim=1536,
|
||||
depth=40,
|
||||
num_heads=24,
|
||||
mlp_ratio=4,
|
||||
block_fn=partial(Block, attn_class=MemEffAttention),
|
||||
num_register_tokens=num_register_tokens,
|
||||
**kwargs,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
def DINOv2(model_name):
|
||||
model_zoo = {
|
||||
"vits": vit_small,
|
||||
"vitb": vit_base,
|
||||
"vitl": vit_large,
|
||||
"vitg": vit_giant2
|
||||
}
|
||||
|
||||
return model_zoo[model_name](
|
||||
img_size=518,
|
||||
patch_size=14,
|
||||
init_values=1.0,
|
||||
ffn_layer="mlp" if model_name != "vitg" else "swiglufused",
|
||||
block_chunks=0,
|
||||
num_register_tokens=0,
|
||||
interpolate_antialias=False,
|
||||
interpolate_offset=0.1
|
||||
)
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from .mlp import Mlp
|
||||
from .patch_embed import PatchEmbed
|
||||
from .swiglu_ffn import SwiGLUFFN, SwiGLUFFNFused
|
||||
from .block import NestedTensorBlock
|
||||
from .attention import MemEffAttention
|
|
@ -0,0 +1,83 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/models/vision_transformer.py
|
||||
|
||||
import logging
|
||||
|
||||
from torch import Tensor
|
||||
from torch import nn
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import memory_efficient_attention, unbind, fmha
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
logger.warning("xFormers not available")
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class Attention(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
num_heads: int = 8,
|
||||
qkv_bias: bool = False,
|
||||
proj_bias: bool = True,
|
||||
attn_drop: float = 0.0,
|
||||
proj_drop: float = 0.0,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.num_heads = num_heads
|
||||
head_dim = dim // num_heads
|
||||
self.scale = head_dim**-0.5
|
||||
|
||||
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
||||
self.attn_drop = nn.Dropout(attn_drop)
|
||||
self.proj = nn.Linear(dim, dim, bias=proj_bias)
|
||||
self.proj_drop = nn.Dropout(proj_drop)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
B, N, C = x.shape
|
||||
qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
|
||||
|
||||
q, k, v = qkv[0] * self.scale, qkv[1], qkv[2]
|
||||
attn = q @ k.transpose(-2, -1)
|
||||
|
||||
attn = attn.softmax(dim=-1)
|
||||
attn = self.attn_drop(attn)
|
||||
|
||||
x = (attn @ v).transpose(1, 2).reshape(B, N, C)
|
||||
x = self.proj(x)
|
||||
x = self.proj_drop(x)
|
||||
return x
|
||||
|
||||
|
||||
class MemEffAttention(Attention):
|
||||
def forward(self, x: Tensor, attn_bias=None) -> Tensor:
|
||||
if not XFORMERS_AVAILABLE:
|
||||
assert attn_bias is None, "xFormers is required for nested tensors usage"
|
||||
return super().forward(x)
|
||||
|
||||
B, N, C = x.shape
|
||||
qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads)
|
||||
|
||||
q, k, v = unbind(qkv, 2)
|
||||
|
||||
x = memory_efficient_attention(q, k, v, attn_bias=attn_bias)
|
||||
x = x.reshape([B, N, C])
|
||||
|
||||
x = self.proj(x)
|
||||
x = self.proj_drop(x)
|
||||
return x
|
||||
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/patch_embed.py
|
||||
|
||||
import logging
|
||||
from typing import Callable, List, Any, Tuple, Dict
|
||||
|
||||
import torch
|
||||
from torch import nn, Tensor
|
||||
|
||||
from .attention import Attention, MemEffAttention
|
||||
from .drop_path import DropPath
|
||||
from .layer_scale import LayerScale
|
||||
from .mlp import Mlp
|
||||
|
||||
|
||||
logger = logging.getLogger("dinov2")
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import fmha
|
||||
from xformers.ops import scaled_index_add, index_select_cat
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
logger.warning("xFormers not available")
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class Block(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
num_heads: int,
|
||||
mlp_ratio: float = 4.0,
|
||||
qkv_bias: bool = False,
|
||||
proj_bias: bool = True,
|
||||
ffn_bias: bool = True,
|
||||
drop: float = 0.0,
|
||||
attn_drop: float = 0.0,
|
||||
init_values=None,
|
||||
drop_path: float = 0.0,
|
||||
act_layer: Callable[..., nn.Module] = nn.GELU,
|
||||
norm_layer: Callable[..., nn.Module] = nn.LayerNorm,
|
||||
attn_class: Callable[..., nn.Module] = Attention,
|
||||
ffn_layer: Callable[..., nn.Module] = Mlp,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
# print(f"biases: qkv: {qkv_bias}, proj: {proj_bias}, ffn: {ffn_bias}")
|
||||
self.norm1 = norm_layer(dim)
|
||||
self.attn = attn_class(
|
||||
dim,
|
||||
num_heads=num_heads,
|
||||
qkv_bias=qkv_bias,
|
||||
proj_bias=proj_bias,
|
||||
attn_drop=attn_drop,
|
||||
proj_drop=drop,
|
||||
)
|
||||
self.ls1 = LayerScale(dim, init_values=init_values) if init_values else nn.Identity()
|
||||
self.drop_path1 = DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
|
||||
|
||||
self.norm2 = norm_layer(dim)
|
||||
mlp_hidden_dim = int(dim * mlp_ratio)
|
||||
self.mlp = ffn_layer(
|
||||
in_features=dim,
|
||||
hidden_features=mlp_hidden_dim,
|
||||
act_layer=act_layer,
|
||||
drop=drop,
|
||||
bias=ffn_bias,
|
||||
)
|
||||
self.ls2 = LayerScale(dim, init_values=init_values) if init_values else nn.Identity()
|
||||
self.drop_path2 = DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
|
||||
|
||||
self.sample_drop_ratio = drop_path
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
def attn_residual_func(x: Tensor) -> Tensor:
|
||||
return self.ls1(self.attn(self.norm1(x)))
|
||||
|
||||
def ffn_residual_func(x: Tensor) -> Tensor:
|
||||
return self.ls2(self.mlp(self.norm2(x)))
|
||||
|
||||
if self.training and self.sample_drop_ratio > 0.1:
|
||||
# the overhead is compensated only for a drop path rate larger than 0.1
|
||||
x = drop_add_residual_stochastic_depth(
|
||||
x,
|
||||
residual_func=attn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
)
|
||||
x = drop_add_residual_stochastic_depth(
|
||||
x,
|
||||
residual_func=ffn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
)
|
||||
elif self.training and self.sample_drop_ratio > 0.0:
|
||||
x = x + self.drop_path1(attn_residual_func(x))
|
||||
x = x + self.drop_path1(ffn_residual_func(x)) # FIXME: drop_path2
|
||||
else:
|
||||
x = x + attn_residual_func(x)
|
||||
x = x + ffn_residual_func(x)
|
||||
return x
|
||||
|
||||
|
||||
def drop_add_residual_stochastic_depth(
|
||||
x: Tensor,
|
||||
residual_func: Callable[[Tensor], Tensor],
|
||||
sample_drop_ratio: float = 0.0,
|
||||
) -> Tensor:
|
||||
# 1) extract subset using permutation
|
||||
b, n, d = x.shape
|
||||
sample_subset_size = max(int(b * (1 - sample_drop_ratio)), 1)
|
||||
brange = (torch.randperm(b, device=x.device))[:sample_subset_size]
|
||||
x_subset = x[brange]
|
||||
|
||||
# 2) apply residual_func to get residual
|
||||
residual = residual_func(x_subset)
|
||||
|
||||
x_flat = x.flatten(1)
|
||||
residual = residual.flatten(1)
|
||||
|
||||
residual_scale_factor = b / sample_subset_size
|
||||
|
||||
# 3) add the residual
|
||||
x_plus_residual = torch.index_add(x_flat, 0, brange, residual.to(dtype=x.dtype), alpha=residual_scale_factor)
|
||||
return x_plus_residual.view_as(x)
|
||||
|
||||
|
||||
def get_branges_scales(x, sample_drop_ratio=0.0):
|
||||
b, n, d = x.shape
|
||||
sample_subset_size = max(int(b * (1 - sample_drop_ratio)), 1)
|
||||
brange = (torch.randperm(b, device=x.device))[:sample_subset_size]
|
||||
residual_scale_factor = b / sample_subset_size
|
||||
return brange, residual_scale_factor
|
||||
|
||||
|
||||
def add_residual(x, brange, residual, residual_scale_factor, scaling_vector=None):
|
||||
if scaling_vector is None:
|
||||
x_flat = x.flatten(1)
|
||||
residual = residual.flatten(1)
|
||||
x_plus_residual = torch.index_add(x_flat, 0, brange, residual.to(dtype=x.dtype), alpha=residual_scale_factor)
|
||||
else:
|
||||
x_plus_residual = scaled_index_add(
|
||||
x, brange, residual.to(dtype=x.dtype), scaling=scaling_vector, alpha=residual_scale_factor
|
||||
)
|
||||
return x_plus_residual
|
||||
|
||||
|
||||
attn_bias_cache: Dict[Tuple, Any] = {}
|
||||
|
||||
|
||||
def get_attn_bias_and_cat(x_list, branges=None):
|
||||
"""
|
||||
this will perform the index select, cat the tensors, and provide the attn_bias from cache
|
||||
"""
|
||||
batch_sizes = [b.shape[0] for b in branges] if branges is not None else [x.shape[0] for x in x_list]
|
||||
all_shapes = tuple((b, x.shape[1]) for b, x in zip(batch_sizes, x_list))
|
||||
if all_shapes not in attn_bias_cache.keys():
|
||||
seqlens = []
|
||||
for b, x in zip(batch_sizes, x_list):
|
||||
for _ in range(b):
|
||||
seqlens.append(x.shape[1])
|
||||
attn_bias = fmha.BlockDiagonalMask.from_seqlens(seqlens)
|
||||
attn_bias._batch_sizes = batch_sizes
|
||||
attn_bias_cache[all_shapes] = attn_bias
|
||||
|
||||
if branges is not None:
|
||||
cat_tensors = index_select_cat([x.flatten(1) for x in x_list], branges).view(1, -1, x_list[0].shape[-1])
|
||||
else:
|
||||
tensors_bs1 = tuple(x.reshape([1, -1, *x.shape[2:]]) for x in x_list)
|
||||
cat_tensors = torch.cat(tensors_bs1, dim=1)
|
||||
|
||||
return attn_bias_cache[all_shapes], cat_tensors
|
||||
|
||||
|
||||
def drop_add_residual_stochastic_depth_list(
|
||||
x_list: List[Tensor],
|
||||
residual_func: Callable[[Tensor, Any], Tensor],
|
||||
sample_drop_ratio: float = 0.0,
|
||||
scaling_vector=None,
|
||||
) -> Tensor:
|
||||
# 1) generate random set of indices for dropping samples in the batch
|
||||
branges_scales = [get_branges_scales(x, sample_drop_ratio=sample_drop_ratio) for x in x_list]
|
||||
branges = [s[0] for s in branges_scales]
|
||||
residual_scale_factors = [s[1] for s in branges_scales]
|
||||
|
||||
# 2) get attention bias and index+concat the tensors
|
||||
attn_bias, x_cat = get_attn_bias_and_cat(x_list, branges)
|
||||
|
||||
# 3) apply residual_func to get residual, and split the result
|
||||
residual_list = attn_bias.split(residual_func(x_cat, attn_bias=attn_bias)) # type: ignore
|
||||
|
||||
outputs = []
|
||||
for x, brange, residual, residual_scale_factor in zip(x_list, branges, residual_list, residual_scale_factors):
|
||||
outputs.append(add_residual(x, brange, residual, residual_scale_factor, scaling_vector).view_as(x))
|
||||
return outputs
|
||||
|
||||
|
||||
class NestedTensorBlock(Block):
|
||||
def forward_nested(self, x_list: List[Tensor]) -> List[Tensor]:
|
||||
"""
|
||||
x_list contains a list of tensors to nest together and run
|
||||
"""
|
||||
assert isinstance(self.attn, MemEffAttention)
|
||||
|
||||
if self.training and self.sample_drop_ratio > 0.0:
|
||||
|
||||
def attn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.attn(self.norm1(x), attn_bias=attn_bias)
|
||||
|
||||
def ffn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.mlp(self.norm2(x))
|
||||
|
||||
x_list = drop_add_residual_stochastic_depth_list(
|
||||
x_list,
|
||||
residual_func=attn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
scaling_vector=self.ls1.gamma if isinstance(self.ls1, LayerScale) else None,
|
||||
)
|
||||
x_list = drop_add_residual_stochastic_depth_list(
|
||||
x_list,
|
||||
residual_func=ffn_residual_func,
|
||||
sample_drop_ratio=self.sample_drop_ratio,
|
||||
scaling_vector=self.ls2.gamma if isinstance(self.ls1, LayerScale) else None,
|
||||
)
|
||||
return x_list
|
||||
else:
|
||||
|
||||
def attn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.ls1(self.attn(self.norm1(x), attn_bias=attn_bias))
|
||||
|
||||
def ffn_residual_func(x: Tensor, attn_bias=None) -> Tensor:
|
||||
return self.ls2(self.mlp(self.norm2(x)))
|
||||
|
||||
attn_bias, x = get_attn_bias_and_cat(x_list)
|
||||
x = x + attn_residual_func(x, attn_bias=attn_bias)
|
||||
x = x + ffn_residual_func(x)
|
||||
return attn_bias.split(x)
|
||||
|
||||
def forward(self, x_or_x_list):
|
||||
if isinstance(x_or_x_list, Tensor):
|
||||
return super().forward(x_or_x_list)
|
||||
elif isinstance(x_or_x_list, list):
|
||||
assert XFORMERS_AVAILABLE, "Please install xFormers for nested tensors usage"
|
||||
return self.forward_nested(x_or_x_list)
|
||||
else:
|
||||
raise AssertionError
|
|
@ -0,0 +1,35 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/drop.py
|
||||
|
||||
|
||||
from torch import nn
|
||||
|
||||
|
||||
def drop_path(x, drop_prob: float = 0.0, training: bool = False):
|
||||
if drop_prob == 0.0 or not training:
|
||||
return x
|
||||
keep_prob = 1 - drop_prob
|
||||
shape = (x.shape[0],) + (1,) * (x.ndim - 1) # work with diff dim tensors, not just 2D ConvNets
|
||||
random_tensor = x.new_empty(shape).bernoulli_(keep_prob)
|
||||
if keep_prob > 0.0:
|
||||
random_tensor.div_(keep_prob)
|
||||
output = x * random_tensor
|
||||
return output
|
||||
|
||||
|
||||
class DropPath(nn.Module):
|
||||
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks)."""
|
||||
|
||||
def __init__(self, drop_prob=None):
|
||||
super(DropPath, self).__init__()
|
||||
self.drop_prob = drop_prob
|
||||
|
||||
def forward(self, x):
|
||||
return drop_path(x, self.drop_prob, self.training)
|
|
@ -0,0 +1,28 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# Modified from: https://github.com/huggingface/pytorch-image-models/blob/main/timm/models/vision_transformer.py#L103-L110
|
||||
|
||||
from typing import Union
|
||||
|
||||
import torch
|
||||
from torch import Tensor
|
||||
from torch import nn
|
||||
|
||||
|
||||
class LayerScale(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
dim: int,
|
||||
init_values: Union[float, Tensor] = 1e-5,
|
||||
inplace: bool = False,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.inplace = inplace
|
||||
self.gamma = nn.Parameter(init_values * torch.ones(dim))
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
return x.mul_(self.gamma) if self.inplace else x * self.gamma
|
|
@ -0,0 +1,41 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/mlp.py
|
||||
|
||||
|
||||
from typing import Callable, Optional
|
||||
|
||||
from torch import Tensor, nn
|
||||
|
||||
|
||||
class Mlp(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = nn.GELU,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
self.fc1 = nn.Linear(in_features, hidden_features, bias=bias)
|
||||
self.act = act_layer()
|
||||
self.fc2 = nn.Linear(hidden_features, out_features, bias=bias)
|
||||
self.drop = nn.Dropout(drop)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
x = self.fc1(x)
|
||||
x = self.act(x)
|
||||
x = self.drop(x)
|
||||
x = self.fc2(x)
|
||||
x = self.drop(x)
|
||||
return x
|
|
@ -0,0 +1,89 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# References:
|
||||
# https://github.com/facebookresearch/dino/blob/master/vision_transformer.py
|
||||
# https://github.com/rwightman/pytorch-image-models/tree/master/timm/layers/patch_embed.py
|
||||
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
|
||||
from torch import Tensor
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
def make_2tuple(x):
|
||||
if isinstance(x, tuple):
|
||||
assert len(x) == 2
|
||||
return x
|
||||
|
||||
assert isinstance(x, int)
|
||||
return (x, x)
|
||||
|
||||
|
||||
class PatchEmbed(nn.Module):
|
||||
"""
|
||||
2D image to patch embedding: (B,C,H,W) -> (B,N,D)
|
||||
|
||||
Args:
|
||||
img_size: Image size.
|
||||
patch_size: Patch token size.
|
||||
in_chans: Number of input image channels.
|
||||
embed_dim: Number of linear projection output channels.
|
||||
norm_layer: Normalization layer.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
img_size: Union[int, Tuple[int, int]] = 224,
|
||||
patch_size: Union[int, Tuple[int, int]] = 16,
|
||||
in_chans: int = 3,
|
||||
embed_dim: int = 768,
|
||||
norm_layer: Optional[Callable] = None,
|
||||
flatten_embedding: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
|
||||
image_HW = make_2tuple(img_size)
|
||||
patch_HW = make_2tuple(patch_size)
|
||||
patch_grid_size = (
|
||||
image_HW[0] // patch_HW[0],
|
||||
image_HW[1] // patch_HW[1],
|
||||
)
|
||||
|
||||
self.img_size = image_HW
|
||||
self.patch_size = patch_HW
|
||||
self.patches_resolution = patch_grid_size
|
||||
self.num_patches = patch_grid_size[0] * patch_grid_size[1]
|
||||
|
||||
self.in_chans = in_chans
|
||||
self.embed_dim = embed_dim
|
||||
|
||||
self.flatten_embedding = flatten_embedding
|
||||
|
||||
self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=patch_HW, stride=patch_HW)
|
||||
self.norm = norm_layer(embed_dim) if norm_layer else nn.Identity()
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
_, _, H, W = x.shape
|
||||
patch_H, patch_W = self.patch_size
|
||||
|
||||
assert H % patch_H == 0, f"Input image height {H} is not a multiple of patch height {patch_H}"
|
||||
assert W % patch_W == 0, f"Input image width {W} is not a multiple of patch width: {patch_W}"
|
||||
|
||||
x = self.proj(x) # B C H W
|
||||
H, W = x.size(2), x.size(3)
|
||||
x = x.flatten(2).transpose(1, 2) # B HW C
|
||||
x = self.norm(x)
|
||||
if not self.flatten_embedding:
|
||||
x = x.reshape(-1, H, W, self.embed_dim) # B H W C
|
||||
return x
|
||||
|
||||
def flops(self) -> float:
|
||||
Ho, Wo = self.patches_resolution
|
||||
flops = Ho * Wo * self.embed_dim * self.in_chans * (self.patch_size[0] * self.patch_size[1])
|
||||
if self.norm is not None:
|
||||
flops += Ho * Wo * self.embed_dim
|
||||
return flops
|
|
@ -0,0 +1,63 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from typing import Callable, Optional
|
||||
|
||||
from torch import Tensor, nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
||||
class SwiGLUFFN(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = None,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
self.w12 = nn.Linear(in_features, 2 * hidden_features, bias=bias)
|
||||
self.w3 = nn.Linear(hidden_features, out_features, bias=bias)
|
||||
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
x12 = self.w12(x)
|
||||
x1, x2 = x12.chunk(2, dim=-1)
|
||||
hidden = F.silu(x1) * x2
|
||||
return self.w3(hidden)
|
||||
|
||||
|
||||
try:
|
||||
from xformers.ops import SwiGLU
|
||||
|
||||
XFORMERS_AVAILABLE = True
|
||||
except ImportError:
|
||||
SwiGLU = SwiGLUFFN
|
||||
XFORMERS_AVAILABLE = False
|
||||
|
||||
|
||||
class SwiGLUFFNFused(SwiGLU):
|
||||
def __init__(
|
||||
self,
|
||||
in_features: int,
|
||||
hidden_features: Optional[int] = None,
|
||||
out_features: Optional[int] = None,
|
||||
act_layer: Callable[..., nn.Module] = None,
|
||||
drop: float = 0.0,
|
||||
bias: bool = True,
|
||||
) -> None:
|
||||
out_features = out_features or in_features
|
||||
hidden_features = hidden_features or in_features
|
||||
hidden_features = (int(hidden_features * 2 / 3) + 7) // 8 * 8
|
||||
super().__init__(
|
||||
in_features=in_features,
|
||||
hidden_features=hidden_features,
|
||||
out_features=out_features,
|
||||
bias=bias,
|
||||
)
|
|
@ -0,0 +1,222 @@
|
|||
import cv2
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
from torchvision.transforms import Compose
|
||||
|
||||
from .dinov2 import DINOv2
|
||||
from .util.blocks import FeatureFusionBlock, _make_scratch
|
||||
from .util.transform import Resize, NormalizeImage, PrepareForNet
|
||||
|
||||
|
||||
def _make_fusion_block(features, use_bn, size=None):
|
||||
return FeatureFusionBlock(
|
||||
features,
|
||||
nn.ReLU(False),
|
||||
deconv=False,
|
||||
bn=use_bn,
|
||||
expand=False,
|
||||
align_corners=True,
|
||||
size=size,
|
||||
)
|
||||
|
||||
|
||||
class ConvBlock(nn.Module):
|
||||
def __init__(self, in_feature, out_feature):
|
||||
super().__init__()
|
||||
|
||||
self.conv_block = nn.Sequential(
|
||||
nn.Conv2d(in_feature, out_feature, kernel_size=3, stride=1, padding=1),
|
||||
nn.BatchNorm2d(out_feature),
|
||||
nn.ReLU(True)
|
||||
)
|
||||
|
||||
def forward(self, x):
|
||||
return self.conv_block(x)
|
||||
|
||||
|
||||
class DPTHead(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
in_channels,
|
||||
features=256,
|
||||
use_bn=False,
|
||||
out_channels=[256, 512, 1024, 1024],
|
||||
use_clstoken=False
|
||||
):
|
||||
super(DPTHead, self).__init__()
|
||||
|
||||
self.use_clstoken = use_clstoken
|
||||
|
||||
self.projects = nn.ModuleList([
|
||||
nn.Conv2d(
|
||||
in_channels=in_channels,
|
||||
out_channels=out_channel,
|
||||
kernel_size=1,
|
||||
stride=1,
|
||||
padding=0,
|
||||
) for out_channel in out_channels
|
||||
])
|
||||
|
||||
self.resize_layers = nn.ModuleList([
|
||||
nn.ConvTranspose2d(
|
||||
in_channels=out_channels[0],
|
||||
out_channels=out_channels[0],
|
||||
kernel_size=4,
|
||||
stride=4,
|
||||
padding=0),
|
||||
nn.ConvTranspose2d(
|
||||
in_channels=out_channels[1],
|
||||
out_channels=out_channels[1],
|
||||
kernel_size=2,
|
||||
stride=2,
|
||||
padding=0),
|
||||
nn.Identity(),
|
||||
nn.Conv2d(
|
||||
in_channels=out_channels[3],
|
||||
out_channels=out_channels[3],
|
||||
kernel_size=3,
|
||||
stride=2,
|
||||
padding=1)
|
||||
])
|
||||
|
||||
if use_clstoken:
|
||||
self.readout_projects = nn.ModuleList()
|
||||
for _ in range(len(self.projects)):
|
||||
self.readout_projects.append(
|
||||
nn.Sequential(
|
||||
nn.Linear(2 * in_channels, in_channels),
|
||||
nn.GELU()))
|
||||
|
||||
self.scratch = _make_scratch(
|
||||
out_channels,
|
||||
features,
|
||||
groups=1,
|
||||
expand=False,
|
||||
)
|
||||
|
||||
self.scratch.stem_transpose = None
|
||||
|
||||
self.scratch.refinenet1 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet2 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet3 = _make_fusion_block(features, use_bn)
|
||||
self.scratch.refinenet4 = _make_fusion_block(features, use_bn)
|
||||
|
||||
head_features_1 = features
|
||||
head_features_2 = 32
|
||||
|
||||
self.scratch.output_conv1 = nn.Conv2d(head_features_1, head_features_1 // 2, kernel_size=3, stride=1, padding=1)
|
||||
self.scratch.output_conv2 = nn.Sequential(
|
||||
nn.Conv2d(head_features_1 // 2, head_features_2, kernel_size=3, stride=1, padding=1),
|
||||
nn.ReLU(True),
|
||||
nn.Conv2d(head_features_2, 1, kernel_size=1, stride=1, padding=0),
|
||||
nn.Sigmoid()
|
||||
)
|
||||
|
||||
def forward(self, out_features, patch_h, patch_w):
|
||||
out = []
|
||||
for i, x in enumerate(out_features):
|
||||
if self.use_clstoken:
|
||||
x, cls_token = x[0], x[1]
|
||||
readout = cls_token.unsqueeze(1).expand_as(x)
|
||||
x = self.readout_projects[i](torch.cat((x, readout), -1))
|
||||
else:
|
||||
x = x[0]
|
||||
|
||||
x = x.permute(0, 2, 1).reshape((x.shape[0], x.shape[-1], patch_h, patch_w))
|
||||
|
||||
x = self.projects[i](x)
|
||||
x = self.resize_layers[i](x)
|
||||
|
||||
out.append(x)
|
||||
|
||||
layer_1, layer_2, layer_3, layer_4 = out
|
||||
|
||||
layer_1_rn = self.scratch.layer1_rn(layer_1)
|
||||
layer_2_rn = self.scratch.layer2_rn(layer_2)
|
||||
layer_3_rn = self.scratch.layer3_rn(layer_3)
|
||||
layer_4_rn = self.scratch.layer4_rn(layer_4)
|
||||
|
||||
path_4 = self.scratch.refinenet4(layer_4_rn, size=layer_3_rn.shape[2:])
|
||||
path_3 = self.scratch.refinenet3(path_4, layer_3_rn, size=layer_2_rn.shape[2:])
|
||||
path_2 = self.scratch.refinenet2(path_3, layer_2_rn, size=layer_1_rn.shape[2:])
|
||||
path_1 = self.scratch.refinenet1(path_2, layer_1_rn)
|
||||
|
||||
out = self.scratch.output_conv1(path_1)
|
||||
out = F.interpolate(out, (int(patch_h * 14), int(patch_w * 14)), mode="bilinear", align_corners=True)
|
||||
out = self.scratch.output_conv2(out)
|
||||
|
||||
return out
|
||||
|
||||
|
||||
class DepthAnythingV2(nn.Module):
|
||||
def __init__(
|
||||
self,
|
||||
encoder='vitl',
|
||||
features=256,
|
||||
out_channels=[256, 512, 1024, 1024],
|
||||
use_bn=False,
|
||||
use_clstoken=False,
|
||||
max_depth=20.0
|
||||
):
|
||||
super(DepthAnythingV2, self).__init__()
|
||||
|
||||
self.intermediate_layer_idx = {
|
||||
'vits': [2, 5, 8, 11],
|
||||
'vitb': [2, 5, 8, 11],
|
||||
'vitl': [4, 11, 17, 23],
|
||||
'vitg': [9, 19, 29, 39]
|
||||
}
|
||||
|
||||
self.max_depth = max_depth
|
||||
|
||||
self.encoder = encoder
|
||||
self.pretrained = DINOv2(model_name=encoder)
|
||||
|
||||
self.depth_head = DPTHead(self.pretrained.embed_dim, features, use_bn, out_channels=out_channels, use_clstoken=use_clstoken)
|
||||
|
||||
def forward(self, x):
|
||||
patch_h, patch_w = x.shape[-2] // 14, x.shape[-1] // 14
|
||||
|
||||
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
|
||||
|
||||
depth = self.depth_head(features, patch_h, patch_w) * self.max_depth
|
||||
|
||||
return depth.squeeze(1)
|
||||
|
||||
@torch.no_grad()
|
||||
def infer_image(self, raw_image, input_size=518):
|
||||
image, (h, w) = self.image2tensor(raw_image, input_size)
|
||||
|
||||
depth = self.forward(image)
|
||||
|
||||
depth = F.interpolate(depth[:, None], (h, w), mode="bilinear", align_corners=True)[0, 0]
|
||||
|
||||
return depth.cpu().numpy()
|
||||
|
||||
def image2tensor(self, raw_image, input_size=518):
|
||||
transform = Compose([
|
||||
Resize(
|
||||
width=input_size,
|
||||
height=input_size,
|
||||
resize_target=False,
|
||||
keep_aspect_ratio=True,
|
||||
ensure_multiple_of=14,
|
||||
resize_method='lower_bound',
|
||||
image_interpolation_method=cv2.INTER_CUBIC,
|
||||
),
|
||||
NormalizeImage(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
||||
PrepareForNet(),
|
||||
])
|
||||
|
||||
h, w = raw_image.shape[:2]
|
||||
|
||||
image = cv2.cvtColor(raw_image, cv2.COLOR_BGR2RGB) / 255.0
|
||||
|
||||
image = transform({'image': image})['image']
|
||||
image = torch.from_numpy(image).unsqueeze(0)
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
image = image.to(DEVICE)
|
||||
|
||||
return image, (h, w)
|
|
@ -0,0 +1,148 @@
|
|||
import torch.nn as nn
|
||||
|
||||
|
||||
def _make_scratch(in_shape, out_shape, groups=1, expand=False):
|
||||
scratch = nn.Module()
|
||||
|
||||
out_shape1 = out_shape
|
||||
out_shape2 = out_shape
|
||||
out_shape3 = out_shape
|
||||
if len(in_shape) >= 4:
|
||||
out_shape4 = out_shape
|
||||
|
||||
if expand:
|
||||
out_shape1 = out_shape
|
||||
out_shape2 = out_shape * 2
|
||||
out_shape3 = out_shape * 4
|
||||
if len(in_shape) >= 4:
|
||||
out_shape4 = out_shape * 8
|
||||
|
||||
scratch.layer1_rn = nn.Conv2d(in_shape[0], out_shape1, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
scratch.layer2_rn = nn.Conv2d(in_shape[1], out_shape2, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
scratch.layer3_rn = nn.Conv2d(in_shape[2], out_shape3, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
if len(in_shape) >= 4:
|
||||
scratch.layer4_rn = nn.Conv2d(in_shape[3], out_shape4, kernel_size=3, stride=1, padding=1, bias=False, groups=groups)
|
||||
|
||||
return scratch
|
||||
|
||||
|
||||
class ResidualConvUnit(nn.Module):
|
||||
"""Residual convolution module.
|
||||
"""
|
||||
|
||||
def __init__(self, features, activation, bn):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
features (int): number of features
|
||||
"""
|
||||
super().__init__()
|
||||
|
||||
self.bn = bn
|
||||
|
||||
self.groups=1
|
||||
|
||||
self.conv1 = nn.Conv2d(features, features, kernel_size=3, stride=1, padding=1, bias=True, groups=self.groups)
|
||||
|
||||
self.conv2 = nn.Conv2d(features, features, kernel_size=3, stride=1, padding=1, bias=True, groups=self.groups)
|
||||
|
||||
if self.bn == True:
|
||||
self.bn1 = nn.BatchNorm2d(features)
|
||||
self.bn2 = nn.BatchNorm2d(features)
|
||||
|
||||
self.activation = activation
|
||||
|
||||
self.skip_add = nn.quantized.FloatFunctional()
|
||||
|
||||
def forward(self, x):
|
||||
"""Forward pass.
|
||||
|
||||
Args:
|
||||
x (tensor): input
|
||||
|
||||
Returns:
|
||||
tensor: output
|
||||
"""
|
||||
|
||||
out = self.activation(x)
|
||||
out = self.conv1(out)
|
||||
if self.bn == True:
|
||||
out = self.bn1(out)
|
||||
|
||||
out = self.activation(out)
|
||||
out = self.conv2(out)
|
||||
if self.bn == True:
|
||||
out = self.bn2(out)
|
||||
|
||||
if self.groups > 1:
|
||||
out = self.conv_merge(out)
|
||||
|
||||
return self.skip_add.add(out, x)
|
||||
|
||||
|
||||
class FeatureFusionBlock(nn.Module):
|
||||
"""Feature fusion block.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
features,
|
||||
activation,
|
||||
deconv=False,
|
||||
bn=False,
|
||||
expand=False,
|
||||
align_corners=True,
|
||||
size=None
|
||||
):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
features (int): number of features
|
||||
"""
|
||||
super(FeatureFusionBlock, self).__init__()
|
||||
|
||||
self.deconv = deconv
|
||||
self.align_corners = align_corners
|
||||
|
||||
self.groups=1
|
||||
|
||||
self.expand = expand
|
||||
out_features = features
|
||||
if self.expand == True:
|
||||
out_features = features // 2
|
||||
|
||||
self.out_conv = nn.Conv2d(features, out_features, kernel_size=1, stride=1, padding=0, bias=True, groups=1)
|
||||
|
||||
self.resConfUnit1 = ResidualConvUnit(features, activation, bn)
|
||||
self.resConfUnit2 = ResidualConvUnit(features, activation, bn)
|
||||
|
||||
self.skip_add = nn.quantized.FloatFunctional()
|
||||
|
||||
self.size=size
|
||||
|
||||
def forward(self, *xs, size=None):
|
||||
"""Forward pass.
|
||||
|
||||
Returns:
|
||||
tensor: output
|
||||
"""
|
||||
output = xs[0]
|
||||
|
||||
if len(xs) == 2:
|
||||
res = self.resConfUnit1(xs[1])
|
||||
output = self.skip_add.add(output, res)
|
||||
|
||||
output = self.resConfUnit2(output)
|
||||
|
||||
if (size is None) and (self.size is None):
|
||||
modifier = {"scale_factor": 2}
|
||||
elif size is None:
|
||||
modifier = {"size": self.size}
|
||||
else:
|
||||
modifier = {"size": size}
|
||||
|
||||
output = nn.functional.interpolate(output, **modifier, mode="bilinear", align_corners=self.align_corners)
|
||||
|
||||
output = self.out_conv(output)
|
||||
|
||||
return output
|
|
@ -0,0 +1,158 @@
|
|||
import numpy as np
|
||||
import cv2
|
||||
|
||||
|
||||
class Resize(object):
|
||||
"""Resize sample to given size (width, height).
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
width,
|
||||
height,
|
||||
resize_target=True,
|
||||
keep_aspect_ratio=False,
|
||||
ensure_multiple_of=1,
|
||||
resize_method="lower_bound",
|
||||
image_interpolation_method=cv2.INTER_AREA,
|
||||
):
|
||||
"""Init.
|
||||
|
||||
Args:
|
||||
width (int): desired output width
|
||||
height (int): desired output height
|
||||
resize_target (bool, optional):
|
||||
True: Resize the full sample (image, mask, target).
|
||||
False: Resize image only.
|
||||
Defaults to True.
|
||||
keep_aspect_ratio (bool, optional):
|
||||
True: Keep the aspect ratio of the input sample.
|
||||
Output sample might not have the given width and height, and
|
||||
resize behaviour depends on the parameter 'resize_method'.
|
||||
Defaults to False.
|
||||
ensure_multiple_of (int, optional):
|
||||
Output width and height is constrained to be multiple of this parameter.
|
||||
Defaults to 1.
|
||||
resize_method (str, optional):
|
||||
"lower_bound": Output will be at least as large as the given size.
|
||||
"upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
|
||||
"minimal": Scale as least as possible. (Output size might be smaller than given size.)
|
||||
Defaults to "lower_bound".
|
||||
"""
|
||||
self.__width = width
|
||||
self.__height = height
|
||||
|
||||
self.__resize_target = resize_target
|
||||
self.__keep_aspect_ratio = keep_aspect_ratio
|
||||
self.__multiple_of = ensure_multiple_of
|
||||
self.__resize_method = resize_method
|
||||
self.__image_interpolation_method = image_interpolation_method
|
||||
|
||||
def constrain_to_multiple_of(self, x, min_val=0, max_val=None):
|
||||
y = (np.round(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if max_val is not None and y > max_val:
|
||||
y = (np.floor(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
if y < min_val:
|
||||
y = (np.ceil(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
||||
|
||||
return y
|
||||
|
||||
def get_size(self, width, height):
|
||||
# determine new height and width
|
||||
scale_height = self.__height / height
|
||||
scale_width = self.__width / width
|
||||
|
||||
if self.__keep_aspect_ratio:
|
||||
if self.__resize_method == "lower_bound":
|
||||
# scale such that output size is lower bound
|
||||
if scale_width > scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "upper_bound":
|
||||
# scale such that output size is upper bound
|
||||
if scale_width < scale_height:
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
elif self.__resize_method == "minimal":
|
||||
# scale as least as possbile
|
||||
if abs(1 - scale_width) < abs(1 - scale_height):
|
||||
# fit width
|
||||
scale_height = scale_width
|
||||
else:
|
||||
# fit height
|
||||
scale_width = scale_height
|
||||
else:
|
||||
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
||||
|
||||
if self.__resize_method == "lower_bound":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height, min_val=self.__height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width, min_val=self.__width)
|
||||
elif self.__resize_method == "upper_bound":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height, max_val=self.__height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width, max_val=self.__width)
|
||||
elif self.__resize_method == "minimal":
|
||||
new_height = self.constrain_to_multiple_of(scale_height * height)
|
||||
new_width = self.constrain_to_multiple_of(scale_width * width)
|
||||
else:
|
||||
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
||||
|
||||
return (new_width, new_height)
|
||||
|
||||
def __call__(self, sample):
|
||||
width, height = self.get_size(sample["image"].shape[1], sample["image"].shape[0])
|
||||
|
||||
# resize sample
|
||||
sample["image"] = cv2.resize(sample["image"], (width, height), interpolation=self.__image_interpolation_method)
|
||||
|
||||
if self.__resize_target:
|
||||
if "depth" in sample:
|
||||
sample["depth"] = cv2.resize(sample["depth"], (width, height), interpolation=cv2.INTER_NEAREST)
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = cv2.resize(sample["mask"].astype(np.float32), (width, height), interpolation=cv2.INTER_NEAREST)
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class NormalizeImage(object):
|
||||
"""Normlize image by given mean and std.
|
||||
"""
|
||||
|
||||
def __init__(self, mean, std):
|
||||
self.__mean = mean
|
||||
self.__std = std
|
||||
|
||||
def __call__(self, sample):
|
||||
sample["image"] = (sample["image"] - self.__mean) / self.__std
|
||||
|
||||
return sample
|
||||
|
||||
|
||||
class PrepareForNet(object):
|
||||
"""Prepare sample for usage as network input.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def __call__(self, sample):
|
||||
image = np.transpose(sample["image"], (2, 0, 1))
|
||||
sample["image"] = np.ascontiguousarray(image).astype(np.float32)
|
||||
|
||||
if "depth" in sample:
|
||||
depth = sample["depth"].astype(np.float32)
|
||||
sample["depth"] = np.ascontiguousarray(depth)
|
||||
|
||||
if "mask" in sample:
|
||||
sample["mask"] = sample["mask"].astype(np.float32)
|
||||
sample["mask"] = np.ascontiguousarray(sample["mask"])
|
||||
|
||||
return sample
|
|
@ -0,0 +1,114 @@
|
|||
"""
|
||||
Born out of Depth Anything V1 Issue 36
|
||||
Make sure you have the necessary libraries installed.
|
||||
Code by @1ssb
|
||||
|
||||
This script processes a set of images to generate depth maps and corresponding point clouds.
|
||||
The resulting point clouds are saved in the specified output directory.
|
||||
|
||||
Usage:
|
||||
python script.py --encoder vitl --load-from path_to_model --max-depth 20 --img-path path_to_images --outdir output_directory --focal-length-x 470.4 --focal-length-y 470.4
|
||||
|
||||
Arguments:
|
||||
--encoder: Model encoder to use. Choices are ['vits', 'vitb', 'vitl', 'vitg'].
|
||||
--load-from: Path to the pre-trained model weights.
|
||||
--max-depth: Maximum depth value for the depth map.
|
||||
--img-path: Path to the input image or directory containing images.
|
||||
--outdir: Directory to save the output point clouds.
|
||||
--focal-length-x: Focal length along the x-axis.
|
||||
--focal-length-y: Focal length along the y-axis.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import cv2
|
||||
import glob
|
||||
import numpy as np
|
||||
import open3d as o3d
|
||||
import os
|
||||
from PIL import Image
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
|
||||
def main():
|
||||
# Parse command-line arguments
|
||||
parser = argparse.ArgumentParser(description='Generate depth maps and point clouds from images.')
|
||||
parser.add_argument('--encoder', default='vitl', type=str, choices=['vits', 'vitb', 'vitl', 'vitg'],
|
||||
help='Model encoder to use.')
|
||||
parser.add_argument('--load-from', default='', type=str, required=True,
|
||||
help='Path to the pre-trained model weights.')
|
||||
parser.add_argument('--max-depth', default=20, type=float,
|
||||
help='Maximum depth value for the depth map.')
|
||||
parser.add_argument('--img-path', type=str, required=True,
|
||||
help='Path to the input image or directory containing images.')
|
||||
parser.add_argument('--outdir', type=str, default='./vis_pointcloud',
|
||||
help='Directory to save the output point clouds.')
|
||||
parser.add_argument('--focal-length-x', default=470.4, type=float,
|
||||
help='Focal length along the x-axis.')
|
||||
parser.add_argument('--focal-length-y', default=470.4, type=float,
|
||||
help='Focal length along the y-axis.')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Determine the device to use (CUDA, MPS, or CPU)
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
# Model configuration based on the chosen encoder
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
# Initialize the DepthAnythingV2 model with the specified configuration
|
||||
depth_anything = DepthAnythingV2(**{**model_configs[args.encoder], 'max_depth': args.max_depth})
|
||||
depth_anything.load_state_dict(torch.load(args.load_from, map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
# Get the list of image files to process
|
||||
if os.path.isfile(args.img_path):
|
||||
if args.img_path.endswith('txt'):
|
||||
with open(args.img_path, 'r') as f:
|
||||
filenames = f.read().splitlines()
|
||||
else:
|
||||
filenames = [args.img_path]
|
||||
else:
|
||||
filenames = glob.glob(os.path.join(args.img_path, '**/*'), recursive=True)
|
||||
|
||||
# Create the output directory if it doesn't exist
|
||||
os.makedirs(args.outdir, exist_ok=True)
|
||||
|
||||
# Process each image file
|
||||
for k, filename in enumerate(filenames):
|
||||
print(f'Processing {k+1}/{len(filenames)}: {filename}')
|
||||
|
||||
# Load the image
|
||||
color_image = Image.open(filename).convert('RGB')
|
||||
width, height = color_image.size
|
||||
|
||||
# Read the image using OpenCV
|
||||
image = cv2.imread(filename)
|
||||
pred = depth_anything.infer_image(image, height)
|
||||
|
||||
# Resize depth prediction to match the original image size
|
||||
resized_pred = Image.fromarray(pred).resize((width, height), Image.NEAREST)
|
||||
|
||||
# Generate mesh grid and calculate point cloud coordinates
|
||||
x, y = np.meshgrid(np.arange(width), np.arange(height))
|
||||
x = (x - width / 2) / args.focal_length_x
|
||||
y = (y - height / 2) / args.focal_length_y
|
||||
z = np.array(resized_pred)
|
||||
points = np.stack((np.multiply(x, z), np.multiply(y, z), z), axis=-1).reshape(-1, 3)
|
||||
colors = np.array(color_image).reshape(-1, 3) / 255.0
|
||||
|
||||
# Create the point cloud and save it to the output directory
|
||||
pcd = o3d.geometry.PointCloud()
|
||||
pcd.points = o3d.utility.Vector3dVector(points)
|
||||
pcd.colors = o3d.utility.Vector3dVector(colors)
|
||||
o3d.io.write_point_cloud(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + ".ply"), pcd)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
now=$(date +"%Y%m%d_%H%M%S")
|
||||
|
||||
epoch=120
|
||||
bs=4
|
||||
gpus=8
|
||||
lr=0.000005
|
||||
encoder=vitl
|
||||
dataset=hypersim # vkitti
|
||||
img_size=518
|
||||
min_depth=0.001
|
||||
max_depth=20 # 80 for virtual kitti
|
||||
pretrained_from=../checkpoints/depth_anything_v2_${encoder}.pth
|
||||
save_path=exp/hypersim # exp/vkitti
|
||||
|
||||
mkdir -p $save_path
|
||||
|
||||
python3 -m torch.distributed.launch \
|
||||
--nproc_per_node=$gpus \
|
||||
--nnodes 1 \
|
||||
--node_rank=0 \
|
||||
--master_addr=localhost \
|
||||
--master_port=20596 \
|
||||
train.py --epoch $epoch --encoder $encoder --bs $bs --lr $lr --save-path $save_path --dataset $dataset \
|
||||
--img-size $img_size --min-depth $min_depth --max-depth $max_depth --pretrained-from $pretrained_from \
|
||||
--port 20596 2>&1 | tee -a $save_path/$now.log
|
|
@ -0,0 +1,5 @@
|
|||
matplotlib
|
||||
opencv-python
|
||||
open3d
|
||||
torch
|
||||
torchvision
|
|
@ -0,0 +1,81 @@
|
|||
import argparse
|
||||
import cv2
|
||||
import glob
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
import os
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2 Metric Depth Estimation')
|
||||
|
||||
parser.add_argument('--img-path', type=str)
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--outdir', type=str, default='./vis_depth')
|
||||
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
parser.add_argument('--load-from', type=str, default='checkpoints/depth_anything_v2_metric_hypersim_vitl.pth')
|
||||
parser.add_argument('--max-depth', type=float, default=20)
|
||||
|
||||
parser.add_argument('--save-numpy', dest='save_numpy', action='store_true', help='save the model raw output')
|
||||
parser.add_argument('--pred-only', dest='pred_only', action='store_true', help='only display the prediction')
|
||||
parser.add_argument('--grayscale', dest='grayscale', action='store_true', help='do not apply colorful palette')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**{**model_configs[args.encoder], 'max_depth': args.max_depth})
|
||||
depth_anything.load_state_dict(torch.load(args.load_from, map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
if os.path.isfile(args.img_path):
|
||||
if args.img_path.endswith('txt'):
|
||||
with open(args.img_path, 'r') as f:
|
||||
filenames = f.read().splitlines()
|
||||
else:
|
||||
filenames = [args.img_path]
|
||||
else:
|
||||
filenames = glob.glob(os.path.join(args.img_path, '**/*'), recursive=True)
|
||||
|
||||
os.makedirs(args.outdir, exist_ok=True)
|
||||
|
||||
cmap = matplotlib.colormaps.get_cmap('Spectral')
|
||||
|
||||
for k, filename in enumerate(filenames):
|
||||
print(f'Progress {k+1}/{len(filenames)}: {filename}')
|
||||
|
||||
raw_image = cv2.imread(filename)
|
||||
|
||||
depth = depth_anything.infer_image(raw_image, args.input_size)
|
||||
|
||||
if args.save_numpy:
|
||||
output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '_raw_depth_meter.npy')
|
||||
np.save(output_path, depth)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
if args.grayscale:
|
||||
depth = np.repeat(depth[..., np.newaxis], 3, axis=-1)
|
||||
else:
|
||||
depth = (cmap(depth)[:, :, :3] * 255)[:, :, ::-1].astype(np.uint8)
|
||||
|
||||
output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png')
|
||||
if args.pred_only:
|
||||
cv2.imwrite(output_path, depth)
|
||||
else:
|
||||
split_region = np.ones((raw_image.shape[0], 50, 3), dtype=np.uint8) * 255
|
||||
combined_result = cv2.hconcat([raw_image, split_region, depth])
|
||||
|
||||
cv2.imwrite(output_path, combined_result)
|
|
@ -0,0 +1,212 @@
|
|||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import pprint
|
||||
import random
|
||||
|
||||
import warnings
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.backends.cudnn as cudnn
|
||||
import torch.distributed as dist
|
||||
from torch.utils.data import DataLoader
|
||||
from torch.optim import AdamW
|
||||
import torch.nn.functional as F
|
||||
from torch.utils.tensorboard import SummaryWriter
|
||||
|
||||
from dataset.hypersim import Hypersim
|
||||
from dataset.kitti import KITTI
|
||||
from dataset.vkitti2 import VKITTI2
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
from util.dist_helper import setup_distributed
|
||||
from util.loss import SiLogLoss
|
||||
from util.metric import eval_depth
|
||||
from util.utils import init_log
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2 for Metric Depth Estimation')
|
||||
|
||||
parser.add_argument('--encoder', default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
parser.add_argument('--dataset', default='hypersim', choices=['hypersim', 'vkitti'])
|
||||
parser.add_argument('--img-size', default=518, type=int)
|
||||
parser.add_argument('--min-depth', default=0.001, type=float)
|
||||
parser.add_argument('--max-depth', default=20, type=float)
|
||||
parser.add_argument('--epochs', default=40, type=int)
|
||||
parser.add_argument('--bs', default=2, type=int)
|
||||
parser.add_argument('--lr', default=0.000005, type=float)
|
||||
parser.add_argument('--pretrained-from', type=str)
|
||||
parser.add_argument('--save-path', type=str, required=True)
|
||||
parser.add_argument('--local-rank', default=0, type=int)
|
||||
parser.add_argument('--port', default=None, type=int)
|
||||
|
||||
|
||||
def main():
|
||||
args = parser.parse_args()
|
||||
|
||||
warnings.simplefilter('ignore', np.RankWarning)
|
||||
|
||||
logger = init_log('global', logging.INFO)
|
||||
logger.propagate = 0
|
||||
|
||||
rank, world_size = setup_distributed(port=args.port)
|
||||
|
||||
if rank == 0:
|
||||
all_args = {**vars(args), 'ngpus': world_size}
|
||||
logger.info('{}\n'.format(pprint.pformat(all_args)))
|
||||
writer = SummaryWriter(args.save_path)
|
||||
|
||||
cudnn.enabled = True
|
||||
cudnn.benchmark = True
|
||||
|
||||
size = (args.img_size, args.img_size)
|
||||
if args.dataset == 'hypersim':
|
||||
trainset = Hypersim('dataset/splits/hypersim/train.txt', 'train', size=size)
|
||||
elif args.dataset == 'vkitti':
|
||||
trainset = VKITTI2('dataset/splits/vkitti2/train.txt', 'train', size=size)
|
||||
else:
|
||||
raise NotImplementedError
|
||||
trainsampler = torch.utils.data.distributed.DistributedSampler(trainset)
|
||||
trainloader = DataLoader(trainset, batch_size=args.bs, pin_memory=True, num_workers=4, drop_last=True, sampler=trainsampler)
|
||||
|
||||
if args.dataset == 'hypersim':
|
||||
valset = Hypersim('dataset/splits/hypersim/val.txt', 'val', size=size)
|
||||
elif args.dataset == 'vkitti':
|
||||
valset = KITTI('dataset/splits/kitti/val.txt', 'val', size=size)
|
||||
else:
|
||||
raise NotImplementedError
|
||||
valsampler = torch.utils.data.distributed.DistributedSampler(valset)
|
||||
valloader = DataLoader(valset, batch_size=1, pin_memory=True, num_workers=4, drop_last=True, sampler=valsampler)
|
||||
|
||||
local_rank = int(os.environ["LOCAL_RANK"])
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
model = DepthAnythingV2(**{**model_configs[args.encoder], 'max_depth': args.max_depth})
|
||||
|
||||
if args.pretrained_from:
|
||||
model.load_state_dict({k: v for k, v in torch.load(args.pretrained_from, map_location='cpu').items() if 'pretrained' in k}, strict=False)
|
||||
|
||||
model = torch.nn.SyncBatchNorm.convert_sync_batchnorm(model)
|
||||
model.cuda(local_rank)
|
||||
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[local_rank], broadcast_buffers=False,
|
||||
output_device=local_rank, find_unused_parameters=True)
|
||||
|
||||
criterion = SiLogLoss().cuda(local_rank)
|
||||
|
||||
optimizer = AdamW([{'params': [param for name, param in model.named_parameters() if 'pretrained' in name], 'lr': args.lr},
|
||||
{'params': [param for name, param in model.named_parameters() if 'pretrained' not in name], 'lr': args.lr * 10.0}],
|
||||
lr=args.lr, betas=(0.9, 0.999), weight_decay=0.01)
|
||||
|
||||
total_iters = args.epochs * len(trainloader)
|
||||
|
||||
previous_best = {'d1': 0, 'd2': 0, 'd3': 0, 'abs_rel': 100, 'sq_rel': 100, 'rmse': 100, 'rmse_log': 100, 'log10': 100, 'silog': 100}
|
||||
|
||||
for epoch in range(args.epochs):
|
||||
if rank == 0:
|
||||
logger.info('===========> Epoch: {:}/{:}, d1: {:.3f}, d2: {:.3f}, d3: {:.3f}'.format(epoch, args.epochs, previous_best['d1'], previous_best['d2'], previous_best['d3']))
|
||||
logger.info('===========> Epoch: {:}/{:}, abs_rel: {:.3f}, sq_rel: {:.3f}, rmse: {:.3f}, rmse_log: {:.3f}, '
|
||||
'log10: {:.3f}, silog: {:.3f}'.format(
|
||||
epoch, args.epochs, previous_best['abs_rel'], previous_best['sq_rel'], previous_best['rmse'],
|
||||
previous_best['rmse_log'], previous_best['log10'], previous_best['silog']))
|
||||
|
||||
trainloader.sampler.set_epoch(epoch + 1)
|
||||
|
||||
model.train()
|
||||
total_loss = 0
|
||||
|
||||
for i, sample in enumerate(trainloader):
|
||||
optimizer.zero_grad()
|
||||
|
||||
img, depth, valid_mask = sample['image'].cuda(), sample['depth'].cuda(), sample['valid_mask'].cuda()
|
||||
|
||||
if random.random() < 0.5:
|
||||
img = img.flip(-1)
|
||||
depth = depth.flip(-1)
|
||||
valid_mask = valid_mask.flip(-1)
|
||||
|
||||
pred = model(img)
|
||||
|
||||
loss = criterion(pred, depth, (valid_mask == 1) & (depth >= args.min_depth) & (depth <= args.max_depth))
|
||||
|
||||
loss.backward()
|
||||
optimizer.step()
|
||||
|
||||
total_loss += loss.item()
|
||||
|
||||
iters = epoch * len(trainloader) + i
|
||||
|
||||
lr = args.lr * (1 - iters / total_iters) ** 0.9
|
||||
|
||||
optimizer.param_groups[0]["lr"] = lr
|
||||
optimizer.param_groups[1]["lr"] = lr * 10.0
|
||||
|
||||
if rank == 0:
|
||||
writer.add_scalar('train/loss', loss.item(), iters)
|
||||
|
||||
if rank == 0 and i % 100 == 0:
|
||||
logger.info('Iter: {}/{}, LR: {:.7f}, Loss: {:.3f}'.format(i, len(trainloader), optimizer.param_groups[0]['lr'], loss.item()))
|
||||
|
||||
model.eval()
|
||||
|
||||
results = {'d1': torch.tensor([0.0]).cuda(), 'd2': torch.tensor([0.0]).cuda(), 'd3': torch.tensor([0.0]).cuda(),
|
||||
'abs_rel': torch.tensor([0.0]).cuda(), 'sq_rel': torch.tensor([0.0]).cuda(), 'rmse': torch.tensor([0.0]).cuda(),
|
||||
'rmse_log': torch.tensor([0.0]).cuda(), 'log10': torch.tensor([0.0]).cuda(), 'silog': torch.tensor([0.0]).cuda()}
|
||||
nsamples = torch.tensor([0.0]).cuda()
|
||||
|
||||
for i, sample in enumerate(valloader):
|
||||
|
||||
img, depth, valid_mask = sample['image'].cuda().float(), sample['depth'].cuda()[0], sample['valid_mask'].cuda()[0]
|
||||
|
||||
with torch.no_grad():
|
||||
pred = model(img)
|
||||
pred = F.interpolate(pred[:, None], depth.shape[-2:], mode='bilinear', align_corners=True)[0, 0]
|
||||
|
||||
valid_mask = (valid_mask == 1) & (depth >= args.min_depth) & (depth <= args.max_depth)
|
||||
|
||||
if valid_mask.sum() < 10:
|
||||
continue
|
||||
|
||||
cur_results = eval_depth(pred[valid_mask], depth[valid_mask])
|
||||
|
||||
for k in results.keys():
|
||||
results[k] += cur_results[k]
|
||||
nsamples += 1
|
||||
|
||||
torch.distributed.barrier()
|
||||
|
||||
for k in results.keys():
|
||||
dist.reduce(results[k], dst=0)
|
||||
dist.reduce(nsamples, dst=0)
|
||||
|
||||
if rank == 0:
|
||||
logger.info('==========================================================================================')
|
||||
logger.info('{:>8}, {:>8}, {:>8}, {:>8}, {:>8}, {:>8}, {:>8}, {:>8}, {:>8}'.format(*tuple(results.keys())))
|
||||
logger.info('{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}'.format(*tuple([(v / nsamples).item() for v in results.values()])))
|
||||
logger.info('==========================================================================================')
|
||||
print()
|
||||
|
||||
for name, metric in results.items():
|
||||
writer.add_scalar(f'eval/{name}', (metric / nsamples).item(), epoch)
|
||||
|
||||
for k in results.keys():
|
||||
if k in ['d1', 'd2', 'd3']:
|
||||
previous_best[k] = max(previous_best[k], (results[k] / nsamples).item())
|
||||
else:
|
||||
previous_best[k] = min(previous_best[k], (results[k] / nsamples).item())
|
||||
|
||||
if rank == 0:
|
||||
checkpoint = {
|
||||
'model': model.state_dict(),
|
||||
'optimizer': optimizer.state_dict(),
|
||||
'epoch': epoch,
|
||||
'previous_best': previous_best,
|
||||
}
|
||||
torch.save(checkpoint, os.path.join(args.save_path, 'latest.pth'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -0,0 +1,41 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
|
||||
|
||||
def setup_distributed(backend="nccl", port=None):
|
||||
"""AdaHessian Optimizer
|
||||
Lifted from https://github.com/BIGBALLON/distribuuuu/blob/master/distribuuuu/utils.py
|
||||
Originally licensed MIT, Copyright (c) 2020 Wei Li
|
||||
"""
|
||||
num_gpus = torch.cuda.device_count()
|
||||
|
||||
if "SLURM_JOB_ID" in os.environ:
|
||||
rank = int(os.environ["SLURM_PROCID"])
|
||||
world_size = int(os.environ["SLURM_NTASKS"])
|
||||
node_list = os.environ["SLURM_NODELIST"]
|
||||
addr = subprocess.getoutput(f"scontrol show hostname {node_list} | head -n1")
|
||||
# specify master port
|
||||
if port is not None:
|
||||
os.environ["MASTER_PORT"] = str(port)
|
||||
elif "MASTER_PORT" not in os.environ:
|
||||
os.environ["MASTER_PORT"] = "10685"
|
||||
if "MASTER_ADDR" not in os.environ:
|
||||
os.environ["MASTER_ADDR"] = addr
|
||||
os.environ["WORLD_SIZE"] = str(world_size)
|
||||
os.environ["LOCAL_RANK"] = str(rank % num_gpus)
|
||||
os.environ["RANK"] = str(rank)
|
||||
else:
|
||||
rank = int(os.environ["RANK"])
|
||||
world_size = int(os.environ["WORLD_SIZE"])
|
||||
|
||||
torch.cuda.set_device(rank % num_gpus)
|
||||
|
||||
dist.init_process_group(
|
||||
backend=backend,
|
||||
world_size=world_size,
|
||||
rank=rank,
|
||||
)
|
||||
return rank, world_size
|
|
@ -0,0 +1,16 @@
|
|||
import torch
|
||||
from torch import nn
|
||||
|
||||
|
||||
class SiLogLoss(nn.Module):
|
||||
def __init__(self, lambd=0.5):
|
||||
super().__init__()
|
||||
self.lambd = lambd
|
||||
|
||||
def forward(self, pred, target, valid_mask):
|
||||
valid_mask = valid_mask.detach()
|
||||
diff_log = torch.log(target[valid_mask]) - torch.log(pred[valid_mask])
|
||||
loss = torch.sqrt(torch.pow(diff_log, 2).mean() -
|
||||
self.lambd * torch.pow(diff_log.mean(), 2))
|
||||
|
||||
return loss
|
|
@ -0,0 +1,26 @@
|
|||
import torch
|
||||
|
||||
|
||||
def eval_depth(pred, target):
|
||||
assert pred.shape == target.shape
|
||||
|
||||
thresh = torch.max((target / pred), (pred / target))
|
||||
|
||||
d1 = torch.sum(thresh < 1.25).float() / len(thresh)
|
||||
d2 = torch.sum(thresh < 1.25 ** 2).float() / len(thresh)
|
||||
d3 = torch.sum(thresh < 1.25 ** 3).float() / len(thresh)
|
||||
|
||||
diff = pred - target
|
||||
diff_log = torch.log(pred) - torch.log(target)
|
||||
|
||||
abs_rel = torch.mean(torch.abs(diff) / target)
|
||||
sq_rel = torch.mean(torch.pow(diff, 2) / target)
|
||||
|
||||
rmse = torch.sqrt(torch.mean(torch.pow(diff, 2)))
|
||||
rmse_log = torch.sqrt(torch.mean(torch.pow(diff_log , 2)))
|
||||
|
||||
log10 = torch.mean(torch.abs(torch.log10(pred) - torch.log10(target)))
|
||||
silog = torch.sqrt(torch.pow(diff_log, 2).mean() - 0.5 * torch.pow(diff_log.mean(), 2))
|
||||
|
||||
return {'d1': d1.item(), 'd2': d2.item(), 'd3': d3.item(), 'abs_rel': abs_rel.item(), 'sq_rel': sq_rel.item(),
|
||||
'rmse': rmse.item(), 'rmse_log': rmse_log.item(), 'log10':log10.item(), 'silog':silog.item()}
|
|
@ -0,0 +1,26 @@
|
|||
import os
|
||||
import re
|
||||
import numpy as np
|
||||
import logging
|
||||
|
||||
logs = set()
|
||||
|
||||
|
||||
def init_log(name, level=logging.INFO):
|
||||
if (name, level) in logs:
|
||||
return
|
||||
logs.add((name, level))
|
||||
logger = logging.getLogger(name)
|
||||
logger.setLevel(level)
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(level)
|
||||
if "SLURM_PROCID" in os.environ:
|
||||
rank = int(os.environ["SLURM_PROCID"])
|
||||
logger.addFilter(lambda record: rank == 0)
|
||||
else:
|
||||
rank = 0
|
||||
format_str = "[%(asctime)s][%(levelname)8s] %(message)s"
|
||||
formatter = logging.Formatter(format_str)
|
||||
ch.setFormatter(formatter)
|
||||
logger.addHandler(ch)
|
||||
return logger
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"\u9879\u76ee\u540d\u79f0": "GDCZD",
|
||||
"\u9879\u76ee\u8d1f\u8d23\u4eba": "WMZ",
|
||||
"\u91c7\u96c6\u4eba": "ZWF",
|
||||
"\u5e74\u6708": "202503"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
gradio_imageslider
|
||||
gradio==4.29.0
|
||||
matplotlib
|
||||
opencv-python
|
||||
torch
|
||||
torchvision
|
|
@ -0,0 +1,73 @@
|
|||
import argparse
|
||||
import cv2
|
||||
import glob
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
import os
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2')
|
||||
|
||||
parser.add_argument('--img-path', default='./test2',type=str)
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--outdir', type=str, default='./vis_depth')
|
||||
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
|
||||
parser.add_argument('--pred-only', dest='pred_only', default=True,action='store_true', help='only display the prediction')
|
||||
parser.add_argument('--grayscale', dest='grayscale', default=False,action='store_true', help='do not apply colorful palette')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**model_configs[args.encoder])
|
||||
depth_anything.load_state_dict(torch.load(f'checkpoints/depth_anything_v2_{args.encoder}.pth', map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
if os.path.isfile(args.img_path):
|
||||
if args.img_path.endswith('txt'):
|
||||
with open(args.img_path, 'r') as f:
|
||||
filenames = f.read().splitlines()
|
||||
else:
|
||||
filenames = [args.img_path]
|
||||
else:
|
||||
filenames = glob.glob(os.path.join(args.img_path, '**/*'), recursive=True)
|
||||
|
||||
os.makedirs(args.outdir, exist_ok=True)
|
||||
|
||||
cmap = matplotlib.colormaps.get_cmap('Spectral_r')
|
||||
|
||||
for k, filename in enumerate(filenames):
|
||||
print(f'Progress {k+1}/{len(filenames)}: {filename}')
|
||||
|
||||
raw_image = cv2.imread(filename)
|
||||
|
||||
depth = depth_anything.infer_image(raw_image, args.input_size)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
if args.grayscale:
|
||||
depth = np.repeat(depth[..., np.newaxis], 3, axis=-1)
|
||||
else:
|
||||
depth = (cmap(depth)[:, :, :3] * 255)[:, :, ::-1].astype(np.uint8)
|
||||
|
||||
if args.pred_only:
|
||||
cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), depth)
|
||||
else:
|
||||
split_region = np.ones((raw_image.shape[0], 50, 3), dtype=np.uint8) * 255
|
||||
combined_result = cv2.hconcat([raw_image, split_region, depth])
|
||||
|
||||
cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), combined_result)
|
|
@ -0,0 +1,76 @@
|
|||
import argparse
|
||||
import cv2
|
||||
import glob
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
import os
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2')
|
||||
|
||||
parser.add_argument('--img-path', default='./test2',type=str)
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--outdir', type=str, default='./vis_depth')
|
||||
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
|
||||
parser.add_argument('--pred-only', dest='pred_only', default=False,action='store_true', help='only display the prediction')
|
||||
parser.add_argument('--grayscale', dest='grayscale', default=False,action='store_true', help='do not apply colorful palette')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**model_configs[args.encoder])
|
||||
depth_anything.load_state_dict(torch.load(f'checkpoints/depth_anything_v2_{args.encoder}.pth', map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
if os.path.isfile(args.img_path):
|
||||
if args.img_path.endswith('txt'):
|
||||
with open(args.img_path, 'r') as f:
|
||||
filenames = f.read().splitlines()
|
||||
else:
|
||||
filenames = [args.img_path]
|
||||
else:
|
||||
filenames = glob.glob(os.path.join(args.img_path, '**/*'), recursive=True)
|
||||
|
||||
os.makedirs(args.outdir, exist_ok=True)
|
||||
|
||||
cmap = matplotlib.colormaps.get_cmap('Spectral_r')
|
||||
|
||||
for k, filename in enumerate(filenames):
|
||||
print(f'Progress {k+1}/{len(filenames)}: {filename}')
|
||||
|
||||
raw_image = cv2.imread(filename)
|
||||
|
||||
depth = depth_anything.infer_image(raw_image, args.input_size)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
_, otsu_mask = cv2.threshold(depth, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
|
||||
cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), otsu_mask)
|
||||
#
|
||||
# if args.grayscale:
|
||||
# depth = np.repeat(depth[..., np.newaxis], 3, axis=-1)
|
||||
# else:
|
||||
# depth = (cmap(depth)[:, :, :3] * 255)[:, :, ::-1].astype(np.uint8)
|
||||
#
|
||||
# if args.pred_only:
|
||||
# cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), depth)
|
||||
# else:
|
||||
# split_region = np.ones((raw_image.shape[0], 50, 3), dtype=np.uint8) * 255
|
||||
# combined_result = cv2.hconcat([raw_image, split_region, depth])
|
||||
#
|
||||
# cv2.imwrite(os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.png'), combined_result)
|
|
@ -0,0 +1,92 @@
|
|||
import argparse
|
||||
import cv2
|
||||
import glob
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
import os
|
||||
import torch
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2')
|
||||
|
||||
parser.add_argument('--video-path', type=str)
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--outdir', type=str, default='./vis_video_depth')
|
||||
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
|
||||
parser.add_argument('--pred-only', dest='pred_only', action='store_true', help='only display the prediction')
|
||||
parser.add_argument('--grayscale', dest='grayscale', action='store_true', help='do not apply colorful palette')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**model_configs[args.encoder])
|
||||
depth_anything.load_state_dict(torch.load(f'checkpoints/depth_anything_v2_{args.encoder}.pth', map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
if os.path.isfile(args.video_path):
|
||||
if args.video_path.endswith('txt'):
|
||||
with open(args.video_path, 'r') as f:
|
||||
lines = f.read().splitlines()
|
||||
else:
|
||||
filenames = [args.video_path]
|
||||
else:
|
||||
filenames = glob.glob(os.path.join(args.video_path, '**/*'), recursive=True)
|
||||
|
||||
os.makedirs(args.outdir, exist_ok=True)
|
||||
|
||||
margin_width = 50
|
||||
cmap = matplotlib.colormaps.get_cmap('Spectral_r')
|
||||
|
||||
for k, filename in enumerate(filenames):
|
||||
print(f'Progress {k+1}/{len(filenames)}: {filename}')
|
||||
|
||||
raw_video = cv2.VideoCapture(filename)
|
||||
frame_width, frame_height = int(raw_video.get(cv2.CAP_PROP_FRAME_WIDTH)), int(raw_video.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
||||
frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
|
||||
|
||||
if args.pred_only:
|
||||
output_width = frame_width
|
||||
else:
|
||||
output_width = frame_width * 2 + margin_width
|
||||
|
||||
output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')
|
||||
out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
|
||||
|
||||
while raw_video.isOpened():
|
||||
ret, raw_frame = raw_video.read()
|
||||
if not ret:
|
||||
break
|
||||
|
||||
depth = depth_anything.infer_image(raw_frame, args.input_size)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
if args.grayscale:
|
||||
depth = np.repeat(depth[..., np.newaxis], 3, axis=-1)
|
||||
else:
|
||||
depth = (cmap(depth)[:, :, :3] * 255)[:, :, ::-1].astype(np.uint8)
|
||||
|
||||
if args.pred_only:
|
||||
out.write(depth)
|
||||
else:
|
||||
split_region = np.ones((frame_height, margin_width, 3), dtype=np.uint8) * 255
|
||||
combined_frame = cv2.hconcat([raw_frame, split_region, depth])
|
||||
|
||||
out.write(combined_frame)
|
||||
|
||||
raw_video.release()
|
||||
out.release()
|
|
@ -0,0 +1,162 @@
|
|||
import tkinter as tk
|
||||
from tkinter import ttk, filedialog, messagebox, simpledialog
|
||||
import json
|
||||
import os
|
||||
from lighter import process_images
|
||||
|
||||
class NamingConfigApp:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("图片命名配置工具")
|
||||
|
||||
# 配置数据存储
|
||||
self.config_data = {}
|
||||
self.current_frame = None
|
||||
|
||||
# 创建界面
|
||||
self.create_widgets()
|
||||
self.load_config() # 自动尝试加载已有配置
|
||||
|
||||
def create_widgets(self):
|
||||
# 顶部按钮区域
|
||||
top_frame = ttk.Frame(self.root, padding=10)
|
||||
top_frame.pack(fill=tk.X)
|
||||
|
||||
|
||||
|
||||
# 配置显示区域
|
||||
self.canvas = tk.Canvas(self.root)
|
||||
self.scrollbar = ttk.Scrollbar(self.root, orient="vertical", command=self.canvas.yview)
|
||||
self.scrollable_frame = ttk.Frame(self.canvas)
|
||||
ttk.Label(self.scrollable_frame, text="配置项:").pack(side=tk.TOP, pady=10)
|
||||
self.scrollable_frame.bind(
|
||||
"<Configure>",
|
||||
lambda e: self.canvas.configure(
|
||||
scrollregion=self.canvas.bbox("all")
|
||||
)
|
||||
)
|
||||
|
||||
self.canvas.create_window((0, 0), window=self.scrollable_frame, anchor="nw")
|
||||
self.canvas.configure(yscrollcommand=self.scrollbar.set)
|
||||
|
||||
self.canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
|
||||
self.scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
|
||||
|
||||
# 右部操作区域
|
||||
right_frame = ttk.Frame(self.root, padding=10)
|
||||
right_frame.pack(fill=tk.X)
|
||||
ttk.Button(right_frame, text="新建配置", command=self.create_new_config).pack(side=tk.BOTTOM, padx=5)
|
||||
ttk.Button(right_frame, text="加载配置", command=self.load_config_dialog).pack(side=tk.BOTTOM, padx=5)
|
||||
ttk.Button(right_frame, text="保存配置", command=self.save_config).pack(side=tk.BOTTOM, padx=5)
|
||||
ttk.Button(right_frame, text="处理图片", command=self.process_images).pack(side=tk.TOP, padx=5)
|
||||
# 底部提示区域
|
||||
bottom_frame = ttk.Frame(self.root, padding=10)
|
||||
bottom_frame.pack(fill=tk.Y)
|
||||
ttk.Label(bottom_frame, text=
|
||||
"注意:请在左侧配置区域进行配置。项目名称请大写缩写。\n"
|
||||
"点击“处理图片”按钮进行图片处理。无新需求不用新建配置。\n"
|
||||
"处理图片时请选择后面带#号的风机组和叶片号顶层文件夹。\n"
|
||||
).pack(side=tk.BOTTOM, padx=5)#"新建配置后修改utils.get_name()函数中的规则即可"
|
||||
|
||||
def create_config_fields(self):
|
||||
# 清空现有配置显示
|
||||
if self.current_frame:
|
||||
self.current_frame.destroy()
|
||||
|
||||
self.current_frame = ttk.Frame(self.scrollable_frame)
|
||||
self.current_frame.pack(fill=tk.BOTH, expand=True)
|
||||
|
||||
# 动态生成配置项
|
||||
for i, (title, value) in enumerate(self.config_data.items()):
|
||||
row_frame = ttk.Frame(self.current_frame)
|
||||
row_frame.grid(row=i, column=0, sticky="ew", padx=5, pady=2)
|
||||
|
||||
ttk.Label(row_frame, text=title, width=20).pack(side=tk.LEFT)
|
||||
entry = ttk.Entry(row_frame)
|
||||
entry.insert(0, value)
|
||||
entry.pack(side=tk.RIGHT, fill=tk.X, expand=True)
|
||||
|
||||
# 保存引用以便后续获取值
|
||||
self.config_data[title] = entry
|
||||
|
||||
def create_new_config(self):
|
||||
# 创建新配置项对话框
|
||||
title = simpledialog.askstring("新建配置项", "请输入配置项名称:")
|
||||
if title:
|
||||
if title in self.config_data:
|
||||
messagebox.showerror("错误", "配置项已存在!")
|
||||
return
|
||||
self.config_data[title] = "" # 初始化空值
|
||||
self.create_config_fields()
|
||||
|
||||
def load_config_dialog(self):
|
||||
# 加载配置对话框
|
||||
file_path = filedialog.askopenfilename(
|
||||
initialdir=os.getcwd(),
|
||||
title="选择配置文件",
|
||||
filetypes=(("JSON文件", "*.json"),)
|
||||
)
|
||||
if file_path:
|
||||
self.load_config(file_path)
|
||||
|
||||
def load_config(self, file_path="naming_config.json"):#naming_config.json
|
||||
# 加载配置逻辑
|
||||
try:
|
||||
with open(file_path, "r") as f:
|
||||
data = json.load(f)
|
||||
self.config_data = {k: v for k, v in data.items()}
|
||||
self.create_config_fields()
|
||||
except FileNotFoundError:
|
||||
messagebox.showinfo("信息", "未找到配置文件,请新建配置")
|
||||
except Exception as e:
|
||||
messagebox.showerror("错误", f"配置文件加载失败:{str(e)}")
|
||||
|
||||
def save_config(self):
|
||||
# 保存配置逻辑
|
||||
try:
|
||||
# 获取所有输入框的值
|
||||
final_config = {title: entry.get()
|
||||
for title, entry in self.config_data.items()}
|
||||
|
||||
with open("naming_config.json", "w") as f:
|
||||
json.dump(final_config, f, indent=2)
|
||||
|
||||
messagebox.showinfo("成功", "配置保存成功!")
|
||||
except Exception as e:
|
||||
messagebox.showerror("错误", f"保存失败:{str(e)}")
|
||||
|
||||
def process_images(self):
|
||||
# 处理图片逻辑
|
||||
path = filedialog.askdirectory(title="选择图片文件夹")
|
||||
if not path:
|
||||
return
|
||||
|
||||
config = {title: entry.get() for title, entry in self.config_data.items()}
|
||||
# 这里调用实际的处理函数
|
||||
self.actual_image_processor(path, config)
|
||||
messagebox.showinfo("完成", f"已处理图片目录:{path}")
|
||||
|
||||
def actual_image_processor(self, path, config):
|
||||
"""实际图片处理函数(需要根据需求实现)"""
|
||||
print(f"处理路径:{path}")
|
||||
print(f"当前配置:{config}")
|
||||
input_dir=path
|
||||
output_dir = input_dir+"+调整"
|
||||
|
||||
# if not os.path.exists(output_dir):
|
||||
# os.makedirs(output_dir,exist_ok=True)
|
||||
|
||||
# gamma = float(input("请输入筛选阴影区阈值(0~255),建议120~200,优先160,若阴影亮度调高效果不明显可以调大值: "))
|
||||
# threshold = float(input("请输入筛选爆光区阈值(0~255),建议240~254,优先245,若曝光区亮度降低不明显或区域较大可以调小: "))
|
||||
gamma = 180
|
||||
threshold = 253
|
||||
no_auto_bright = False
|
||||
process_images(input_dir, output_dir, gamma, threshold, no_auto_bright,config)
|
||||
print("处理完成,输出路径:", output_dir)
|
||||
# 在这里添加实际的图片处理逻辑
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
app = NamingConfigApp(root)
|
||||
root.mainloop()
|
|
@ -0,0 +1,64 @@
|
|||
|
||||
from PIL import ExifTags
|
||||
from PIL.ExifTags import TAGS
|
||||
from tkinter import *
|
||||
import tkinter as tk
|
||||
from tkinter import ttk, messagebox, filedialog
|
||||
import os
|
||||
import json
|
||||
from PIL import Image
|
||||
|
||||
def get_name(config,forward,file):
|
||||
if config is None:
|
||||
return file
|
||||
prefix=config['年月']+'-'+config['项目名称']+'-'+forward+'-'+config['项目负责人']+'-'+config['采集人']+'-'
|
||||
name=prefix+file
|
||||
return name
|
||||
def get_exif_data(img):
|
||||
"""
|
||||
This function returns the exif data of an image as a dictionary.
|
||||
"""
|
||||
exif_data = {}
|
||||
info = img.getexif()
|
||||
if info:
|
||||
for tag, value in info.items():
|
||||
decoded = TAGS.get(tag, tag)
|
||||
exif_data[decoded] = value
|
||||
return info
|
||||
|
||||
def copy_and_save_img_exif(img1, img2, save_path="./"):
|
||||
"""
|
||||
This function copies the exif data from img1 to img2 and saves the new image to save_path.
|
||||
"""
|
||||
img1_exif = get_exif_data(img1)
|
||||
print(img1_exif)
|
||||
DateTime=img1_exif.get("DateTime")#like "2025:01:15 17:41:41"
|
||||
DateTime=DateTime.split(" ")[0].replace(":", "-")#like "2025-01-15 17-41-41"
|
||||
XPComment=img1_exif.get("XPComment").decode("utf-16")#like "DJI_20250115174142_0121_Z"
|
||||
print(XPComment)
|
||||
img1_exif["XPComment"]="22110".encode("utf-16")#like "22110"
|
||||
img2_exif = get_exif_data(img2)
|
||||
# img2.save(save_path, exif=img1_exif)
|
||||
def specify_name_group_blade(file_path):
|
||||
"""
|
||||
This function returns the name of the file with the extension.
|
||||
"""
|
||||
path=os.path.normpath(file_path)
|
||||
|
||||
sp=path.split("/")
|
||||
name=[]
|
||||
for i in range(len(sp)):
|
||||
if "#" in sp[i]:
|
||||
name.append(sp[i].split("#")[0])
|
||||
if len(name)==0:
|
||||
print("no # in file name")
|
||||
return "xxx-xxx-xxx"
|
||||
if len(name)>2:
|
||||
name=name[-2:]
|
||||
name.append('xxx')
|
||||
# name.append(os.path.split(file_path)[-1])
|
||||
return "-".join(name)
|
||||
if __name__ == "__main__":
|
||||
|
||||
s=os.path.split("/home/user/Desktop/test/IMG_20210812_123456.jpg")
|
||||
print(s)
|
|
@ -0,0 +1,262 @@
|
|||
import torch
|
||||
import cv2
|
||||
import rawpy
|
||||
from PIL import Image
|
||||
from tqdm import tqdm
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import argparse
|
||||
import numpy as np
|
||||
import os
|
||||
|
||||
from depth_anything_v2.dpt import DepthAnythingV2
|
||||
|
||||
def extraction_win_lamina_mask(raw_image):
|
||||
# 前面读的都是RGB图像,深度估计需要BGR,即下面是把RGB→BGR
|
||||
raw_image = cv2.cvtColor(raw_image, cv2.COLOR_BGR2RGB)
|
||||
parser = argparse.ArgumentParser(description='Depth Anything V2')
|
||||
parser.add_argument('--input-size', type=int, default=518)
|
||||
parser.add_argument('--encoder', type=str, default='vitl', choices=['vits', 'vitb', 'vitl', 'vitg'])
|
||||
args = parser.parse_args()
|
||||
DEVICE = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu'
|
||||
model_configs = {
|
||||
'vits': {'encoder': 'vits', 'features': 64, 'out_channels': [48, 96, 192, 384]},
|
||||
'vitb': {'encoder': 'vitb', 'features': 128, 'out_channels': [96, 192, 384, 768]},
|
||||
'vitl': {'encoder': 'vitl', 'features': 256, 'out_channels': [256, 512, 1024, 1024]},
|
||||
'vitg': {'encoder': 'vitg', 'features': 384, 'out_channels': [1536, 1536, 1536, 1536]}
|
||||
}
|
||||
|
||||
depth_anything = DepthAnythingV2(**model_configs[args.encoder])
|
||||
depth_anything.load_state_dict(
|
||||
torch.load(f'checkpoints/depth_anything_v2_{args.encoder}.pth', map_location='cpu'))
|
||||
depth_anything = depth_anything.to(DEVICE).eval()
|
||||
|
||||
depth = depth_anything.infer_image(raw_image, args.input_size)
|
||||
|
||||
depth = (depth - depth.min()) / (depth.max() - depth.min()) * 255.0
|
||||
depth = depth.astype(np.uint8)
|
||||
|
||||
_, otsu_mask = cv2.threshold(depth, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
|
||||
return otsu_mask
|
||||
|
||||
|
||||
def check_overexposure(image, lamina_mask,threshold):
|
||||
"""
|
||||
检查图像中是否有过曝区域
|
||||
:param image: 输入图像
|
||||
:param threshold: 亮度值的阈值,像素值超过该值则认为是过曝区域
|
||||
:return: 一个二值图像,过曝区域为白色,其它区域为黑色
|
||||
"""
|
||||
# 转换为浮动数据类型并归一化
|
||||
image_float = image.astype(np.float32)
|
||||
|
||||
# 获取每个像素的亮度值(可以使用 YUV 或 RGB 亮度)
|
||||
gray_image = cv2.cvtColor(image_float, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
# 标记过曝区域,亮度大于阈值的像素为过曝区域
|
||||
overexposure_mask = gray_image > threshold
|
||||
|
||||
overexposure_mask = (lamina_mask == 255) & overexposure_mask #只取叶片的亮光区mask
|
||||
|
||||
overexposure_number = np.sum(overexposure_mask * 1)
|
||||
overexposed_pixels = gray_image[overexposure_mask]
|
||||
# 计算曝光区域的平均亮度
|
||||
if overexposed_pixels.size > 0:
|
||||
avg_overexposed_value = np.mean(overexposed_pixels)
|
||||
else:
|
||||
avg_overexposed_value = 0 # 如果没有曝光区域,返回 0
|
||||
|
||||
return overexposure_mask, avg_overexposed_value,overexposure_number
|
||||
|
||||
def check_shawn(image,lamina_mask, threshold):
|
||||
"""
|
||||
检查图像中是否有阴影区域
|
||||
:param image: 输入图像
|
||||
:param threshold: 亮度值的阈值,像素值小于该值则认为是过阴影域
|
||||
:return: 一个二值图像,过曝区域为白色,其它区域为黑色
|
||||
"""
|
||||
|
||||
# 转换为浮动数据类型并归一化
|
||||
image_float = image.astype(np.float32)
|
||||
# 获取每个像素的亮度值(可以使用 YUV 或 RGB 亮度)
|
||||
gray_image = cv2.cvtColor(image_float, cv2.COLOR_BGR2GRAY)
|
||||
# 标记阴影区域,亮度小于阈值的像素为阴影区域
|
||||
shawn_mask = gray_image < threshold
|
||||
|
||||
shawn_mask = (lamina_mask == 255) & shawn_mask
|
||||
|
||||
shawn_number = np.sum(shawn_mask * 1)
|
||||
shawn_pixels = gray_image[shawn_mask]
|
||||
# 计算阴影区域的平均亮度
|
||||
if shawn_pixels.size > 0:
|
||||
avg_shawn_value = np.mean(shawn_pixels)
|
||||
else:
|
||||
avg_shawn_value = 0
|
||||
|
||||
return shawn_mask, avg_shawn_value,shawn_number
|
||||
|
||||
def smooth_overexposed_regions(image, overexposure_mask, kernel_size=(15, 15)):
|
||||
"""
|
||||
对过曝区域进行平滑处理,修复与周围区域的过渡
|
||||
:param image: 输入图像
|
||||
:param overexposure_mask: 过曝区域的掩码
|
||||
:param kernel_size: 高斯核大小
|
||||
:return: 平滑过曝区域后的图像
|
||||
"""
|
||||
# 使用高斯模糊平滑过曝区域和周围区域
|
||||
smoothed_image = cv2.GaussianBlur(image, kernel_size, 0)
|
||||
|
||||
# 将平滑后的图像和原始图像合成,修复过曝区域
|
||||
fixed_image = np.where(overexposure_mask[..., None] == 255, image,smoothed_image)
|
||||
|
||||
return fixed_image
|
||||
|
||||
def bilateral_filter_adjustment(image, high_light_mask, d=15, sigma_color=75, sigma_space=75):
|
||||
"""
|
||||
使用双边滤波器平滑高光区域与周围区域的过渡
|
||||
:param image: 输入图像
|
||||
:param high_light_mask: 高光区域的掩码
|
||||
:param d: 邻域的直径
|
||||
:param sigma_color: 颜色空间的标准差
|
||||
:param sigma_space: 坐标空间的标准差
|
||||
:return: 平滑后的图像
|
||||
"""
|
||||
# 对整个图像应用双边滤波
|
||||
filtered_image = cv2.bilateralFilter(image, d, sigma_color, sigma_space)
|
||||
|
||||
# 合成平滑后的图像和原图,保留非高光部分
|
||||
final_image = np.where(high_light_mask[..., None] == 0, image, filtered_image)
|
||||
|
||||
return final_image
|
||||
|
||||
def adjust_highlights_shadows(image, threshold_shawn,threshold):
|
||||
|
||||
lamina_mask = extraction_win_lamina_mask(image)
|
||||
|
||||
shawn_mask,avg_shawn_value,shawn_number = check_shawn(image,lamina_mask,threshold_shawn)
|
||||
# 调整亮度,gamma < 1 时变亮,gamma > 1 时变暗
|
||||
gamma = 1 - (threshold_shawn-avg_shawn_value)/255.0
|
||||
# print('阴影区调整的gama: '+str(gamma))#+str('\n'))
|
||||
lookup_table = np.array([((i / 255.0) ** gamma) * 255 for i in range(256)]).astype('uint8')
|
||||
# 应用 gamma 校正
|
||||
if shawn_number !=0:
|
||||
image[shawn_mask == True] = cv2.LUT(image[shawn_mask == True], lookup_table)
|
||||
gamma_corrected_image = image
|
||||
else:
|
||||
gamma_corrected_image = image
|
||||
#gamma_corrected_image = cv2.LUT(image, lookup_table)
|
||||
|
||||
#寻找过爆区域
|
||||
overexposure_mask,avg_overexposed_value,overexposure_number = check_overexposure(gamma_corrected_image,lamina_mask,threshold)
|
||||
reduction_factor = 1-(avg_overexposed_value-threshold) / 255
|
||||
#reduction_factor = (avg_overexposed_value/255)*scale
|
||||
# print("降低曝光区比例:" + str(reduction_factor))
|
||||
|
||||
# 调整亮度,gamma < 1 时变亮(越小越亮),gamma > 1 时变暗(越大越暗),
|
||||
print((1+reduction_factor))
|
||||
lookup_table = np.array([((i / 255.0) ** (1+reduction_factor)) * 255 for i in range(256)]).astype('uint8')
|
||||
# 应用 gamma 校正
|
||||
if overexposure_number !=0:
|
||||
gamma_corrected_image[overexposure_mask == True] = cv2.LUT(gamma_corrected_image[overexposure_mask == True], lookup_table)
|
||||
|
||||
|
||||
#gamma_corrected_image[overexposure_mask == True] = np.clip(gamma_corrected_image[overexposure_mask == True] * reduction_factor, 0, 255)
|
||||
|
||||
|
||||
#smoothed_image = smooth_overexposed_regions(gamma_corrected_image, overexposure_mask)
|
||||
#smoothed_image = bilateral_filter_adjustment(gamma_corrected_image, overexposure_mask, d=15, sigma_color=75, sigma_space=75)
|
||||
|
||||
return gamma_corrected_image
|
||||
|
||||
def process_single_image(input_path, output_path, gamma, threshold, no_auto_bright):
|
||||
if input_path.lower().endswith(('.arw', '.dng')):
|
||||
with rawpy.imread(input_path) as raw:
|
||||
# 获取 RGB 图像数据
|
||||
rgb_image = raw.postprocess(use_camera_wb=True, no_auto_bright=no_auto_bright, output_bps=16)
|
||||
rgb_image = np.uint8(rgb_image / 256)
|
||||
|
||||
if rgb_image is not None:
|
||||
adjusted_image = adjust_highlights_shadows(rgb_image, gamma, threshold)
|
||||
# 使用 Pillow 创建图像
|
||||
image = Image.fromarray(adjusted_image)
|
||||
image.save(os.path.splitext(output_path)[0] + '.JPG', 'JPEG', quality=100)
|
||||
else:
|
||||
print(f"Failed to read image: {input_path}")
|
||||
else:
|
||||
image_pil = Image.open(input_path)
|
||||
image = np.array(image_pil)
|
||||
if image is not None:
|
||||
adjusted_image = adjust_highlights_shadows(image, gamma, threshold)
|
||||
images = Image.fromarray(adjusted_image)
|
||||
images.save(output_path, 'JPEG', quality=100)
|
||||
else:
|
||||
print(f"Failed to read image: {input_path}")
|
||||
|
||||
def process_images(input_dir, output_dir,gamma,threshold,no_auto_bright):
|
||||
all_files = []
|
||||
# with tqdm(total=len(all_files), desc="Processing images", unit="file") as pbar:
|
||||
for root, dirs, files in os.walk(input_dir):
|
||||
for file in files:
|
||||
if file.lower().endswith(('.png', '.jpg', '.jpeg','.arw','.dng')):
|
||||
# print(file)
|
||||
input_path = os.path.join(root, file)
|
||||
output_subdir = os.path.join(output_dir, os.path.relpath(root, input_dir))
|
||||
os.makedirs(output_subdir, exist_ok=True)
|
||||
output_path = os.path.join(output_subdir, file)
|
||||
all_files.append((input_path, output_path))
|
||||
# pbar.update(1)
|
||||
with tqdm(total=len(all_files), desc="Processing images", unit="file") as pbar:
|
||||
with ThreadPoolExecutor() as executor:
|
||||
futures = []
|
||||
for input_path, output_path in all_files:
|
||||
future = executor.submit(process_single_image, input_path, output_path, gamma, threshold,no_auto_bright)
|
||||
future.add_done_callback(lambda _: pbar.update(1))
|
||||
futures.append(future)
|
||||
for future in futures:
|
||||
future.result()
|
||||
|
||||
# if file.lower().endswith(('.arw','.dng')):
|
||||
# with rawpy.imread(input_path) as raw:
|
||||
# # 获取 RGB 图像数据
|
||||
# rgb_image = raw.postprocess(use_camera_wb=True, no_auto_bright=no_auto_bright, output_bps=16)
|
||||
# rgb_image = np.uint8(rgb_image / 256)
|
||||
#
|
||||
# if rgb_image is not None:
|
||||
# adjusted_image = adjust_highlights_shadows(rgb_image,gamma,threshold)
|
||||
# # 使用 Pillow 创建图像
|
||||
# image = Image.fromarray(adjusted_image)
|
||||
# image.save(os.path.splitext(output_path)[0]+'.JPG', 'JPEG', quality=100)
|
||||
# else:
|
||||
# print(f"Failed to read image: {input_path}")
|
||||
# else:
|
||||
# #image = cv2.imread(input_path)
|
||||
# image_pil = Image.open(input_path)
|
||||
# image = np.array(image_pil)
|
||||
# if image is not None:
|
||||
# adjusted_image = adjust_highlights_shadows(image, gamma,threshold)
|
||||
# images = Image.fromarray(adjusted_image)
|
||||
# images.save(output_path, 'JPEG', quality=100)
|
||||
# else:
|
||||
# print(f"Failed to read image: {input_path}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# input_dir = input("请输入处理图片路径: ")
|
||||
# output_dir = input("请输入保存图片路径: ")
|
||||
root = tk.Tk()
|
||||
root.withdraw() # 不显示主窗口
|
||||
# 打开文件选择对话框
|
||||
input_dir = filedialog.askdirectory(title="请选择需要处理图片的文件夹,将会处理此文件夹中所有图片")
|
||||
#output_dir = filedialog.askdirectory(title="请选择处理后保存的文件夹,处理后与处理前文件命名与路径相同")
|
||||
output_dir = input_dir+"+调整"
|
||||
|
||||
# if not os.path.exists(output_dir):
|
||||
# os.makedirs(output_dir,exist_ok=True)
|
||||
|
||||
# gamma = float(input("请输入筛选阴影区阈值(0~255),建议120~200,优先160,若阴影亮度调高效果不明显可以调大值: "))
|
||||
# threshold = float(input("请输入筛选爆光区阈值(0~255),建议240~254,优先245,若曝光区亮度降低不明显或区域较大可以调小: "))
|
||||
gamma = 180
|
||||
threshold = 253
|
||||
no_auto_bright = False
|
||||
process_images(input_dir, output_dir,gamma,threshold,no_auto_bright)
|
||||
print("处理完成,输出路径:", output_dir)
|
Loading…
Reference in New Issue