Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
huy-ha committed Jul 30, 2023
0 parents commit 3d2f43c
Show file tree
Hide file tree
Showing 2,092 changed files with 4,881,033 additions and 0 deletions.
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
minimum_pre_commit_version: 2.20.0
default_stages: [commit, push]
exclude: "^$"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: end-of-file-fixer
files: \.(py|sh|rst|yml|yaml)$
- id: mixed-line-ending
- id: trailing-whitespace
files: \.(py|sh|rst|yml|yaml)$
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
- --config=setup.cfg
- --ignore=E203,E266,E501,W503,F403,F401,B905
additional_dependencies:
[
"flake8-blind-except",
"flake8-docstrings",
"flake8-bugbear",
"flake8-comprehensions",
"flake8-docstrings",
"flake8-implicit-str-concat",
"pydocstyle>=5.0.0",
]
exclude: ^scalingup/(prompts|policy/prompts|task_generator/prompts)/|build/|scripts/|scalingup/algo/robomimic_nets|scalingup/algo/tsdf
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.1"
hooks:
- id: mypy
args:
- --check-untyped-defs
additional_dependencies:
- "pydantic"
exclude: ^scalingup/(prompts)/|tests/|build
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
args:
- -L caler
- --write
exclude: scripts/visualizations/rollout|presentation/js|presentation/plugin|presentation/package-lock.json|.svg|presentation/index.html|scalingup/algo/tsdf.py
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<h1> Scaling Up and Distilling Down: Language-Guided Robot Skill Acquisition</h1>
<div style="text-align: center;">

