MCPcopy Index your code
hub / github.com/GeWu-Lab/AnyTouch2

github.com/GeWu-Lab/AnyTouch2 @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
953 symbols 3,023 edges 114 files 124 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

(ICLR 2026) AnyTouch 2: General Optical Tactile Representation Learning For Dynamic Tactile Perception

🚀 Welcome to the repo of AnyTouch 2! If our project helps you, please give us a star ⭐ on GitHub to support us. 🙏
[![arXiv](https://img.shields.io/badge/ICLR--.svg)](https://openreview.net/pdf?id=ndilONnABZ) [![hf_checkpoint](https://img.shields.io/badge/🤗-AnyTouch_2_Model-9C276A.svg)](https://huggingface.co/xxuan01/AnyTouch2-Model) [![hf_data](https://img.shields.io/badge/🤗-ToucHD_dataset-9C276A.svg)](https://huggingface.co/collections/BAAI/touchd) [![arXiv](https://img.shields.io/badge/Arxiv-2602.09617-AD1C18.svg?logo=arXiv)](https://arxiv.org/abs/2602.09617) [![Webpage](https://img.shields.io/badge/Webpage-AnyTouch_2-.svg)](https://gewu-lab.github.io/AnyTouch2/) ## 📑To Do - [x] Quick Start Demo Code - [x] Dataset Pre-processing - [x] Sparsh Evaluation Code - [ ] Real-world Code **[2026/4/17]** We have updated the Sparsh evaluation code. Please pull the latest changes from the repository using `git pull`. ## 🛠️ Requirements and Installation 1. Create Environment ``` conda create -n anytouch2 python=3.9 conda activate anytouch2 ``` 2. Install PyTorch 2.4.0 + Cuda 12.4 ``` pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu124 ``` 3. Install other required packages: ``` git clone https://github.com/GeWu-Lab/AnyTouch2.git cd AnyTouch2 pip install -r requirements.txt ``` ## 🚀 Quick Start 1. Download AnyTouch 2 Model Checkpoints into `checkpoints/` **(Complete the [form](https://huggingface.co/xxuan01/AnyTouch2-Model) to get access first)** ``` huggingface-cli download --repo-type model xxuan01/AnyTouch2-Model --local-dir checkpoints ``` Checkpoint Performance: | | | TAG | Cloth | Slip / Delta Force (Sparsh) | Force (Sparsh) | Force (ToucHD) | | :------------: | :--------: | :-------: | :-------: | :------------------------------------------------------: | :------------------------------------: | :-------------------------------------: | | **num_frames** | **stride** | Acc ↑ | Acc ↑ | F1 Score ↑ / RMSE ↓ | RMSE ↓ | RMSE ↓ | | 4 | 2 | **76.97** | **42.31** | **86.66** / 87.80 (DG) **97.96** / **80.83** (Mini) | **624.26** (DG) **202.14** (Mini) | **894.32** (DG) **1051.03** (Mini) | | 2 | 6 | 74.15 | 40.76 | 86.60 / **83.15** (DG) 97.85 / 89.21 (Mini) | 643.91 (DG) 208.41 (Mini) | 1076.33 (DG) 1311.27 (Mini) | 2. Run `quick_start.sh` (Coming Soon) ``` bash scripts/quick_start.sh ``` ## 🤖 Downstream Evaluation ### ToucHD Bench and Object Bench 1. Download [ToucHD (Force)](https://huggingface.co/datasets/BAAI/ToucHD-Force) **(Complete the [form](https://huggingface.co/datasets/BAAI/ToucHD-Force) to get access first)**, [Touch and Go](https://github.com/fredfyyang/Touch-and-Go/tree/main/Visuo-tactile%20contrastive%20learning) an [Cloth](http://data.csail.mit.edu/active_clothing/Data_ICRA18.tar) into `datasets/` ``` ### Download ToucHD (Force). Please complete the form to get access first. huggingface-cli download --repo-type dataset xxuan01/BAAI/ToucHD-Force --local-dir datasets ``` 2. Pre-process the datasets ```sh cd datasets/ToucHD-Force for f in *.zip; do unzip "$f" -d "${f%.zip}" done ``` 3. Run scripts to start downstream training and evaluation ``` bash scripts/run_probe_tag.sh bash scripts/run_probe_cloth.sh bash scripts/run_probe_touchd.sh ``` ### Sparsh Bench 1. Download [Sparsh datasets](https://huggingface.co/collections/facebook/sparsh) into `datasets/` ``` huggingface-cli download --repo-type dataset facebook/gelsight-force-estimation --local-dir datasets huggingface-cli download --repo-type dataset facebook/digit-force-estimation --local-dir datasets huggingface-cli download --repo-type dataset facebook/digit-pose-estimation --local-dir datasets ``` 2. Rename the dataset folders by removing '-estimation' (e.g. gelsight-force-estimation -> gelsight-force) 3. Run scripts to start downstream training and evaluation ``` bash sparsh/run_task.sh ``` ## 📑 Citation
@inproceedings{fenganytouch2,
  title={AnyTouch 2: General Optical Tactile Representation Learning For Dynamic Tactile Perception},
  author={Feng, Ruoxuan and Zhou, Yuxuan and Mei, Siyu and Zhou, Dongzhan and Wang, Pengwei and Cui, Shaowei and Fang, Bin and Yao, Guocai and Hu, Di},
  booktitle={The Fourteenth International Conference on Learning Representations}
}
# Coming Soon!

Core symbols most depended-on inside this repo

print
called by 131
util/misc.py
load
called by 38
sparsh/tactile_ssl/trainer/trainer.py
max
called by 33
util/misc.py
get_pylogger
called by 25
sparsh/tactile_ssl/utils/logging.py
update
called by 16
sparsh/tactile_ssl/utils/__init__.py
update
called by 15
util/misc.py
load_state_dict
called by 15
util/misc.py
get_resize_transform
called by 12
sparsh/tactile_ssl/data/digit/utils.py

Shape

Method 625
Function 188
Class 138
Route 2

Languages

Python100%

Modules by API surface

sparsh/tactile_ssl/model/point_mae.py48 symbols
util/misc.py35 symbols
sparsh/tactile_ssl/model/vision_transformer.py27 symbols
sparsh/tactile_ssl/model/multimodal_transformer.py23 symbols
sparsh/tactile_ssl/algorithm/vjepa.py21 symbols
sparsh/tactile_ssl/trainer/trainer.py19 symbols
sparsh/tactile_ssl/downstream_task/forcefield_sl.py19 symbols
sparsh/tactile_ssl/downstream_task/utils_forcefield/layers/Reassemble.py18 symbols
sparsh/tactile_ssl/data/digit/utils.py17 symbols
sparsh/tactile_ssl/utils/signal_connector.py16 symbols
sparsh/tactile_ssl/utils/masking.py16 symbols
sparsh/tactile_ssl/algorithm/ijepa.py16 symbols

For agents

$ claude mcp add AnyTouch2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact