{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "from IPython.display import Video\n", "\n", "from examples.notebook_utils import config_notebook\n", "from lerobot.scripts.eval import eval\n", "\n", "# Select policy and env\n", "POLICY = \"act\" # \"tdmpc\" | \"diffusion\"\n", "ENV = \"aloha\" # \"pusht\" | \"simxarm\"\n", "\n", "# Select device\n", "DEVICE = \"mps\" # \"cpu\" | \"cuda\"\n", "\n", "# Generated videos will be written here\n", "OUT_DIR = Path(\"./outputs\")\n", "OUT_EXAMPLE = OUT_DIR / \"eval\" / \"eval_episode_0.mp4\"\n", "\n", "# Setup config\n", "cfg = config_notebook(policy=POLICY, env=ENV, device=DEVICE, print_config=False)\n", "print(cfg.env.episode_length)\n", "print(cfg.n_action_steps)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "eval(cfg, out_dir=OUT_DIR)\n", "Video(OUT_EXAMPLE, embed=True)" ] } ], "metadata": { "kernelspec": { "display_name": "lerobot", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 2 }