Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify video_domain_adapter #292

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7ccd345
update .gitignore
xianyuanliu Jan 20, 2022
d955f73
update .gitignore
xianyuanliu Jan 20, 2022
1cecdf2
change root dir
xianyuanliu Jan 22, 2022
f9d0577
add EPIC100DatasetAccess
xianyuanliu Jan 22, 2022
046ef98
change transform_kind to transform
xianyuanliu Jan 22, 2022
77f1b0f
add NUM_SEGMENTS
xianyuanliu Jan 22, 2022
8a8581b
add INPUT_TYPE
xianyuanliu Jan 22, 2022
23b0e8e
add functions in VideoDatasetAccess for feature vector input
xianyuanliu Jan 22, 2022
f993f8d
add get_class_type
xianyuanliu Jan 22, 2022
60951d4
add CLASS_TYPE
xianyuanliu Jan 22, 2022
76f3e72
change num_classes to dict_num_classes
xianyuanliu Jan 22, 2022
feaf72a
update ClassNetVideo for dual-class task
xianyuanliu Jan 22, 2022
f5bc2b7
update test
xianyuanliu Jan 22, 2022
63c5be9
Merge branch 'main' into add_feature_vector_dataloader
xianyuanliu Jan 22, 2022
f89d8fc
change output folder to tb_logs
xianyuanliu Jan 22, 2022
b845a88
add get_class_type test
xianyuanliu Jan 22, 2022
ef74b72
update test_video_access
xianyuanliu Jan 22, 2022
b43802c
update config
xianyuanliu Jan 22, 2022
ba6f5c5
test bug fixes
xianyuanliu Jan 23, 2022
bdf9cbb
add VideoFeatureRecord in Videos.py & improve doc
xianyuanliu Jan 23, 2022
3ea4678
add epic100 test & bug fixes
xianyuanliu Jan 23, 2022
1540051
test bug fixes
xianyuanliu Jan 23, 2022
de0e6cd
test bug fixes
xianyuanliu Jan 23, 2022
cf1638b
add BaseAdaptTrainerVideo
xianyuanliu Jan 23, 2022
a2b3ce8
bug fixes
xianyuanliu Jan 23, 2022
4470413
add CLASS_TYPE
xianyuanliu Jan 23, 2022
37aeaac
add conditional function for class type
xianyuanliu Jan 23, 2022
a95a185
rename to num_classes
xianyuanliu Feb 7, 2022
ab23896
change root dir
xianyuanliu Feb 7, 2022
40861fc
Update doc
xianyuanliu Feb 7, 2022
dc4b990
Merge branch 'add_feature_vector_dataloader' into simplify_video_doma…
xianyuanliu Feb 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add get_class_type test
  • Loading branch information
xianyuanliu committed Jan 22, 2022
commit b845a880903a6ba5010b82ce6213e72ad5b8cd36
29 changes: 28 additions & 1 deletion tests/loaddata/test_video_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from kale.loaddata.dataset_access import get_class_subset
from kale.loaddata.multi_domain import DomainsDatasetBase
from kale.loaddata.video_access import get_image_modality, VideoDataset, VideoDatasetAccess
from kale.loaddata.video_access import get_image_modality, VideoDataset, VideoDatasetAccess, get_class_type
from kale.loaddata.video_multi_domain import VideoMultiDomainDatasets
from kale.utils.download import download_file_by_url
from kale.utils.seed import set_seed
Expand All @@ -26,6 +26,7 @@
]
ALL = SOURCES + TARGETS
IMAGE_MODALITY = ["rgb", "flow", "joint"]
CLASS_TYPE = ["verb", "verb+noun"]
WEIGHT_TYPE = ["natural", "balanced", "preset0"]
# DATASIZE_TYPE = ["max", "source"]
DATASIZE_TYPE = ["max"]
Expand Down Expand Up @@ -55,6 +56,32 @@ def test_get_image_modality(image_modality):
assert isinstance(rgb, bool)
assert isinstance(flow, bool)

if image_modality == "rgb":
assert rgb
assert not flow
elif image_modality == "flow":
assert not rgb
assert flow
elif image_modality == "joint":
assert rgb
assert flow


@pytest.mark.parametrize("class_type", CLASS_TYPE)
def test_get_class_type(class_type):
verb, noun = get_class_type(class_type)

assert isinstance(verb, bool)
assert isinstance(noun, bool)

if class_type == "verb":
assert verb
assert not noun

elif class_type == "verb+noun":
assert verb
assert noun


@pytest.mark.parametrize("source_cfg", SOURCES)
@pytest.mark.parametrize("target_cfg", TARGETS)
Expand Down