Skip to main content

SAPIEN

SAPIEN is a realistic and physics-rich simulated environment that hosts a large-scale set for articulated objects. It enables various robotic vision and interaction tasks that require detailed part-level understanding. SAPIEN is a collaborative effort between researchers at UCSD, Stanford and SFU. The dataset is a continuation of ShapeNet and PartNet.

Getting Started

SAPIEN is distributed via PyPI. Installation is just

pip install sapien

It requires Linux with NVIDIA, AMD, or Intel GPU to run. Verify installation with

python -m sapien.exapmle.hello_world

Next, follow our tutorial at: https://sapien-sim.github.io/docs/.

Offscreen rendering on a server

To use SAPIEN on a GPU server without display, the only system dependencies required are libegl1 and libxext6. If using NVIDIA docker environment, enable graphics, utility, and compute by setting the environment variable in the Dockerfile.

ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute

Virtual desktop on a server

To use SAPIEN on a GPU server with virtual display, additionally install xvfb, x11vnc, and any window manager such as fluxbox or xfce. Add display capabilities for NVIDIA docker.

ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute,display

Assuming fluxbox, start a VNC server by

x11vnc -create -env FD_PROG=/usr/bin/fluxbox  -env X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 -env X11VNC_CREATE_GEOM=${99:-1920x1080x16} -gone 'pkill Xvfb' -nopw
# Note: you should use a strong password and/or only allow local access

Now you can connect to the server at port 5900. SAPIEN should be fully functional, test with

python -m sapien.exapmle.hello_world

Change Log

3.0
  • Major API & infrastructure overhaul
    • Refactor SAPIEN core to use entity-component system
      • Actor from SAPIEN 2 now becomes Entity in SAPIEN 3
      • Functionalities of an Actor now becomes components attached to an entity.
      • See updated documentation for usage.
      • Actor builder and articulation builder APIs are mostly unchanged, except the color and material parameters for visual shapes are unified to material.
    • Support for PhysX 5 GPU simulation. See ManiSkill for how it is used to build robot learning environments.
2.2
  • Rename VulkanRenderer to SapienRenderer (VulkanRenderer is still an alias)
  • Support ray tracing in SapienRenderer
  • Deprecate KuafuRenderer, use the rt shader in SapienRenderer instead
  • GPU-accelerated stereo depth sensor simulation
  • Render server
  • Python 3.11
  • bug fixes
    • Fix inverse kinematics default active joint mask (now defaults to all 1s)
    • Fix incorrectly exported memory in Vulkan-Cuda interop
    • Fix joint get_global_pose
2.1
  • Python 3.10
  • Bug fixes
    • crash when not using renderer
    • joint force limit (was impulse limit)
    • incorrect inertia computation in scaled URDF
    • incorrect point-light shadow
    • incorrect collision when loaded from dae
  • Utility improvements
    • set_material
    • active light
    • flat shading
    • dynamic point rendering
    • envmap generation
    • multi-thread envs
2.1
  • Refactor light system
    • Remove light functions on scene.renderer_scene
  • Refactor camera system
    • Cameras no longer require mounts
    • Camera can change its mount and mounted pose by camera.set_parent and camera.set_local_pose.
    • When camera is not mounted, setting local pose is setting its global pose.
    • Add functions scene.add_camera and scene.remove_camera
    • add_mounted_camera can be replaced with add_camera followed by camera.set_parent and camera.set_local_pose. add_mounted_camera is still provided but fovx should not longer be provided.
    • Remove functions related to mount, including find_camera_by_mount.
    • Cameras now support full camera parameters through camera.near, camera.far, camera.set_fovx, camera.set_fovy, camera.set_focal_lengths, camera.set_principal_point, camera.skew, and the all-in-one method camera.set_perspective_parameters.
  • Refactor render shape system
    • Originally, after actor.get_visual_bodies() and visual_body.get_render_shapes(), users typically do shape.scale and shape.pose. These are no longer valid. It is required to check visual_body.type. When type is mesh, shape.scale is replaced with visual_body.scale and shape.pose is replaced by visual_body.local_pose. These changes are made to match add_visual_shape functions when building the actor.
pre2.0
  • Shader change: 4th component in default camera shader now gives the 0-1 depth value.
  • Add "critical" and "off" log levels.
  • Add support for pointcloud and line rendering (for visualizing camera and point cloud)
  • Performance: the same shader only compile once per process
  • Bug fix
    • Articulation setDriveTarget was now correctly reversed for prismatic joint (joint setDriveTarget is not affected)
    • Fix kinematic articulation loader
1 to 2 migration
  • replace scene.renderer_scene.add_xxx_light with scene.add_xxx_light
  • replace scene.remove_mounted_camera with scene.remove_camera
  • optionally, remove fovx from scene.add_mounted_camera.
