diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2020-12-27 21:35:55 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2020-12-27 21:35:55 +0800 |
commit | ff04b0eb6f1e632d4487a04f6e5b4d8398accb16 (patch) | |
tree | cdf8d3bec475946ea472baf433879cf78592e7de /test/dataset.py | |
parent | 2d957eb8e3f739cff055b10983c8e1aa77b8fb04 (diff) |
Try some unit tests on CASIA-B dataset
Diffstat (limited to 'test/dataset.py')
-rw-r--r-- | test/dataset.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/dataset.py b/test/dataset.py new file mode 100644 index 0000000..bfb8563 --- /dev/null +++ b/test/dataset.py @@ -0,0 +1,24 @@ +from utils.dataset import CASIAB, ClipConditions, ClipViews + +CASIAB_ROOT_DIR = '../data/CASIA-B-MRCNN/SEG' + + +def test_casiab(): + casiab = CASIAB(CASIAB_ROOT_DIR, discard_threshold=0) + assert len(casiab) == 74 * 10 * 11 + + +def test_casiab_nm(): + nm_selector = {'conditions': ClipConditions({r'nm-0\d'})} + casiab_nm = CASIAB(CASIAB_ROOT_DIR, selector=nm_selector, + discard_threshold=0) + assert len(casiab_nm) == 74 * 6 * 11 + + +def test_casiab_nm_bg_90(): + nm_bg_90_selector = {'conditions': ClipConditions({r'nm-0\d', r'bg-0\d'}), + 'views': ClipViews({'090'})} + casiab_nm_bg_90 = CASIAB(CASIAB_ROOT_DIR, + selector=nm_bg_90_selector, + discard_threshold=0) + assert len(casiab_nm_bg_90) == 74 * (6 + 2) * 1 |