Skip to content

Commit b0a0b02

Browse files
authored
Merge pull request #71 from castacks/pr-branch
Pr branch
2 parents 7372d34 + a837a2a commit b0a0b02

8 files changed

Lines changed: 730 additions & 372 deletions

File tree

docs/examples.rst

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ Multi-Thread Download via Python API
7373
unzip = True,
7474
num_workers = 8)
7575
76+
Download TartanGround
77+
............................
78+
79+
.. code-block:: python
80+
81+
import tartanair as ta
82+
83+
# Initialize TartanAir.
84+
tartanground_data_root = '/my/path/to/root/folder/for/tartanair-v2'
85+
ta.init(tartanground_data_root)
86+
87+
# Download a trajectory.
88+
ta.download_ground(env = ['OldTownSummer', 'DesertGasStation'],
89+
version = ['v1', 'v2', 'v3_anymal'], # available versions are: 'v1', 'v2', 'v3_anymal'
90+
modality = ['image', 'depth', 'seg', 'lidar', 'imu'], # available modalities are: image', 'depth', 'seg', 'imu', 'lidar'
91+
camera_name = ['lcam_front', 'lcam_bottom'], # available cameras are: 'lcam_front', 'lcam_left', 'lcam_right', 'lcam_back', 'lcam_top', 'lcam_bottom'
92+
unzip = True) # unzip files autonomously after download
7693
7794
Customization Example
7895
-------------------------------------
@@ -295,11 +312,36 @@ The tool supports sampling dense correspondence between any combination of pinho
295312

296313
Given a pair of RGB and depth image cubes and two direction, the tool will compute dense correspondense represented as optical flow and a occlusion mask signaling is the pixel directly observable.
297314

298-
Please refer to flow_sampling_example.py for a complete example.
315+
.. code-block:: python
316+
317+
import tartanair as ta
318+
319+
# For help with rotations.
320+
from scipy.spatial.transform import Rotation
321+
322+
# Initialize TartanAir.
323+
tartanair_data_root = 'your/path/to_tav2'
324+
ta.init(tartanair_data_root)
325+
326+
# Customize the dataset.
327+
ta.customize_flow(env = 'ArchVizTinyHouseDay',
328+
difficulty = 'easy',
329+
trajectory_id = ['P000'],
330+
cam_sides=["left", "right"],
331+
num_workers = 4,
332+
frame_sep = 1,
333+
device = "cuda") # or cpu
334+
335+
Please refer to flow_resampling_example.py for a complete example.
299336

300337
.. image:: images/flow_sampling/flow_sampling_example.png
301338
:alt: Algorithm
302339
:align: center
303340
:width: 80%
304341

305-
To learn more about how the resampling happens, see `Flow Sampling <flow_sampling.html>`_.
342+
To learn more about how the resampling happens, see flow_sampling.
343+
344+
.. toctree::
345+
:maxdepth: 1
346+
347+
flow_sampling

docs/modalities.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ The fisheye and Panorama data are sampled from the raw pinhole data, thus contai
6969
Optical flow
7070
--------------
7171

72+
Due to the high serving demand of the dataset, we are moving away from pre-computing the flow labels for download, as they can simply be generated from pose, intrinsics, and depth locally. Please refer to examples/flow_resampling_example.py for the code to generate optical flow from the raw data.
73+
74+
Also, we are changing the storage format due to increased precision of flow models. For a pair of images, the generated flow information is stored as a npz file containing the following fields:
75+
76+
- flow_fwd/bwd: x,y coordinate of the flow in float32 format
77+
- fov_mask_fwd/bwd: boolean mask indicating if the pixel have a valid projection in the forward/backward image, i.e., is it out of the image space
78+
- covisible_mask_fwd/bwd: boolean mask indicating if the pixel is covisible in the forward/backward image, i.e., is it occluded by other objects in the scene
79+
80+
81+
Old Optical flow format
82+
-----------------------
83+
7284
Same as TartanAir V1, the optical flow is calculated for the static environments by image warping, using the camera pose and depth images. The biggest upgrades are that we accelerate the code by a Cuda implementation and provide tools for generating optical flow across any type of camera model (e.g. between pinhole and fisheye). For the convenience of the downloading, we compress the optical flow to use 8-bit representation. The decoding code is as follows.
7385

7486
.. code-block:: python
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'''
2+
Author: Yuchen Zhang
3+
Date: 2024-11-19
4+
5+
Example script for sample new correspondence from the TartanAir dataset.
6+
'''
7+
import tartanair as ta
8+
9+
# Initialize TartanAir.
10+
tartanair_data_root = 'your/path/to_tav2'
11+
ta.init(tartanair_data_root)
12+
13+
# Customize the dataset.
14+
ta.customize_flow(env = 'ArchVizTinyHouseDay',
15+
difficulty = 'easy',
16+
trajectory_id = ['P000'],
17+
camera_name=["lcam_left", "lcam_back"],
18+
num_workers = 4,
19+
frame_sep = 1,
20+
device = "cuda") # or cpu

examples/flow_sampling_example.py

Lines changed: 0 additions & 176 deletions
This file was deleted.

0 commit comments

Comments
 (0)