From 4e7b96eb05651c6d745b80d7e5c9d2771b344e79 Mon Sep 17 00:00:00 2001 From: ElliotMaitre Date: Fri, 26 Jul 2024 08:51:29 -0400 Subject: [PATCH] adding documentation for the tests and adding torch import in test_evaluation --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++ tests/test_evaluation.py | 1 + 2 files changed, 55 insertions(+) diff --git a/README.md b/README.md index 114c0b9a..7ae1fea6 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,57 @@ pip install .[pypi,cpu] --extra-index-url https://download.pytorch.org/whl/cpu Create data dir /somewhere/convenient. The dataset to store are quite large. export HAPPYPOSE_DATA_DIR=/somewhere/convenient ``` + +## Test the install + +### CPU + +If you work on CPU, these models need to be download : + +``` +#hope dataset models for CosyPose +python -m happypose.toolbox.utils.download --cosypose_models \ + detector-bop-hope-pbr--15246 \ + coarse-bop-hope-pbr--225203 \ + refiner-bop-hope-pbr--955392 +``` + +``` +# For MegaPose +python -m happypose.toolbox.utils.download --megapose_models +``` + +and the examples + +``` +python -m happypose.toolbox.utils.download --examples barbecue-sauce +``` + +In the HappyPose folder: + +``` +pytest -v ./tests +``` + +You may need to install `pytest-order` : `pip installp pytest-order`. In this case, test related to the `evaluation` and the `training` of CosyPose are not run. If you want to use these functionalities, you need a GPU. + +### GPU + +Tests related to `evaluation` and `training` will be run if a GPU is available. Hence, a few more downloads are needed : + +``` +#ycbv models +python -m happypose.toolbox.utils.download --cosypose_models \ + coarse-bop-ycbv-pbr--724183 \ + refiner-bop-ycbv-pbr--604090 +``` + +``` +python -m happypose.toolbox.utils.download --bop_dataset ycbv +``` + +``` +python -m happypose.toolbox.utils.download --test-results +``` + +The tests take much longer in this case. \ No newline at end of file diff --git a/tests/test_evaluation.py b/tests/test_evaluation.py index dc69410d..572f2c1f 100644 --- a/tests/test_evaluation.py +++ b/tests/test_evaluation.py @@ -8,6 +8,7 @@ # Third Party from omegaconf import OmegaConf +import torch from happypose.pose_estimators.megapose.config import ( RESULTS_DIR,