diff --git a/README.md b/README.md index effbb08ba..4483940d4 100644 --- a/README.md +++ b/README.md @@ -98,14 +98,18 @@ conda create -y -n lerobot python=3.10 conda activate lerobot ``` -Install 🤗 LeRobot: +When using `miniconda`, if you don't have `ffmpeg` in your environment: ```bash -pip install -e . +conda install ffmpeg ``` -> **NOTE:** Depending on your platform, If you encounter any build errors during this step -you may need to install `cmake` and `build-essential` for building some of our dependencies. -On linux: `sudo apt-get install cmake build-essential` +Install 🤗 LeRobot: +```bash +pip install --no-binary=av -e . +``` + +> **NOTE:** If you encounter build errors, you may need to install additional dependencies (`cmake`, `build-essential`, and `ffmpeg libs`). On Linux, run: +`sudo apt-get install cmake build-essential python-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev pkg-config`. For other systems, see: [Compiling PyAV](https://pyav.org/docs/develop/overview/installation.html#bring-your-own-ffmpeg) For simulations, 🤗 LeRobot comes with gymnasium environments that can be installed as extras: - [aloha](https://github.com/huggingface/gym-aloha) @@ -114,7 +118,7 @@ For simulations, 🤗 LeRobot comes with gymnasium environments that can be inst For instance, to install 🤗 LeRobot with aloha and pusht, use: ```bash -pip install -e ".[aloha, pusht]" +pip install --no-binary=av -e ".[aloha, pusht]" ``` To use [Weights and Biases](https://docs.wandb.ai/quickstart) for experiment tracking, log in with diff --git a/examples/2_evaluate_pretrained_policy.py b/examples/2_evaluate_pretrained_policy.py index edbbad389..24b5ea2c8 100644 --- a/examples/2_evaluate_pretrained_policy.py +++ b/examples/2_evaluate_pretrained_policy.py @@ -18,7 +18,7 @@ training outputs directory. In the latter case, you might want to run examples/3 It requires the installation of the 'gym_pusht' simulation environment. Install it by running: ```bash -pip install -e ".[pusht]"` +pip install --no-binary=av -e ".[pusht]"` ``` """ diff --git a/examples/7_get_started_with_real_robot.md b/examples/7_get_started_with_real_robot.md index 7622028f7..5973e5c50 100644 --- a/examples/7_get_started_with_real_robot.md +++ b/examples/7_get_started_with_real_robot.md @@ -33,7 +33,7 @@ First, install the additional dependencies required for robots built with dynami Using `pip`: ```bash -pip install -e ".[dynamixel]" +pip install --no-binary=av -e ".[dynamixel]" ``` Using `poetry`: diff --git a/lerobot/common/datasets/video_utils.py b/lerobot/common/datasets/video_utils.py index 4f6968617..c38d570dd 100644 --- a/lerobot/common/datasets/video_utils.py +++ b/lerobot/common/datasets/video_utils.py @@ -257,6 +257,7 @@ def encode_video_frames( ) -> None: """More info on ffmpeg arguments tuning on `benchmark/video/README.md`""" video_path = Path(video_path) + imgs_dir = Path(imgs_dir) video_path.parent.mkdir(parents=True, exist_ok=True) ffmpeg_args = OrderedDict( diff --git a/lerobot/common/policies/pi0/modeling_pi0.py b/lerobot/common/policies/pi0/modeling_pi0.py index aeb63398a..1e690c7bd 100644 --- a/lerobot/common/policies/pi0/modeling_pi0.py +++ b/lerobot/common/policies/pi0/modeling_pi0.py @@ -24,7 +24,7 @@ Designed by Physical Intelligence. Ported from Jax by Hugging Face. Install pi0 extra dependencies: ```bash -pip install -e ".[pi0]" +pip install --no-binary=av -e ".[pi0]" ``` Example of finetuning the pi0 pretrained model (`pi0_base` in `openpi`): diff --git a/lerobot/common/robots/lekiwi/README.md b/lerobot/common/robots/lekiwi/README.md index 798b7bd36..215419e19 100644 --- a/lerobot/common/robots/lekiwi/README.md +++ b/lerobot/common/robots/lekiwi/README.md @@ -69,7 +69,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot #### 5. Install LeRobot with dependencies for the feetech motors: ```bash -cd ~/lerobot && pip install -e ".[feetech]" +cd ~/lerobot && pip install --no-binary=av -e ".[feetech]" ``` ## C. Install LeRobot on laptop @@ -110,7 +110,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot #### 5. Install LeRobot with dependencies for the feetech motors: ```bash -cd ~/lerobot && pip install -e ".[feetech]" +cd ~/lerobot && pip install --no-binary=av -e ".[feetech]" ``` Great :hugs:! You are now done installing LeRobot and we can begin assembling the SO100 arms and Mobile base :robot:. @@ -393,6 +393,10 @@ python lerobot/scripts/control_robot.py \ ``` # F. Teleoperate + +> [!TIP] +> If you're using a Mac, you might need to give Terminal permission to access your keyboard. Go to System Preferences > Security & Privacy > Input Monitoring and check the box for Terminal. + To teleoperate SSH into your Raspberry Pi, and run `conda activate lerobot` and this script: ```bash python lerobot/scripts/control_robot.py \ diff --git a/lerobot/common/robots/moss/README.md b/lerobot/common/robots/moss/README.md index 62febd03a..598d15c5d 100644 --- a/lerobot/common/robots/moss/README.md +++ b/lerobot/common/robots/moss/README.md @@ -33,7 +33,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot 5. Install LeRobot with dependencies for the feetech motors: ```bash -cd ~/lerobot && pip install -e ".[feetech]" +cd ~/lerobot && pip install --no-binary=av -e ".[feetech]" ``` ## Configure the motors diff --git a/lerobot/common/robots/so100/README.md b/lerobot/common/robots/so100/README.md index 770ffa2ee..ca60c0dff 100644 --- a/lerobot/common/robots/so100/README.md +++ b/lerobot/common/robots/so100/README.md @@ -59,7 +59,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot #### 5. Install LeRobot with dependencies for the feetech motors: ```bash -cd ~/lerobot && pip install -e ".[feetech]" +cd ~/lerobot && pip install --no-binary=av -e ".[feetech]" ``` Great :hugs:! You are now done installing LeRobot and we can begin assembling the SO100 arms :robot:. diff --git a/lerobot/common/robots/stretch3/README.md b/lerobot/common/robots/stretch3/README.md index 02f1ddc1a..d02e7ef39 100644 --- a/lerobot/common/robots/stretch3/README.md +++ b/lerobot/common/robots/stretch3/README.md @@ -45,7 +45,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot 6. Install LeRobot with stretch dependencies: ```bash -cd ~/lerobot && pip install -e ".[stretch]" +cd ~/lerobot && pip install --no-binary=av -e ".[stretch]" ``` > **Note:** If you get this message, you can ignore it: `ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.` diff --git a/lerobot/common/robots/viperx/README.md b/lerobot/common/robots/viperx/README.md index dad8e1c9f..1f7aee3c8 100644 --- a/lerobot/common/robots/viperx/README.md +++ b/lerobot/common/robots/viperx/README.md @@ -32,7 +32,7 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot 5. Install LeRobot with dependencies for the Aloha motors (dynamixel) and cameras (intelrealsense): ```bash -cd ~/lerobot && pip install -e ".[dynamixel, intelrealsense]" +cd ~/lerobot && pip install --no-binary=av -e ".[dynamixel, intelrealsense]" ``` ## Teleoperate diff --git a/pyproject.toml b/pyproject.toml index 41c51cb8b..32cb67db2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ dependencies = [ "rerun-sdk>=0.21.0", "termcolor>=2.4.0", "torch>=2.2.1", - "torchcodec>=0.2.1; sys_platform != 'win32' and (sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l'))", + "torchcodec>=0.2.1; sys_platform != 'win32' and (sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l')) and (sys_platform != 'darwin' or platform_machine != 'x86_64')", "torchvision>=0.21.0", "wandb>=0.16.3", "zarr>=2.17.0",