Skip to content

Commit

Permalink
First modification of README
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliotMaitre committed Sep 13, 2023
1 parent 10d7c3e commit 793893b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 131 deletions.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


Toolbox and trackers for object pose-estimation. Based on the work [CosyPose](https://github.com/Simple-Robotics/cosypose) and [MegaPose](https://github.com/megapose6d/megapose6d). This directory is currently under development.
Toolbox and trackers for object pose-estimation. Based on the work [CosyPose](https://github.com/Simple-Robotics/cosypose) and [MegaPose](https://github.com/megapose6d/megapose6d). This directory is currently under development. Please refer to the [documentation](https://agimus-project.github.io/happypose/) for more details.


# Installation
Expand All @@ -34,3 +34,44 @@ cd happypose/pose_estimators/megapose/deps/bop_toolkit_challenge/
# Remove all versions enforcing on requirements.txt
pip install -r requirements.txt -e .
```


# Create data directory

```
Create data dir /somewhere/convenient. The dataset to store are quite large.
export MEGAPOSE_DATA_DIR=/somewhere/convenient
```

# Configuration for the evaluation

If you plan on evaluating CosyPose and Megapose, you need to modify the following lines in `bop_toolkit_lib/config.py`, replace :

```
######## Basic ########
# Folder with the BOP datasets.
if 'BOP_PATH' in os.environ:
datasets_path = os.environ['BOP_PATH']
else:
datasets_path = r'/path/to/bop/datasets'
# Folder with pose results to be evaluated.
results_path = r'/path/to/folder/with/results'
# Folder for the calculated pose errors and performance scores.
eval_path = r'/path/to/eval/folder'
```

with

```
######## Basic ########
# Folder with the BOP datasets.
datasets_path = str(os.environ['BOP_DATASETS_PATH'])
results_path = str(os.environ['BOP_RESULTS_PATH'])
eval_path = str(os.environ['BOP_EVAL_PATH'])
```
4 changes: 3 additions & 1 deletion docs/book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@

# MegaPose

- [TODO](./megapose/todo.md)
- [Testing your installation](./megapose/test-install.md)
- [Downloading and preparing the data](./megapose/download-data.md)
- [Evaluate MegaPose](./megapose/evaluate.md)
24 changes: 2 additions & 22 deletions docs/book/cosypose/download-data.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Downloading and preparing the data


```
Create data dir /somewhere/convenient. The dataset to store are quite large.
export MEGAPOSE_DATA_DIR=/somewhere/convenient
```

download [barbecue sauce](https://drive.google.com/drive/folders/10BIvhnrKGbNr8EKGB3KUtkSNcp460k9S) and put it in `$MEGAPOSE_DATA_DIR/examples/barbecue-sauce/`


All data used (datasets, models, results, ...) are stored in a directory `local_data` at the root of the repository. Create it with `mkdir local_data` or use a symlink if you want the data to be stored at a different place. We provide the utility `cosypose/scripts/download.py` for downloading required data and models. All of the files can also be [downloaded manually](https://drive.google.com/drive/folders/1JmOYbu1oqN81Dlj2lh6NCAMrC8pEdAtD?usp=sharing).
All data used (datasets, models, results, ...) are stored in a directory `$MEGAPOSE_DATA_DIR` that you created in the Readsme. We provide the utilities for downloading required data and models. All of the files can also be [downloaded manually](https://www.paris.inria.fr/archive_ylabbeprojectsdata/).

## BOP Datasets

Expand Down Expand Up @@ -111,16 +103,4 @@ Notes:
- The PoseCNN detections (and coarse pose estimates) on YCB-Video were extracted and converted from [these PoseCNN results](https://github.com/yuxng/YCB_Video_toolbox/blob/master/results_PoseCNN_RSS2018.zip).
- The Pix2pose detections were extracted using [pix2pose's](https://github.com/kirumang/Pix2Pose) code. We used the detection model from their paper, see [here](https://github.com/kirumang/Pix2Pose#download-pre-trained-weights). For the ViVo detections, their code was slightly modified. The code used to extract detections can be found [here](https://github.com/ylabbe/pix2pose_cosypose).

</details>

<details>
<summary>Megapose</summary>

## 1. Download pre-trained pose estimation models
Download pose estimation models to $MEGAPOSE_DATA_DIR/megapose-models:

```
python -m happypose.toolbox.utils.download --megapose_models
```
</details>
</details>
</details>
80 changes: 1 addition & 79 deletions docs/book/cosypose/evaluate.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,6 @@
# Evaluating CosyPose

## Install

Two installation steps are needed : [bop_toolkit](https://github.com/thodan/bop_toolkit) and [bop_renderer](https://github.com/thodan/bop_renderer/). These repository are stored in `happypose/pose_estimators/megapose/deps/`.

### 1. Bop_toolkit_challenge

```
cd /happypose/pose_estimators/megapose/deps/bop_toolkit_challenge
# You need to remove all the versions from the requirements.txt file, then :
pip install -r requirements.txt -e .
```

Then, you need to modify the following lines in `bop_toolkit_lib/config.py`, replace :


```
######## Basic ########
# Folder with the BOP datasets.
if 'BOP_PATH' in os.environ:
datasets_path = os.environ['BOP_PATH']
else:
datasets_path = r'/path/to/bop/datasets'
# Folder with pose results to be evaluated.
results_path = r'/path/to/folder/with/results'
# Folder for the calculated pose errors and performance scores.
eval_path = r'/path/to/eval/folder'
```

with

```
######## Basic ########
# Folder with the BOP datasets.
datasets_path = str(os.environ['BOP_DATASETS_PATH'])
results_path = str(os.environ['BOP_RESULTS_PATH'])
eval_path = str(os.environ['BOP_EVAL_PATH'])
```


<details>
<summary>This part is deprecated and will be removed </summary>

Also, replace

```
# For offscreen C++ rendering: Path to the build folder of bop_renderer (github.com/thodan/bop_renderer).
bop_renderer_path = r'/path/to/bop_renderer/build'
```

with
```
# For offscreen C++ rendering: Path to the build folder of bop_renderer (github.com/thodan/bop_renderer).
bop_renderer_path = /path/to/happypose/happypose/pose_estimators/megapose/deps/bop_renderer/build
```
</details>

### 2. Bop_renderer

<details>
<summary>This part is deprecated and will be removed</summary>


This installation is tested only on Ubuntu/Debian system. Please refer to [bop_renderer](https://github.com/thodan/bop_renderer/) if needed.

```
cd /happypose/pose_estimators/megapose/deps/bop_renderer
sudo apt install libosmesa6-dev
conda install -c conda-forge mesalib
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
</details>

## Usage
Please make sure you followed the steps relative to the evaluation in the main readme.

This needs to be adapted (SO3_grid not used for CosyPose)

Expand Down
29 changes: 1 addition & 28 deletions docs/book/cosypose/test-install.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
# Testing your installation

## 0. Create data directory

```
Create data dir /somewhere/convenient. The dataset to store are quite large.
export MEGAPOSE_DATA_DIR=/somewhere/convenient
cd $MEGAPOSE_DATA_DIR
wget https://memmo-data.laas.fr/static/examples.tar.xz
tar xf examples.tar.xz
```

## 1. Download pre-trained pose estimation models

### Megapose
Download pose estimation models to $MEGAPOSE_DATA_DIR/megapose-models:

```
python -m happypose.toolbox.utils.download --megapose_models
```

### Cosypose
## Download pre-trained pose estimation models

```sh
#ycbv
Expand All @@ -34,14 +15,6 @@ python -m happypose.toolbox.utils.download --megapose_models
```
## 2. Run examples

### Megapose

```
python -m happypose.pose_estimators.megapose.src.megapose.scripts.run_inference_on_example barbecue-sauce --run-inference --vis-outputs
```

### CosyPose

You need to download the ycbv dataset to run this example. Please see the download section.

```
Expand Down

0 comments on commit 793893b

Please sign in to comment.