Skip to content

Commit

Permalink
[POC] Base class for dataset tests (#3402)
Browse files Browse the repository at this point in the history
* add base class for datasets tests

* add better type hints

* add documentation to subclasses

* add utility functions to create files / folders of random images and videos

* fix imports

* remove class properties

* fix smoke test

* fix type hints

* fix random size generation

* add Caltech256 as example

* add utility function to create grid of combinations

* add CIFAR100? as example

* lint

* add missing import

* improve documentation

* create 1 frame videos by default

* remove obsolete check

* return path of files created with utility functions

* [test] close PIL file handles before deletion

* fix video folder creation

* generalize file handle closing

* fix lazy imports

* add test for transforms

* fix explanation comment

* lint

* force load opened PIL images

* lint

* copy default config to avoid inplace modification

* enable additional arg forwarding
  • Loading branch information
pmeier authored Feb 18, 2021
1 parent c1f85d3 commit 22c548b
Show file tree
Hide file tree
Showing 3 changed files with 784 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,11 @@ def int_dtypes():

def float_dtypes():
return torch.testing.floating_types()


@contextlib.contextmanager
def disable_console_output():
with contextlib.ExitStack() as stack, open(os.devnull, "w") as devnull:
stack.enter_context(contextlib.redirect_stdout(devnull))
stack.enter_context(contextlib.redirect_stderr(devnull))
yield
Loading

0 comments on commit 22c548b

Please sign in to comment.