{"id":13441365,"url":"https://github.com/MarkFzp/act-plus-plus","last_synced_at":"2025-03-20T11:38:27.412Z","repository":{"id":215248907,"uuid":"700076185","full_name":"MarkFzp/act-plus-plus","owner":"MarkFzp","description":"Imitation learning algorithms with Co-training for Mobile ALOHA: ACT, Diffusion Policy, VINN","archived":false,"fork":false,"pushed_at":"2024-05-15T12:53:19.000Z","size":619,"stargazers_count":3223,"open_issues_count":46,"forks_count":587,"subscribers_count":47,"default_branch":"main","last_synced_at":"2025-03-16T12:09:51.532Z","etag":null,"topics":["imitation-learning","robotics"],"latest_commit_sha":null,"homepage":"https://mobile-aloha.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarkFzp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-03T22:32:32.000Z","updated_at":"2025-03-14T07:03:31.000Z","dependencies_parsed_at":"2024-01-03T11:32:01.107Z","dependency_job_id":"d5be739b-516f-4917-ae09-97f6cfaff51b","html_url":"https://github.com/MarkFzp/act-plus-plus","commit_stats":null,"previous_names":["markfzp/act-plus-plus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkFzp%2Fact-plus-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkFzp%2Fact-plus-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkFzp%2Fact-plus-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkFzp%2Fact-plus-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarkFzp","download_url":"https://codeload.github.com/MarkFzp/act-plus-plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244607727,"owners_count":20480681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imitation-learning","robotics"],"created_at":"2024-07-31T03:01:33.155Z","updated_at":"2025-03-20T11:38:27.039Z","avatar_url":"https://github.com/MarkFzp.png","language":"Python","funding_links":[],"categories":["Python","Repos"],"sub_categories":[],"readme":"# Imitation Learning algorithms and Co-training for Mobile ALOHA\n\n\n#### Project Website: https://mobile-aloha.github.io/\n\nThis repo contains the implementation of ACT, Diffusion Policy and VINN, together with 2 simulated environments:\nTransfer Cube and Bimanual Insertion. You can train and evaluate them in sim or real.\nFor real, you would also need to install [Mobile ALOHA](https://github.com/MarkFzp/mobile-aloha). This repo is forked from the [ACT repo](https://github.com/tonyzhaozh/act).\n\n### Updates:\nYou can find all scripted/human demo for simulated environments [here](https://drive.google.com/drive/folders/1gPR03v05S1xiInoVJn7G7VJ9pDCnxq9O?usp=share_link).\n\n\n### Repo Structure\n- ``imitate_episodes.py`` Train and Evaluate ACT\n- ``policy.py`` An adaptor for ACT policy\n- ``detr`` Model definitions of ACT, modified from DETR\n- ``sim_env.py`` Mujoco + DM_Control environments with joint space control\n- ``ee_sim_env.py`` Mujoco + DM_Control environments with EE space control\n- ``scripted_policy.py`` Scripted policies for sim environments\n- ``constants.py`` Constants shared across files\n- ``utils.py`` Utils such as data loading and helper functions\n- ``visualize_episodes.py`` Save videos from a .hdf5 dataset\n\n\n### Installation\n\n    conda create -n aloha python=3.8.10\n    conda activate aloha\n    pip install torchvision\n    pip install torch\n    pip install pyquaternion\n    pip install pyyaml\n    pip install rospkg\n    pip install pexpect\n    pip install mujoco==2.3.7\n    pip install dm_control==1.0.14\n    pip install opencv-python\n    pip install matplotlib\n    pip install einops\n    pip install packaging\n    pip install h5py\n    pip install ipython\n    cd act/detr \u0026\u0026 pip install -e .\n\n- also need to install https://github.com/ARISE-Initiative/robomimic/tree/r2d2 (note the r2d2 branch) for Diffusion Policy by `pip install -e .`\n\n### Example Usages\n\nTo set up a new terminal, run:\n\n    conda activate aloha\n    cd \u003cpath to act repo\u003e\n\n### Simulated experiments (LEGACY table-top ALOHA environments)\n\nWe use ``sim_transfer_cube_scripted`` task in the examples below. Another option is ``sim_insertion_scripted``.\nTo generated 50 episodes of scripted data, run:\n\n    python3 record_sim_episodes.py --task_name sim_transfer_cube_scripted --dataset_dir \u003cdata save dir\u003e --num_episodes 50\n\nTo can add the flag ``--onscreen_render`` to see real-time rendering.\nTo visualize the simulated episodes after it is collected, run\n\n    python3 visualize_episodes.py --dataset_dir \u003cdata save dir\u003e --episode_idx 0\n\nNote: to visualize data from the mobile-aloha hardware, use the visualize_episodes.py from https://github.com/MarkFzp/mobile-aloha\n\nTo train ACT:\n    \n    # Transfer Cube task\n    python3 imitate_episodes.py --task_name sim_transfer_cube_scripted --ckpt_dir \u003cckpt dir\u003e --policy_class ACT --kl_weight 10 --chunk_size 100 --hidden_dim 512 --batch_size 8 --dim_feedforward 3200 --num_epochs 2000  --lr 1e-5 --seed 0\n\n\nTo evaluate the policy, run the same command but add ``--eval``. This loads the best validation checkpoint.\nThe success rate should be around 90% for transfer cube, and around 50% for insertion.\nTo enable temporal ensembling, add flag ``--temporal_agg``.\nVideos will be saved to ``\u003cckpt_dir\u003e`` for each rollout.\nYou can also add ``--onscreen_render`` to see real-time rendering during evaluation.\n\nFor real-world data where things can be harder to model, train for at least 5000 epochs or 3-4 times the length after the loss has plateaued.\nPlease refer to [tuning tips](https://docs.google.com/document/d/1FVIZfoALXg_ZkYKaYVh-qOlaXveq5CtvJHXkY25eYhs/edit?usp=sharing) for more info.\n\n### [ACT tuning tips](https://docs.google.com/document/d/1FVIZfoALXg_ZkYKaYVh-qOlaXveq5CtvJHXkY25eYhs/edit?usp=sharing)\nTL;DR: if your ACT policy is jerky or pauses in the middle of an episode, just train for longer! Success rate and smoothness can improve way after loss plateaus.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkFzp%2Fact-plus-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarkFzp%2Fact-plus-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkFzp%2Fact-plus-plus/lists"}