From 6687585114f356c13efe1bc706c58e4ea1095c6e Mon Sep 17 00:00:00 2001 From: Nikhil Varma Keetha <56788999+Nik-V9@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:22:05 -0500 Subject: [PATCH] Update Download Examples Doc Updated the download example docs to include the multi-thread example and example to download entire TAv2 dataset. --- docs/examples.rst | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/docs/examples.rst b/docs/examples.rst index a525693..326c4cf 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -43,6 +43,42 @@ The config file if of the following format: camera_name: ['lcam_front', 'lcam_left', 'lcam_right', 'lcam_back', 'lcam_top', 'lcam_bottom'] unzip: True + +Multi-Thread Download via Python API +............................ + +.. code-block:: python + + # General imports. + import sys + + # Local imports. + sys.path.append('..') + import tartanair as ta + + # Create a TartanAir object. + tartanair_data_root = '/my/path/to/root/folder/for/tartanair-v2' + + ta.init(tartanair_data_root) + + # Download data from following environments. + env = [ "Prison", + "Ruins", + "UrbanConstruction"] + ta.download_multi_thread(env = env, + difficulty = ['easy', 'hard'], + modality = ['image', 'depth'], + camera_name = ['lcam_front', 'lcam_right', 'lcam_back', 'lcam_left', 'lcam_top', 'lcam_bottom'], + unzip = True, + num_workers = 8) + + # To download the entire dataset + all_data = ta.get_all_data() # this will fill in all available TAv2 data for env, difficulty, modality and camera_name + ta.download_multi_thread(**all_data, + unzip = True, + num_workers = 8) + + Customization Example ------------------------------------- @@ -272,8 +308,3 @@ Please refer to flow_sampling_example.py for a complete example. :width: 80% To learn more about how the resampling happens, see `Flow Sampling `_. - -.. toctree:: - :maxdepth: 1 - - flow_sampling \ No newline at end of file