test runner for eval_demo

Summary:
Create a test runner for the eval_demo code.  Debugging this is useful for understanding datasets.

Introduces an environment variable INTERACTIVE_TESTING for ignoring tests which are not intended for use in regular test runs.

Reviewed By: shapovalov

Differential Revision: D35964016

fbshipit-source-id: ab0f93aff66b6cfeca942b14466cf81f7feb2224
This commit is contained in:
Jeremy Reizenstein
2022-05-06 08:31:19 -07:00
committed by Facebook GitHub Bot
parent 44cb00e468
commit ec9580a1d4
6 changed files with 93 additions and 15 deletions

View File

@@ -15,6 +15,15 @@ import torch
from PIL import Image
def interactive_testing_requested() -> bool:
"""
Certain tests are only useful when run interactively, and so are not regularly run.
These are activated by this funciton returning True, which the user requests by
setting the environment variable `PYTORCH3D_INTERACTIVE_TESTING`.
"""
return os.environ.get("PYTORCH3D_INTERACTIVE_TESTING", False)
def get_tests_dir() -> Path:
"""
Returns Path for the directory containing this file.