From c809a054f7e5692a58606254a9fa7c068d3cb2c6 Mon Sep 17 00:00:00 2001 From: Skylark Date: Sat, 10 Sep 2022 15:30:31 +0800 Subject: [PATCH] update readme --- rofunc/README.md | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/rofunc/README.md b/rofunc/README.md index 702f8b494..1bb6194c6 100644 --- a/rofunc/README.md +++ b/rofunc/README.md @@ -12,6 +12,7 @@ - [Zed](#zed) - [Record](#record) - [Playback](#playback) + - [Export](#export) ## Hello, robot world! @@ -35,7 +36,7 @@ import rofunc as rf | | | `optitrack.visualize` | Show or save gif about the motion | | | | ZED | `zed.record` | Record with multiple cameras | ✅ | | | | `zed.playback` | Playback the recording and save snapshots | ✅ | -| | | `zed.export` | Export the recording to mp4 | | +| | | `zed.export` | Export the recording to .avi and image sequence | ✅ | | | Multi-modal | `mmodal.record` | Record multi-modal demonstration data simultaneously | | | **Logger** | | `logger.write` | Custom tensorboard-based logger | | | **Coordinate** | | `coord.custom_class` | Define the custom class of `Pose` | | @@ -200,4 +201,42 @@ Saving image 1.png : SUCCESS Saving image 2.png : SUCCESS Saving image 3.png : SUCCESS ... -``` \ No newline at end of file +``` + +#### Export +```python +def export(filepath, mode=1): + """ + Export the svo file with specific mode. + Args: + filepath: SVO file path (input) : path/to/file.svo + mode: Export mode: 0=Export LEFT+RIGHT AVI. + 1=Export LEFT+DEPTH_VIEW AVI. + 2=Export LEFT+RIGHT image sequence. + 3=Export LEFT+DEPTH_VIEW image sequence. + 4=Export LEFT+DEPTH_16Bit image sequence. + + Returns: + + """ +``` + +Example +```python +import rofunc as rf + +rf.zed.export('/home/ubuntu/Data/06_24/Video/20220624_1649/38709363.svo', 2) +``` + +> Since the converting always take a long time, I provide the batch form to convert in parallel. + +```python +def export_batch(filedir, all_mode=True, mode=None, core_num=10): +``` + +Example: +``` +rf.zed.export_batch('/home/ubuntu/Data/06_24/Video/20220624_1649', core_num=20) +``` + +Then you can convert all the .svo files under the specific directory with all mode in parallel. Enjoy it!