Skip to content

Commit

Permalink
Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Oct 14, 2024
1 parent 17e0351 commit 5d7c07a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/content/getting-started/data-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ In this three-part guide, we explore such a workflow by implementing an "open ja

Note: this guide uses [Pandas](https://pandas.pydata.org) dataframes because of how popular this package is. The same concept however applies in the same way for alternative dataframe packages such as [Polars](https://pola.rs).

For the fast track, jump to the [complete script](data-out/analyze-and-log.md#complete-script) at the end of the third section.
For the fast track, jump to the [complete script](data-out/analyze-and-log.md#complete-script) at the end of the third section.
2 changes: 1 addition & 1 deletion docs/content/getting-started/data-out/analyze-and-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ The OPEN/CLOSE label is displayed along the bounding box on the 2D view, and the

Here is the complete script used by this guide to load data, analyze it, and log the result back:

snippet: tutorials/data_out
snippet: tutorials/data_out
6 changes: 3 additions & 3 deletions docs/content/getting-started/data-out/explore-as-dataframe.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here is such a recording:
<source src="https://static.rerun.io/getting-started-data-out/data-out-first-look.webm" type="video/webm" />
</video>

A person's face is visible and being tracked. Their jaws occasionally open and close. In the middle of the recording, the face is also temporarily hidden and no longer tracked.
A person's face is visible and being tracked. Their jaws occasionally open and close. In the middle of the recording, the face is also temporarily hidden and no longer tracked.


## Explore the data
Expand Down Expand Up @@ -63,10 +63,10 @@ Now, let's look at the actual data as represented in the above screenshot. At ar

Our exploration of the data in the viewer so far provided us with two important pieces of information useful to implement the jaw open detector.

First, we identified that the `Scalar` value contained in `/blendshapes/0/jawOpen` contains relevant data. In particular, thresholding this signal with a value of 0.15 should provide us with a closed/opened jaw state binary indicator.
First, we identified that the `Scalar` value contained in `/blendshapes/0/jawOpen` contains relevant data. In particular, thresholding this signal with a value of 0.15 should provide us with a closed/opened jaw state binary indicator.

Then, we explored the numerical data in a dataframe view. Importantly, the way we configured this view for our needs informs us on how to query the recording from code such as to obtain the correct output.

<!-- TODO(#7462): improve the previous paragraph to mention copy-as-code instead -->

From there, our next step is to query the recording and extract the data as a Pandas dataframe in Python. This is covered in the [next section](export-dataframe.md) of this guide.
From there, our next step is to query the recording and extract the data as a Pandas dataframe in Python. This is covered in the [next section](export-dataframe.md) of this guide.
16 changes: 10 additions & 6 deletions docs/content/getting-started/data-out/export-dataframe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 2
---


In the [previous section](explore-as-dataframe.md), we explored some face tracking data using the dataframe view. In this section, we will see how we can use the dataframe API of the Rerun SDK to export the same data into a [Pandas](https://pandas.pydata.org) dataframe to further inspect and process it.
In the [previous section](explore-as-dataframe.md), we explored some face tracking data using the dataframe view. In this section, we will see how we can use the dataframe API of the Rerun SDK to export the same data into a [Pandas](https://pandas.pydata.org) dataframe to further inspect and process it.

## Load the recording

Expand Down Expand Up @@ -71,11 +71,11 @@ log_time: [[2024-10-13 08:26:46.819571000],[2024-10-13 08:26:46.866358000],...,[
/blendshapes/0/jawOpen:Scalar: [[[0.03306490555405617]],[[0.03812221810221672]],...,[[0.06996039301156998]],[[0.07366073131561279]]]
```

Again, this is a [PyArrow](https://arrow.apache.org/docs/python/index.html) table which contains the result of our query. Further exploring Arrow structures is beyond the scope of the present guide. Yet, it is a reminder that Rerun natively stores—and returns—data in arrow format. As such, it efficiently interoperates with other Arrow-native and/or compatible tools such as [Polars](https://pola.rs) or [DuckDB](https://duckdb.org).
Again, this is a [PyArrow](https://arrow.apache.org/docs/python/index.html) table which contains the result of our query. Further exploring Arrow structures is beyond the scope of the present guide. Yet, it is a reminder that Rerun natively stores—and returns—data in arrow format. As such, it efficiently interoperates with other Arrow-native and/or compatible tools such as [Polars](https://pola.rs) or [DuckDB](https://duckdb.org).


## Create a Pandas dataframe
## Create a pandas dataframe

Before exploring the data further, let's convert the table to a Pandas dataframe:

```python
Expand All @@ -99,8 +99,10 @@ print(df)

Here is the result:

<!-- NOLINT_START -->

```
frame_nr frame_time log_tick log_time /blendshapes/0/jawOpen:Scalar
frame_nr frame_time log_tick log_time /blendshapes/0/jawOpen:Scalar
0 0 1970-01-01 00:00:00.000 34 2024-10-13 08:26:46.819571 [0.03306490555405617]
1 1 1970-01-01 00:00:00.040 92 2024-10-13 08:26:46.866358 [0.03812221810221672]
2 2 1970-01-01 00:00:00.080 150 2024-10-13 08:26:46.899699 [0.027743922546505928]
Expand All @@ -116,9 +118,11 @@ Here is the result:
[414 rows x 5 columns]
```

<!-- NOLINT_END -->

We can make several observations from this output.

- The first four columns are timeline columns. These are the various timelines the data is logged to in this recording.
- The first four columns are timeline columns. These are the various timelines the data is logged to in this recording.
- The last columns is named `/blendshapes/0/jawOpen:Scalar`. This is what we call a _component column_, and it corresponds to the [Scalar](../../reference/types/components/scalar.md) component logged to the `/blendshapes/0/jawOpen` entity.
- Each row in the `/blendshapes/0/jawOpen:Scalar` column consists of a _list_ of (typically one) scalar.

Expand Down

0 comments on commit 5d7c07a

Please sign in to comment.