1.1
  • Support nonconvex static/kinematic collision shape
  • Add warning for small mass/inertia
  • Introduce Entity as the base class of Actors
  • Add Light classes inherited from entity, allowing manipulate light objects in sapien scene
  • Updates to the viewer
    • rename actor to entity when appropriate
  • Partial support the material tag in URDF loader (primitive shape, single color)
  • Bug fixes for the renderer
  • Support inner and outer FOV for spotlight
1.0
  • Replace the old Vulkan based renderer completely
    • See sapien.core.renderer for details
  • Expose GUI functionalities to Python
  • Reimplement Vulkan viewer in Python
  • Expose PhysX shape wrapper to Python. For example,
    • Collision shapes can be retrieved through actor.get_collision_shapes
    • Collision groups on a shape can be set by CollisionShape.set_collision_groups
    • Shapes are now also available in Contact.
  • API changes
    • Render material creation is now renderer.create_material()
    • in actor builder: add_xxx_shape is replaced with add_xxx_collision.
    • move light functions from scene to scene.renderer_scene
  • Add centrifugal and Coriolis force.
  • Change default physical parameters for better stability.

Website and Documentation

SAPIEN Website: https://sapien.ucsd.edu/. SAPIEN Documentation: https://sapien-sim.github.io/docs/.

Build from source

Before build

Make sure all submodules are initialized git submodule update --init --recursive.

Build with Docker

To build SAPIEN, simply run ./scripts/docker_build_wheels.sh. It is not recommended to build outside of our provided docker.

For reference, the Dockerfile is provided here. Note that PhysX needs to be compiled with clang-9 into static libraries before building the Docker image.

Build without Docker

It can be tricky to setup all dependencies outside of a Docker environment. You need to install all dependencies according to the Docker environment. If all dependencies set up correctly, run python setup.py bdist_wheel to build the wheel.

Cite SAPIEN

If you use SAPIEN and its assets, please cite the following works:

@InProceedings{Xiang_2020_SAPIEN,
author = {Xiang, Fanbo and Qin, Yuzhe and Mo, Kaichun and Xia, Yikuan and Zhu, Hao and Liu, Fangchen and Liu, Minghua and Jiang, Hanxiao and Yuan, Yifu and Wang, He and Yi, Li and Chang, Angel X. and Guibas, Leonidas J. and Su, Hao},
title = {{SAPIEN}: A SimulAted Part-based Interactive ENvironment},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}}
@InProceedings{Mo_2019_CVPR,
author = {Mo, Kaichun and Zhu, Shilin and Chang, Angel X. and Yi, Li and Tripathi, Subarna and Guibas, Leonidas J. and Su, Hao},
title = {{PartNet}: A Large-Scale Benchmark for Fine-Grained and Hierarchical Part-Level {3D} Object Understanding},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}
@article{chang2015shapenet,
title={Shapenet: An information-rich 3d model repository},
author={Chang, Angel X and Funkhouser, Thomas and Guibas, Leonidas and Hanrahan, Pat and Huang, Qixing and Li, Zimo and Savarese, Silvio and Savva, Manolis and Song, Shuran and Su, Hao and others},
journal={arXiv preprint arXiv:1512.03012},
year={2015}
}

If you use SAPIEN Realistic Depth generated by SAPIEN's simulated depth sensor, please cite the following work:

@ARTICLE{10027470,
  author={Zhang, Xiaoshuai and Chen, Rui and Li, Ang and Xiang, Fanbo and Qin, Yuzhe and Gu, Jiayuan and Ling, Zhan and Liu, Minghua and Zeng, Peiyu and Han, Songfang and Huang, Zhiao and Mu, Tongzhou and Xu, Jing and Su, Hao},
  journal={IEEE Transactions on Robotics}, 
  title={Close the Optical Sensing Domain Gap by Physics-Grounded Active Stereo Sensor Simulation}, 
  year={2023},
  volume={},
  number={},
  pages={1-19},
  doi={10.1109/TRO.2023.3235591}}

Metadata

Release files for sapien 3.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for sapien 3.0.3
File
sapien-3.0.3-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl CPython 3.14 CPython 3.14 macOS 12.0+ universal2 (ARM64, x86-64) Details
sapien-3.0.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl CPython 3.13 CPython 3.13 macOS 12.0+ universal2 (ARM64, x86-64) Details
sapien-3.0.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl CPython 3.12 CPython 3.12 macOS 12.0+ universal2 (ARM64, x86-64) Details
sapien-3.0.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl CPython 3.11 CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64) Details
sapien-3.0.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl CPython 3.10 CPython 3.10 macOS 12.0+ universal2 (ARM64, x86-64) Details

Total release size: 658.5 MB

Release files / sapien-3.0.3-cp314-cp314-win_amd64.whl

