Skip to content

chae2chae/learning_data_preprocessing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning Data Preprocessing

ROS bag 데이터를 학습 가능한 LeRobot 형식으로 전처리하는 도구 모음입니다.

폴더 구조

learning_data_preprocessing/
├── rosbag_preprocessing/      # ROS bag 전처리 (MaskACT mask 추가 등)
├── conversion/                 # ROS bag → LeRobot 변환
├── postprocessing/             # 변환 후 통계 생성
├── inference/                  # 실시간 inference 도구
├── utils/                      # 공통 유틸리티
├── scripts/                    # 실행 스크립트
└── docs/                       # 문서 및 노트

전체 워크플로우

1. ROS Bag 전처리 (MaskACT)

ROS bag에 mask 이미지와 end pose 정보를 추가합니다.

python rosbag_preprocessing/maskact/convert_maskact.py \
    --bag-dirs-root /workspace/rosbag2/dkim/ffw_sg2_rev1_dkim/ \
    --out-root /workspace/dkim_result_3 \
    --image-topic /zed/zed_node/left/image_rect_color/compressed \
    --out-topic /mf_perception/ch0_binary_image_sam2/compressed \
    --visualize \
    --dump-tf-pairs \
    --base-left arm_l_link1 \
    --ee-left arm_l_link7 \
    --base-right arm_r_link1 \
    --ee-right arm_r_link7

자세한 내용: rosbag_preprocessing/README.md

2. ROS Bag → LeRobot 변환

전처리된 ROS bag을 LeRobot 데이터셋 형식으로 변환합니다.

python conversion/batch_convert_rosbag_to_lerobot.py \
    --input-dir /workspace/dkim_result_3 \
    --output-dir /workspace/lerobot_datasets_6 \
    --repo-id dkim/ffw_sg2_rev1_offline2 \
    --fps 10 \
    --robot-type ffw_sg2_rev1 \
    --task-name default_task \
    --validate \
    --reference-observation observation.images.cam_head

자세한 내용: conversion/README.md

3. 통계 생성

변환된 데이터셋의 통계 정보를 생성합니다.

python postprocessing/generate_stats.py \
    --root /workspace/lerobot_datasets_6/dkim_ffw_sg2_rev1_offline2 \
    --repo-id dkim/ffw_sg2_rev1_offline2 \
    --num-workers 8

자세한 내용: postprocessing/README.md

4. 실시간 Inference

학습된 모델을 사용하여 실시간으로 mask 이미지를 생성합니다.

python3 inference/maskact/inference_time_topic.py \
    --image-topic /zed/zed_node/left/image_rect_color/compressed \
    --out-topic /mf_perception/ch0_binary_image_sam2/compressed \
    --pruning-topic /mf_perception/ch0_pruning_indicator \
    --base-left arm_l_link1 --ee-left arm_l_link7 \
    --base-right arm_r_link1 --ee-right arm_r_link7 \
    --window-w 1280 --window-h 720 \
    --max-tf-dt-sec 0.5 \
    --visualize \
    --use-sam --sam-checkpoint rosbag_preprocessing/maskact/sam2_b.pt

자세한 내용: inference/README.md

각 단계별 상세 문서

주요 기능

MaskACT 워크플로우

  1. 데이터 수집: ROS bag으로 로봇 데이터 수집
  2. 전처리: mask 이미지 및 end pose 추가
  3. 변환: LeRobot 형식으로 변환
  4. 통계 생성: 데이터셋 통계 계산
  5. 학습: LeRobot으로 모델 학습
  6. Inference: 실시간 mask 생성 및 제어

GR00T 워크플로우

  1. 데이터 수집: ROS bag으로 로봇 데이터 수집
  2. 변환: LeRobot 형식으로 변환 (multi-camera 지원)
  3. 통계 생성: 데이터셋 통계 계산
  4. 비디오 리사이즈: 모든 카메라를 동일한 해상도로 통일
  5. 통계 재생성: 리사이즈 후 통계 재계산
  6. 학습: GR00T fine-tuning

문제 해결

자세한 문제 해결 가이드는 각 단계별 README.md를 참조하세요.

관련 문서

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors