Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 0 additions & 146 deletions docs/tutorials/cli.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/tutorials/cli/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## CLI Support

Following command line tools are supported:

- [`t4viz`: Visualize T4 dataset features](./t4viz.md)
- [`t4sanity`: Sanity checker of T4 dataset](./t4sanity.md)
78 changes: 78 additions & 0 deletions docs/tutorials/cli/t4sanity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
`t4sanity` performs sanity checks on T4 datasets, reporting any issues in a structured format.
It checks the dataset directories and versions, tries to load them using the `Tier4` library, and reports any exceptions or warnings.

```shell
$ t4sanity -h

Usage: t4sanity [OPTIONS] DB_PARENT

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * db_parent TEXT Path to parent directory of the databases [default: None] [required] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version -v Show the application version and exit. │
│ --include-warning -iw Indicates whether to report any warnings. │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

## Shell Completion

Run the following command to install completion, and reload shell.

```{ .shell .copy }
t4sanity --install-completion
```

## Usages

As an example, we have the following the dataset structure:

```shell
<DATA_ROOT>
├── dataset1
│ └── <VERSION>
│ ├── annotation
│ ├── data
| ...
├── dataset2
│ ├── annotation
│ ├── data
| ...
...
```

### Exclude Warnings

To run sanity check ignoring warnings, providing the path to the parent directory of the datasets:

```shell
$ t4sanity <DATA_ROOT>

>>> Sanity checking...: 97it [00:03, 26.60it/s]
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| DatasetID | Version | Message |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| 96200480-ae59-44cb-9e4e-dd9021e250e8 | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) |
| ca346afb-ea1a-4c5c-8117-544bd9ff6aca | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222) |
...
```

### Include Warnings

To run sanity check and report any warnings, use the `-iw; --include-warning` option:

```shell
$ t4sanity <DATA_ROOT> -iw

>>> Sanity checking...: 97it [00:03, 29.31it/s]
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| DatasetID | Version | Message |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| 96200480-ae59-44cb-9e4e-dd9021e250e8 | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) |
| ca346afb-ea1a-4c5c-8117-544bd9ff6aca | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222) |
| ed96b707-e7f4-4a71-9e6b-571ffd56c4c4 | 2 | level: Not available is not supported, Visibility.UNAVAILABLE will be assigned. |
...
```
85 changes: 85 additions & 0 deletions docs/tutorials/cli/t4viz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
`t4viz` performs visualizing particular dataset attributes from command line.

```shell
$ t4viz -h

Usage: t4viz [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version -v Show the application version and exit. │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ scene Visualize a specific scene. │
│ instance Visualize a particular instance in the corresponding scene. │
│ pointcloud Visualize pointcloud in the corresponding scene. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

## Shell Completion

Run the following command to install completion, and reload shell.

```{ .shell .copy }
t4viz --install-completion
```

## Usages

### Scene

This command performs the same behavior with [`Tier4.render_scene(...)`](../render.md#rendering-scene).

For options, run `t4viz scene -h`.

```shell
t4viz scene <DATA_ROOT> [OPTIONS]
```

### Specific Instance(s)

This command performs the same behavior with [`Tier4.render_instance(...)`](../render.md#rendering-instances).

For options, run `t4viz instance -h`.

```shell
t4viz instance <DATA_ROOT> <INSTANCE_TOKEN> [OPTIONS]
```

You can also specify multiple instance tokens:

```shell
t4viz instance <DATA_ROOT> <INSTANCE_TOKEN1> <INSTANCE_TOKEN2> ... [OPTIONS]
```

### PointCloud

This command performs the same behavior with [`Tier4.render_pointcloud(...)`](../render.md#rendering-pointcloud).

For options, run `t4viz pointcloud -h`.

```shell
t4viz pointcloud <DATA_ROOT> [OPTIONS]
```

### Future Trajectories

`scene` and `instance` commands support visualizing future trajectories for each object.

By specifying `-f [--future]` option, you can render them in the particular time length:

```shell
t4viz <COMMAND> ... -f <FUTURE_LENGTH[s]>
```

### Save Recording as `.rrd`

You can save visualized recording with `-o [--output]` option as follows:

```shell
t4viz <COMMAND> ... -o <OUTPUT_DIR>
```

Note that if you specify `--output` option, viewer will not be spawned.
4 changes: 2 additions & 2 deletions docs/tutorials/customize.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Generate Schema Record with a New Token
## Generate with a New Token

---

Expand Down Expand Up @@ -28,7 +28,7 @@ Attribute(token='b08701e5095fbd12a45e7f51b85ffc08', name='foo', description='thi
Attribute(token='f40e605870aa29b1473ca6e65255c45e', name='foo', description='this is re-generated attribute.')
```

## Customize Schema Class
## Customize Schema Classes

---

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you want to visualize annotation results, `Tier4` supports some rendering methods as below.

### Rendering Scene
### Scene

```python
>>> scene_token = t4.scene[0].token
Expand All @@ -11,7 +11,7 @@ If you want to visualize annotation results, `Tier4` supports some rendering met

![Render Scene GIF](../assets/render_scene.gif)

### Rendering Instance(s)
### Specific Instance(s)

```python
>>> instance_token = t4.instance[0].token
Expand All @@ -27,7 +27,7 @@ You can also render multiple instances at once:
>>> t4.render_instance(instance_tokens)
```

### Rendering PointCloud
### PointCloud

```python
>>> scene_token = t4.scene[0].token
Expand Down
7 changes: 5 additions & 2 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ nav:
- Tutorials:
- Initialization: tutorials/initialize.md
- Visualization: tutorials/render.md
- Customization: tutorials/customize.md
- CLI: tutorials/cli.md
- Schema Customization: tutorials/customize.md
- CLI:
- Command Line Tools: tutorials/cli/index.md
- t4viz: tutorials/cli/t4viz.md
- t4sanity: tutorials/cli/t4sanity.md
- API References:
- t4_devkit.tier4: apis/tier4.md
- t4_devkit.helper: apis/helper.md
Expand Down
Loading