Skip to content

Commit

Permalink
Merge pull request #25 from martius-lab/final_submission
Browse files Browse the repository at this point in the history
Final version of readme
  • Loading branch information
AndReGeist authored Jun 17, 2024
2 parents eb8fd0c + e423ab6 commit ee15405
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 23 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<h4 align="center">
Code for the paper: <a href="https://arxiv.org/abs/2404.11735" target="_blank">"Learning with 3D rotations, a hitchhiker’s guide to SO(3)"</a></h4>
<h6 align="center">A. René Geist, Jonas Frey, Mikel Zhobro, Anna Levina, and Georg Martius</h6>

<p align="center">
<a href="#overview">Overview</a> •
<a href="#installation">Installation</a> •
<a href="#experiments">Experiments</a> •
<a href="#development">Development</a> •
<a href="#credits">Credits</a>
<a href="#development">Development</a>
</p>


Expand Down Expand Up @@ -53,6 +53,12 @@ pip3 install torch torchvision torchaudio
```

# Experiments

<p float="center">
<img src="/assets/docs/gso_vs_svd1.gif" width="400" />
<img src="/assets/docs/gso_vs_svd3.gif" width="400" />
</p>

All experiments are implemented in PyTorch.
Most experiments simply use [train.py](scripts/train.py).
Depending on which command line arguments are passed (see below),
Expand All @@ -72,7 +78,7 @@ learning results that have been stored using [logger.py](hitchhiking_rotations/u
To reproduce the paper's experiments, download the data, and save it in the `assets/datasets` folder.

> [!NOTE]
> The data is available here: [link](PUT-LINK-HERE)
> The data is available here: [link](https://drive.google.com/drive/folders/1D1FNeKBuFYC2BHxFWgzfm-cj2K3rVhnr?usp=sharing)

### Experiment 1, 2.1, and 2.2
Expand Down Expand Up @@ -100,16 +106,19 @@ for nb in {1..5}; do for seed in {1..20}; do python scripts/train.py --seed $see

To reproduce the paper's figures, run the following commands:

| **Figures** | **Console command** |
|------------------------------------|--------------------------------------|
| Experiment 1 | TBD |
| Experiment 2.1 | `python visu/figure12a.py` |
| Experiment 2.2 | `python visu/figure12b.py` |
| Experiment 3 | TBD |
| Experiment 4 | `python visu/figure14.py` |
| Figure 6 & 18: Lipschitz constants | `python visu/lipschitz_constants.py` |
| Figure 16: MoCap data analysis | TBD |
| Figure 17: Loss gradients | `python visu/loss_gradients.py` |
| **Figures** | **Console command** |
|------------------------------------|---------------------------------------|
| Experiment 1 | `python visu/figure_pointcloud.py` |
| Experiment 2.1 | `python visu/figure_exp2a.py` |
| Experiment 2.2 | `python visu/figure_exp2b.py` |
| Experiment 3 | `python visu/figure_posenet.py` |
| Experiment 4 | `python visu/figure_fourier.py` |
| Figure 6 & 20: Lipschitz constants | `python visu/lipschitz_constants.py` |
| Figure 10: Training GSO & SVD | `python visu/gso_vs_svd_animation.py` |
| Figure 11: Gradient ratios of SVD | `python visu/gso_vs_svd.py` |
| Figure 18: Loss gradients | `python visu/loss_gradients.py` |
| Figure 19: MoCap data analysis | `python visu/figure_mocap.py` |


# Development
### Code Formatting
Expand All @@ -130,5 +139,3 @@ pip3 install addheader
addheader hitchhiking_rotations -t .header.txt -p \*.py --sep-len 79 --comment='#' --sep=' '
```

# Credits
TBD
Binary file added assets/docs/gso_vs_svd1.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 assets/docs/gso_vs_svd2.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 assets/docs/gso_vs_svd3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions hitchhiking_rotations/cfgs/cfg_cube_image_to_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def get_cfg_cube_image_to_pose(device):
shared_trainer_cfg = {
"_target_": "hitchhiking_rotations.utils.Trainer",
"lr": 0.001,
"patience": 10,
"optimizer": "Adam",
"logger": "${logger}",
"verbose": "${verbose}",
Expand Down
1 change: 1 addition & 0 deletions hitchhiking_rotations/cfgs/cfg_pcd_to_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def get_cfg_pcd_to_pose(device):
shared_trainer_cfg = {
"_target_": "hitchhiking_rotations.utils.Trainer",
"lr": 0.001,
"patience": 10,
"optimizer": "Adam",
"logger": "${logger}",
"verbose": "${verbose}",
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
for seed in range(10):
os.system(f"python3 {p} --experiment {exp} --seed {seed}")
if exp in exps[:2]:
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_19.py ") + exp))
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_12a.py ") + exp))
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_pointcloud.py ") + exp))
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_exp2a.py ") + exp))
else:
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_12b.py")))
os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_exp2b.py")))
2 changes: 1 addition & 1 deletion visu/figure_12a.py → visu/figure_exp2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
plt.xticks([0.3, 0.4, 0.5, 0.6], ["0.3", "0.4", "0.5", "0.6"])

plt.tight_layout()
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, "figure_12a.pdf")
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, "figure_exp2a.pdf")

plt.savefig(out_p)
plt.show()
2 changes: 1 addition & 1 deletion visu/figure_12b.py → visu/figure_exp2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
plt.xticks([0.0005, 0.001, 0.002, 0.004], [r"$5\cdot10^{-4}$", r"$10^{-3}$", r"$2\cdot10^{-3}$", r"$4\cdot10^{-3}$"])

plt.tight_layout()
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "pose_to_cube_image", "figure_12b.pdf")
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "pose_to_cube_image", "figure_exp2b.pdf")
plt.savefig(out_p)
plt.show()
2 changes: 1 addition & 1 deletion visu/figure_14.py → visu/figure_fourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@
plt.yscale("log")
plt.tight_layout()

out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "figure_14.pdf")
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "figure_fourier.pdf")
plt.savefig(out_p)
plt.show()
File renamed without changes.
2 changes: 1 addition & 1 deletion visu/figure_19.py → visu/figure_pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
# plt.xscale("log")
plt.tight_layout()

out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, f"figure_19_combined.pdf")
out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, f"figure_pointcloud_combined.pdf")

plt.savefig(out_p)

Expand Down
2 changes: 1 addition & 1 deletion visu/figure_13.py → visu/figure_posenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ def generate_colormap(base_color, lvl=0.2, alpha=0.5):
plt.grid(True, linestyle="--", color="gray", alpha=0.5)

plt.tight_layout()
plt.savefig(os.path.join(HITCHHIKING_ROOT_DIR, "results", "dense_fusion", "figure_13.pdf"))
plt.savefig(os.path.join(HITCHHIKING_ROOT_DIR, "results", "dense_fusion", "figure_posenet.pdf"))
plt.show()

0 comments on commit ee15405

Please sign in to comment.