Download URL sapien-3.0.3-cp314-cp314-win_amd64.whl
Size 45.4 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c9c74cee9d45ad0b622eae0b2ebc73651659f50a892d58dc5bbf7e9b28282596
BLAKE2b-256 checksum
How to use checksums
8ab154d0201151b7ea997e3ad54bdb07fc4f345c982260ed25ce17cb8cb0c6a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl
Size 51.3 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7a82849cab35e0e643ecc33f06d0c7c699dea389e5f8804aeb11458ac2695369
BLAKE2b-256 checksum
How to use checksums
04d38464dd4de7a3c1725c98fc79e465e99212820c32fa84f51734b38203587e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl

Download URL sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl
Size 35.7 MB
Tags CPython 3.14 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
512d504da6f2803eda8256a43905c21e57ea9a59c7597e0676755f2fc8b2b813
BLAKE2b-256 checksum
How to use checksums
2a3a715cf600b324eba0e19e64a7d0f1ec326fefb6d1600bd840ff37879d3abd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp313-cp313-win_amd64.whl

Download URL sapien-3.0.3-cp313-cp313-win_amd64.whl
Size 44.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
bff70bf2ffe1fca0f8324f9fb20ac6aab94742d9a3b4339a6d83639f4b5785fc
BLAKE2b-256 checksum
How to use checksums
6e02e297d9da0ab636612ed49235b5c83eefbb8c3eb9cb3fc44fc771a3f8009a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl
Size 51.3 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a8a15c53eeeb01e02674b0c414e5b148ba84ca8b60d9ac2d65ea73f6c4967054
BLAKE2b-256 checksum
How to use checksums
ff079dafe2c7f690e90ef49ddd94aa00fe4f5543816bcc9a3e6bc8384e672a0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl

Download URL sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl
Size 35.7 MB
Tags CPython 3.13 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
c92f20560209715f5c051a94e797d4d36f34d356c35dda5de908e725e7dff546
BLAKE2b-256 checksum
How to use checksums
aab281e5bca0a17ff597ae0cfa5dabebaf78fe7c207aa80df33dcda2c8f5e7de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp312-cp312-win_amd64.whl

Download URL sapien-3.0.3-cp312-cp312-win_amd64.whl
Size 44.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
b9af3676cd76788d468ed7114e6496f16280393f25bb1b87665f14798a98f7e6
BLAKE2b-256 checksum
How to use checksums
f45968ca835587aa0e63235d48dcd6ef71dc4dd9ac98e0cd70394998c1cff297
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl
Size 51.3 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
98200797b2ac41bda48ca21cf89c9ebeb6a20e84f584013378ba45c844425ca5
BLAKE2b-256 checksum
How to use checksums
75379b1c6fd9696225600d42b9f9b6727450283e4d4bbd1e665195b563d8f64b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl

Download URL sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl
Size 35.7 MB
Tags CPython 3.12 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
331a749cc1aa2d869e9257d43a2f35899006cc5df0833a8b84b676b6f5afa396
BLAKE2b-256 checksum
How to use checksums
6dd2f931aa6745663cee4b93ae71d83db08eb24550301e0ffa0c064682e5ae91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp311-cp311-win_amd64.whl

Download URL sapien-3.0.3-cp311-cp311-win_amd64.whl
Size 44.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5b93861445c92ebffd27848bed9e560a56f5cd6679f9908e002bc4deb64ebf82
BLAKE2b-256 checksum
How to use checksums
8036a19e2f5ddebfb8ca61b2ddab4c60c154853500a5b841c4cdadab5a0cf28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl
Size 51.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9a5eb4dc2efdf9b451cdd77a955d45578a5d81474d4e98089bbc36eeb4a07e45
BLAKE2b-256 checksum
How to use checksums
8edd78e25ff9733bbe0dcdc5ea6c06e2dbeb73e696f0f43e946711110fa279fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl

Download URL sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl
Size 35.6 MB
Tags CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
1ac4f940238d79f239bd0d34d406d8b1bd9954e13c8464f93fe517ef5b20f9e1
BLAKE2b-256 checksum
How to use checksums
ea5fbdabddd1bcb8d09fdbd5359115dff8bba7fc104a5ffccadba296231cc0bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp310-cp310-win_amd64.whl

Download URL sapien-3.0.3-cp310-cp310-win_amd64.whl
Size 44.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
c2ff1a73461a63d463ca26837e916e66bf6c6beca9bed7f7eb7ffbbae5f11af7
BLAKE2b-256 checksum
How to use checksums
c6793b79ed7d8024805dc617c242f7f603b7e6f5b21d00782fb271395a19e826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl
Size 51.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
72cb4ec50498bfee3d2f8f238043ba8cdd49ce89663b0826469a46b3796513c1
BLAKE2b-256 checksum
How to use checksums
f78e90d3b9fb5af8386eeca7000f3a69eee8a97417f09154cc73f2c3086b6d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl

Download URL sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl
Size 35.6 MB
Tags CPython 3.10 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
24080c743249e2b13eed806db2075ae767462776ed88ed934c7fe88ddc86890e
BLAKE2b-256 checksum
How to use checksums
4d05c0428b5585249dcb01bf85555470b81b2de385af7404a678e271a6dd9f92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page