[Huy Ha](https://www.cs.columbia.edu/~huy/)$^1$, [Pete Florence](https://www.peteflorence.com/)$^2$, [Shuran Song](https://shurans.github.io/)$^1$

$^1$ Columbia University, $^2$ Google DeepMind

[Project Page](https://www.cs.columbia.edu/~huy/scalingup) | [Arxiv](https://arxiv.org/abs/2307.14535) | [Video](https://www.cs.columbia.edu/~huy/scalingup/static/videos/scalingup.mp4)

<div style="margin:50px; text-align: justify;">
<img style="width:100%;" src="docs/assets/teaser.gif">

Scaling Up and Distilling Down is a framework for language-guided skill learning.
Give it a task description, and it will automatically generate rich, diverse robot trajectories, complete with success label and dense language labels.

<b>The best part?</b> It uses no expert demonstrations, manual
reward supervision, and no manual language annotation.

</div>
</div>

<br>

This repository contains code for language-guided data generation and language-conditioned diffusion policy training for [Scaling Up And Distilling Down](https://www.cs.columbia.edu/~huy/scalingup).
It has been tested on Ubuntu 18.04, 20.04 and 22.04, NVIDIA GTX 1080, NVIDIA RTX A6000, NVIDIA GeForce RTX 3080, and NVIDIA GeForce RTX 3090.

If you find this codebase useful, consider citing:

```bibtex
@inproceedings{ha2023scalingup,
title={Scaling Up and Distilling Down: Language-Guided Robot Skill Acquisition},
author={Huy Ha and Pete Florence and Shuran Song},
year={2023},
eprint={2307.14535},
archivePrefix={arXiv},
primaryClass={cs.RO}
}
```

If you have any questions, please contact [me](https://www.cs.columbia.edu/~huy/) at `huy [at] cs [dot] columbia [dot] edu`.

**Table of Contents**

- ⚙️[Setup](docs/setup.md)
- 🚶[Codebase Walkthrough](docs/walkthrough.md)
- [💡 Core Concepts](docs/walkthrough.md#-core-concepts)
- [🪺 Nested Trajectories using Hierachical Actions and Policies](docs/walkthrough.md#-nested-trajectories-using-hierachical-actions-and-policies)
- [🌳 Exploration Task Tree](docs/walkthrough.md#exploration-task-tree)
- [🌈 Seeded Variation](docs/walkthrough.md#🌈-seeded-variation)
- [🎛️ Control](docs/walkthrough.md#control)
- [🏃‍♂️ Motion Planning](docs/walkthrough.md#️-motion-planning)
- [🗣️ Language Model Queries](docs/walkthrough.md#language-model-queries)
- [💿 Cache](docs/walkthrough.md#-cache)
- [🔗 Linking LLM Modules Together](docs/walkthrough.md#-linking-llm-modules-together)
- [🪙 Coin flips](docs/walkthrough.md#-coin-flips)
- 🔬 [Reproducing](docs/reproduce.md)
- 📊 [Evaluation](docs/reproduce.md#evaluation)
- 🗄️ [Data Generation](docs/reproduce.md#data-generation-for-training)
- 🧠 [Training](docs/reproduce.md#training)
- 🔭 [Extending](docs/extend.md)
- [I want to add more](docs/extend.md#i-want-to-add-more)
- 🤖 [Robots](docs/extend.md#robots-)
- 🪑 [Assets](docs/extend.md#assets-)
- 📜 [Tools \& Scripts](docs/extend.md#tools--scripts-)
- 🌏 [Environments \& Tasks](docs/extend.md#environments--tasks-)
- [New Simulators](docs/extend.md#new-simulators)
- [New Tasks](docs/extend.md#new-tasks)
- 🦙 [Language Models](docs/extend.md#language-models-)
- 🖼️ [Figure Utilities](docs/extend.md#figure-utilities-️)
- [Efficiency Plot](docs/extend.md#efficiency-plot)
- [Visualizing Language-conditioned Outputs](docs/extend.md#visualizing-language-conditioned-outputs)
-[Development Tips](docs/extend.md#development-tips-)
- 🐉 [Hydra](docs/extend.md#hydra-)
- 📷 [Headless Rendering](docs/extend.md#headless-rendering-)
- 🖧 [Multi-processing](docs/extend.md#multi-processing-)
- 👩‍👦‍👶 [Typing](docs/extend.md#typing-)
- ⏱️ [Profiling](docs/extend.md#profiling-️)
- 💽 [Data Format](docs/extend.md#data-format-)
- 💾 [RAM Usage](docs/extend.md#ram-usage-)
- 💀 [Known Issues](docs/extend.md#known-issues-)
-[Training Tips](docs/extend.md#training-tips-)
- [Mixed-Precision](docs/extend.md#mixed-precision)
- 📽️ [Visualizations](docs/visualization.md)

# Acknowledgements


We would like to thank Cheng Chi, Zeyi Liu, Samir Yitzhak Gadre, Mengda Xu, Zhenjia Xu, Mandi Zhao and Dominik Bauer for their helpful feedback and fruitful discussions.


This work was supported in part by Google Research Award, NSF Award #2143601, and #2132519.
We would like to thank Google for the UR5 robot hardware.
The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of the sponsors.

## Code

- [Diffusion Policy](https://diffusion-policy.cs.columbia.edu/): The policy was built on top of their [Colab](https://colab.research.google.com/drive/18GIHeOQ5DyjMN8iIRZL2EKZ0745NLIpg?usp=sharing), and our real-world evaluation code was modified from [theirs](https://github.com/columbia-ai-robotics/diffusion_policy#-demo-training-and-eval-on-a-real-robot)
- [Mujoco Menagerie](https://github.com/deepmind/mujoco_menagerie): UR5 and RealSense models were modified from their models.
- [Mujoco Scanned Objects](https://github.com/kevinzakka/mujoco_scanned_objects): Big shout out to [Kevin Zakka](https://kzakka.com/) for all his amazing open-source work, go give him a few stars ⭐
- [3D UNet Implementation](https://github.com/wolny/pytorch-3dunet/) modified from [Adrian Wolny](https://adrianwolny.com/)'s implementation.


## Coming Soon

- **Data + Checkpoint Downloads**: For now, you can still run data generation and training!
Binary file added docs/assets/blender_geonode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/blender_shader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/blender_spreadsheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/closed_loop_grasp_block.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/drawer-scalingup.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/efficiency_plot_seaborn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/mailbox.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/open_loop_grasp_block.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/render_table_top_front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/render_table_top_wrist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/seeded_variation_no_domain_rand.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/seeded_variation_with_domain_rand.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/teaser.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3d2f43c

Please sign in to comment.