Skip to content

Commit

Permalink
{Feature} VrsDataProvider - Resolve colab issue: imports out of order
Browse files Browse the repository at this point in the history
Summary: The notebook passes in an environment where projectaria_tools is already installed. However, on collab, projectaria_tools is pip installed as a side-effect of downloading the sample files (this is common across all the sample notebooks). Therefore, the import of projectaria_tools had to move after the file-download section to work on colab.

Reviewed By: xiaqingp

Differential Revision:
D58539746

Privacy Context Container: L1262222

fbshipit-source-id: 51be768e248754835532c5ea1d45e67a14fc10b9
  • Loading branch information
Brian Beckman authored and facebook-github-bot committed Jun 13, 2024
1 parent fe3a97f commit dd0ce8c
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions core/examples/ticsync_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@
"* Learn how to interpret synchronization offsets amongst the frames of the recordings. "
]
},
{
"cell_type": "markdown",
"id": "e5159459-6a44-479f-ad4d-eccfd5b33caa",
"metadata": {},
"source": [
"## Python Dependencies"
]
},
{
"cell_type": "markdown",
"id": "2ccbb65ee9337c3b",
"metadata": {},
"source": [
"1. Set up a Python virtual environment with [this version of Projectaria Tools using pip](https://facebookresearch.github.io/projectaria_tools/docs/data_utilities/installation/installation_python)\n",
"2. You may have to `pip install matplotlib notebook==6.5.7`. Notebook v7 may have issues.\n",
"4. `cd ~ && jupyter notebook`.\n",
"5. Navigate in jupyter's file browser to the location of this notebook"
]
},
{
"cell_type": "markdown",
"id": "7103c066",
Expand All @@ -63,34 +44,23 @@
},
{
"cell_type": "markdown",
"id": "ac1a541c-df79-4510-a98d-7a4006e1aca0",
"id": "22235231",
"metadata": {},
"source": [
"## Imports"
"## Python Dependencies"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "87989a2dec4c3653",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-05T18:19:09.977613Z",
"start_time": "2024-06-05T18:19:06.370133Z"
}
},
"outputs": [],
"cell_type": "markdown",
"id": "77360599",
"metadata": {},
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"1. Set up a Python virtual environment with [this version of Projectaria Tools using pip](https://facebookresearch.github.io/projectaria_tools/docs/data_utilities/installation/installation_python)\n",
"2. You may have to `pip install matplotlib notebook==6.5.7`. Notebook v7 may have issues.\n",
"4. `cd ~ && jupyter notebook`.\n",
"5. Navigate in jupyter's file browser to the location of this notebook\n",
"\n",
"from projectaria_tools.core import data_provider\n",
"from projectaria_tools.core.sensor_data import (\n",
" SensorData,\n",
" TimeDomain,\n",
" TimeQueryOptions,\n",
")\n",
"from projectaria_tools.core.stream_id import StreamId"
"Alternatively, try the notebook in colab."
]
},
{
Expand Down Expand Up @@ -157,6 +127,38 @@
" zip_ref.extractall(path=ticsync_sample_path) "
]
},
{
"cell_type": "markdown",
"id": "92130649",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1c240d41",
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-05T18:19:09.977613Z",
"start_time": "2024-06-05T18:19:06.370133Z"
}
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from projectaria_tools.core import data_provider\n",
"from projectaria_tools.core.sensor_data import (\n",
" SensorData,\n",
" TimeDomain,\n",
" TimeQueryOptions,\n",
")\n",
"from projectaria_tools.core.stream_id import StreamId"
]
},
{
"cell_type": "markdown",
"id": "f04d5829",
Expand Down

0 comments on commit dd0ce8c

Please sign in to comment.