mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-23 20:50:02 +00:00
style
This commit is contained in:
@@ -124,6 +124,7 @@ lerobot-edit-dataset \
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
- `output_dir`: Directory where videos will be saved (default: `outputs/converted_videos`)
|
- `output_dir`: Directory where videos will be saved (default: `outputs/converted_videos`)
|
||||||
- `vcodec`: Video codec to use - options: `h264`, `hevc`, `libsvtav1` (default: `libsvtav1`)
|
- `vcodec`: Video codec to use - options: `h264`, `hevc`, `libsvtav1` (default: `libsvtav1`)
|
||||||
- `pix_fmt`: Pixel format - options: `yuv420p`, `yuv444p` (default: `yuv420p`)
|
- `pix_fmt`: Pixel format - options: `yuv420p`, `yuv444p` (default: `yuv420p`)
|
||||||
|
|||||||
@@ -389,7 +389,9 @@ def process_single_episode(
|
|||||||
imgs_dir = output_dir / "images" / dataset.repo_id.replace("/", "_") / f"episode_{episode_index:06d}"
|
imgs_dir = output_dir / "images" / dataset.repo_id.replace("/", "_") / f"episode_{episode_index:06d}"
|
||||||
|
|
||||||
# Create video filename with encoding parameters
|
# Create video filename with encoding parameters
|
||||||
video_filename = f"{dataset.repo_id.replace('/', '_')}_ep{episode_index:06d}_{vcodec}_{pix_fmt}_g{g}_crf{crf}.mp4"
|
video_filename = (
|
||||||
|
f"{dataset.repo_id.replace('/', '_')}_ep{episode_index:06d}_{vcodec}_{pix_fmt}_g{g}_crf{crf}.mp4"
|
||||||
|
)
|
||||||
video_path = output_dir / "videos" / dataset.repo_id.replace("/", "_") / video_filename
|
video_path = output_dir / "videos" / dataset.repo_id.replace("/", "_") / video_filename
|
||||||
|
|
||||||
# Save episode images
|
# Save episode images
|
||||||
@@ -455,7 +457,9 @@ def convert_dataset_to_videos(
|
|||||||
if episode_indices is None:
|
if episode_indices is None:
|
||||||
episode_indices = list(range(num_episodes))
|
episode_indices = list(range(num_episodes))
|
||||||
|
|
||||||
logging.info(f"Processing {len(episode_indices)} episodes from {dataset.repo_id} with {num_workers} workers")
|
logging.info(
|
||||||
|
f"Processing {len(episode_indices)} episodes from {dataset.repo_id} with {num_workers} workers"
|
||||||
|
)
|
||||||
|
|
||||||
# Process episodes in parallel
|
# Process episodes in parallel
|
||||||
with ThreadPoolExecutor(max_workers=num_workers) as executor:
|
with ThreadPoolExecutor(max_workers=num_workers) as executor:
|
||||||
|
|||||||
Reference in New Issue
Block a user