NVIDIA Alpamayo VLA (Vision-Language-Action) 모델을 CARLA 시뮬레이터와 통합한 자율주행 에이전트입니다.
Alpamayo-R1은 NVIDIA가 개발한 자율주행을 위한 VLA 모델로, Chain-of-Thought (CoT) 추론 기능을 통해 복잡한 주행 상황에서 단계별 판단을 수행합니다.
이 프로젝트는 Alpamayo 모델을 CARLA 자율주행 시뮬레이터에서 실행할 수 있도록 브릿지 코드를 제공합니다.
# CARLA 다운로드 (0.9.15 권장)
wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/CARLA_0.9.15.tar.gz
mkdir -p ~/carla && tar -xvf CARLA_0.9.15.tar.gz -C ~/carla
# CARLA Python API 설치
pip install carla
git clone https://github.com/hwkim3330/carla-alpamayo.git
cd carla-alpamayo
# 의존성 설치
pip install -r requirements.txt
# PyTorch 설치 (CUDA 버전에 맞게)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
# HuggingFace 로그인
huggingface-cli login
# 모델 다운로드 (약 22GB)
python scripts/download_model.py
Note: 모델 접근 권한이 필요합니다:
# 터미널 1: CARLA 시작
./scripts/start_carla.sh ~/carla
# 또는 직접 실행
cd ~/carla && ./CarlaUE4.sh -prefernvidia
# 터미널 2: Alpamayo 에이전트 실행
cd examples
# 더미 모드 (GPU 없이 테스트)
python run_agent.py --dummy --frames 500
# 전체 모델 사용
python run_agent.py --frames 1000 --command "follow the road"
# 주행 데이터 녹화
python run_with_recording.py --dummy --frames 300 --output ../recordings
from src.carla_alpamayo_agent import CarlaAlpamayoAgent, AgentConfig
# 설정
config = AgentConfig(
host="localhost",
port=2000,
use_dummy_model=False, # True for testing without GPU
)
# Context manager 사용
with CarlaAlpamayoAgent(config) as agent:
agent.run(
max_frames=1000,
navigation_command="turn left at the intersection",
)
Alpamayo는 자연어 명령을 이해합니다:
"follow the road" - 차선 유지"turn left at the intersection" - 교차로에서 좌회전"turn right" - 우회전"stop" - 정지"change lane to the left" - 좌측 차선 변경carla-alpamayo/
├── src/
│ ├── __init__.py
│ ├── carla_alpamayo_agent.py # 메인 에이전트 클래스
│ ├── alpamayo_wrapper.py # Alpamayo 모델 래퍼
│ └── sensor_manager.py # CARLA 센서 관리
├── examples/
│ ├── run_agent.py # 기본 실행 예제
│ └── run_with_recording.py # 녹화 예제
├── scripts/
│ ├── start_carla.sh # CARLA 시작 스크립트
│ └── download_model.py # 모델 다운로드
├── configs/
│ └── default_config.yaml # 기본 설정
├── requirements.txt
├── setup.py
└── README.md
configs/default_config.yaml에서 설정을 수정할 수 있습니다:
carla:
host: localhost
port: 2000
model:
name: "nvidia/Alpamayo-R1-10B"
device: "cuda"
control:
target_fps: 10.0
max_speed_kmh: 30.0
# CARLA가 실행 중인지 확인
ps aux | grep CarlaUE4
# 포트 확인
netstat -tlnp | grep 2000
# 더미 모드로 테스트
python run_agent.py --dummy
# 또는 더 작은 모델 사용 (추후 지원)
# HuggingFace 로그인 확인
huggingface-cli whoami
# 캐시 삭제 후 재다운로드
rm -rf ~/.cache/huggingface/hub/models--nvidia--Alpamayo*
python scripts/download_model.py
MIT License
Pull requests are welcome. For major changes, please open an issue first.
14 commits
Python
99.6%
NVIDIA Alpamayo VLA (Vision-Language-Action) 모델을 CARLA 시뮬레이터와 통합한 자율주행 에이전트입니다.
Alpamayo-R1은 NVIDIA가 개발한 자율주행을 위한 VLA 모델로, Chain-of-Thought (CoT) 추론 기능을 통해 복잡한 주행 상황에서 단계별 판단을 수행합니다.
이 프로젝트는 Alpamayo 모델을 CARLA 자율주행 시뮬레이터에서 실행할 수 있도록 브릿지 코드를 제공합니다.
# CARLA 다운로드 (0.9.15 권장)
wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/CARLA_0.9.15.tar.gz
mkdir -p ~/carla && tar -xvf CARLA_0.9.15.tar.gz -C ~/carla
# CARLA Python API 설치
pip install carla
git clone https://github.com/hwkim3330/carla-alpamayo.git
cd carla-alpamayo
# 의존성 설치
pip install -r requirements.txt
# PyTorch 설치 (CUDA 버전에 맞게)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
# HuggingFace 로그인
huggingface-cli login
# 모델 다운로드 (약 22GB)
python scripts/download_model.py
Note: 모델 접근 권한이 필요합니다:
# 터미널 1: CARLA 시작
./scripts/start_carla.sh ~/carla
# 또는 직접 실행
cd ~/carla && ./CarlaUE4.sh -prefernvidia
# 터미널 2: Alpamayo 에이전트 실행
cd examples
# 더미 모드 (GPU 없이 테스트)
python run_agent.py --dummy --frames 500
# 전체 모델 사용
python run_agent.py --frames 1000 --command "follow the road"
# 주행 데이터 녹화
python run_with_recording.py --dummy --frames 300 --output ../recordings
from src.carla_alpamayo_agent import CarlaAlpamayoAgent, AgentConfig
# 설정
config = AgentConfig(
host="localhost",
port=2000,
use_dummy_model=False, # True for testing without GPU
)
# Context manager 사용
with CarlaAlpamayoAgent(config) as agent:
agent.run(
max_frames=1000,
navigation_command="turn left at the intersection",
)
Alpamayo는 자연어 명령을 이해합니다:
"follow the road" - 차선 유지"turn left at the intersection" - 교차로에서 좌회전"turn right" - 우회전"stop" - 정지"change lane to the left" - 좌측 차선 변경carla-alpamayo/
├── src/
│ ├── __init__.py
│ ├── carla_alpamayo_agent.py # 메인 에이전트 클래스
│ ├── alpamayo_wrapper.py # Alpamayo 모델 래퍼
│ └── sensor_manager.py # CARLA 센서 관리
├── examples/
│ ├── run_agent.py # 기본 실행 예제
│ └── run_with_recording.py # 녹화 예제
├── scripts/
│ ├── start_carla.sh # CARLA 시작 스크립트
│ └── download_model.py # 모델 다운로드
├── configs/
│ └── default_config.yaml # 기본 설정
├── requirements.txt
├── setup.py
└── README.md
configs/default_config.yaml에서 설정을 수정할 수 있습니다:
carla:
host: localhost
port: 2000
model:
name: "nvidia/Alpamayo-R1-10B"
device: "cuda"
control:
target_fps: 10.0
max_speed_kmh: 30.0
# CARLA가 실행 중인지 확인
ps aux | grep CarlaUE4
# 포트 확인
netstat -tlnp | grep 2000
# 더미 모드로 테스트
python run_agent.py --dummy
# 또는 더 작은 모델 사용 (추후 지원)
# HuggingFace 로그인 확인
huggingface-cli whoami
# 캐시 삭제 후 재다운로드
rm -rf ~/.cache/huggingface/hub/models--nvidia--Alpamayo*
python scripts/download_model.py
MIT License
Pull requests are welcome. For major changes, please open an issue first.
14 commits
Python
99.6%