Commit
·
8aa674c
1
Parent(s):
1eaed2f
upload
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- OpenTAD/.gitignore +123 -0
- OpenTAD/LICENSE +201 -0
- OpenTAD/README.md +121 -0
- OpenTAD/configs/_base_/datasets/activitynet-1.3/e2e_resize_768_1x224x224.py +85 -0
- OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_pad.py +82 -0
- OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_resize.py +73 -0
- OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_resize_trunc.py +74 -0
- OpenTAD/configs/_base_/datasets/charades/features_i3d_pad.py +82 -0
- OpenTAD/configs/_base_/datasets/charades/features_vgg_rgb_pad.py +82 -0
- OpenTAD/configs/_base_/datasets/ego4d_mq/e2e_train_trunc_test_sw.py +101 -0
- OpenTAD/configs/_base_/datasets/ego4d_mq/features_internvideo_train_trunc_test_sw.py +82 -0
- OpenTAD/configs/_base_/datasets/ego4d_mq/features_slowfast_trunc.py +77 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/e2e_noun_train_trunc_test_sw.py +104 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/e2e_verb_train_trunc_test_sw.py +104 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_noun.py +80 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_noun_train_trunc_test_sw.py +85 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_verb.py +80 -0
- OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_verb_train_trunc_test_sw.py +85 -0
- OpenTAD/configs/_base_/datasets/fineaction/features_internvideo_pad.py +79 -0
- OpenTAD/configs/_base_/datasets/fineaction/features_internvideo_resize_trunc.py +73 -0
- OpenTAD/configs/_base_/datasets/hacs-1.1.1/features_slowfast_pad.py +79 -0
- OpenTAD/configs/_base_/datasets/hacs-1.1.1/features_slowfast_resize.py +73 -0
- OpenTAD/configs/_base_/datasets/multithumos/features_i3d_pad.py +77 -0
- OpenTAD/configs/_base_/datasets/multithumos/features_i3d_rgb_pad.py +80 -0
- OpenTAD/configs/_base_/datasets/thumos-14/e2e_sw_256x224x224.py +96 -0
- OpenTAD/configs/_base_/datasets/thumos-14/e2e_train_trunc_test_sw_256x224x224.py +100 -0
- OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_pad.py +77 -0
- OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_sw.py +85 -0
- OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_train_trunc_test_sw.py +82 -0
- OpenTAD/configs/_base_/datasets/thumos-14/features_tsn_sw.py +81 -0
- OpenTAD/configs/_base_/models/actionformer.py +43 -0
- OpenTAD/configs/_base_/models/afsd.py +30 -0
- OpenTAD/configs/_base_/models/bmn.py +41 -0
- OpenTAD/configs/_base_/models/etad.py +60 -0
- OpenTAD/configs/_base_/models/gtad.py +46 -0
- OpenTAD/configs/_base_/models/tadtr.py +73 -0
- OpenTAD/configs/_base_/models/temporalmaxer.py +44 -0
- OpenTAD/configs/_base_/models/tridet.py +52 -0
- OpenTAD/configs/_base_/models/tsi.py +39 -0
- OpenTAD/configs/_base_/models/videomambasuite.py +42 -0
- OpenTAD/configs/_base_/models/vsgn.py +43 -0
- OpenTAD/configs/actionformer/README.md +104 -0
- OpenTAD/configs/actionformer/anet_tsp.py +64 -0
- OpenTAD/configs/actionformer/charades_i3d_rgb.py +46 -0
- OpenTAD/configs/actionformer/ego4d_egovlp.py +16 -0
- OpenTAD/configs/actionformer/ego4d_internvideo.py +5 -0
- OpenTAD/configs/actionformer/ego4d_slowfast.py +58 -0
- OpenTAD/configs/actionformer/epic_kitchens_slowfast_noun.py +56 -0
- OpenTAD/configs/actionformer/epic_kitchens_slowfast_verb.py +55 -0
- OpenTAD/configs/actionformer/fineaction_videomae_h.py +63 -0
OpenTAD/.gitignore
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ignore folder
|
| 2 |
+
.vscode
|
| 3 |
+
.idea
|
| 4 |
+
dataset
|
| 5 |
+
/pretrained/
|
| 6 |
+
/logs/
|
| 7 |
+
/exps/
|
| 8 |
+
/trash/
|
| 9 |
+
|
| 10 |
+
# ignore annotation
|
| 11 |
+
!/data/
|
| 12 |
+
/data/*
|
| 13 |
+
!/data/*.sh
|
| 14 |
+
|
| 15 |
+
dcgm
|
| 16 |
+
log
|
| 17 |
+
*.err
|
| 18 |
+
*.out
|
| 19 |
+
/wandb/
|
| 20 |
+
build/
|
| 21 |
+
dist/
|
| 22 |
+
|
| 23 |
+
# Byte-compiled / optimized / DLL files
|
| 24 |
+
__pycache__/
|
| 25 |
+
*.py[cod]
|
| 26 |
+
*$py.class
|
| 27 |
+
|
| 28 |
+
# C extensions
|
| 29 |
+
*.so
|
| 30 |
+
|
| 31 |
+
# Distribution / packaging
|
| 32 |
+
.Python
|
| 33 |
+
build/
|
| 34 |
+
develop-eggs/
|
| 35 |
+
dist/
|
| 36 |
+
downloads/
|
| 37 |
+
eggs/
|
| 38 |
+
.eggs/
|
| 39 |
+
parts/
|
| 40 |
+
sdist/
|
| 41 |
+
wheels/
|
| 42 |
+
pip-wheel-metadata/
|
| 43 |
+
share/python-wheels/
|
| 44 |
+
*.egg-info/
|
| 45 |
+
.installed.cfg
|
| 46 |
+
*.egg
|
| 47 |
+
MANIFEST
|
| 48 |
+
|
| 49 |
+
# PyInstaller
|
| 50 |
+
# Usually these files are written by a python script from a template
|
| 51 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 52 |
+
*.manifest
|
| 53 |
+
*.spec
|
| 54 |
+
|
| 55 |
+
# Installer logs
|
| 56 |
+
pip-log.txt
|
| 57 |
+
pip-delete-this-directory.txt
|
| 58 |
+
|
| 59 |
+
# Unit test / coverage reports
|
| 60 |
+
htmlcov/
|
| 61 |
+
.tox/
|
| 62 |
+
.nox/
|
| 63 |
+
.coverage
|
| 64 |
+
.coverage.*
|
| 65 |
+
.cache
|
| 66 |
+
nosetests.xml
|
| 67 |
+
coverage.xml
|
| 68 |
+
*.cover
|
| 69 |
+
*.py,cover
|
| 70 |
+
.hypothesis/
|
| 71 |
+
.pytest_cache/
|
| 72 |
+
|
| 73 |
+
# Translations
|
| 74 |
+
*.mo
|
| 75 |
+
*.pot
|
| 76 |
+
|
| 77 |
+
# Django stuff:
|
| 78 |
+
*.log
|
| 79 |
+
local_settings.py
|
| 80 |
+
db.sqlite3
|
| 81 |
+
db.sqlite3-journal
|
| 82 |
+
|
| 83 |
+
# Flask stuff:
|
| 84 |
+
instance/
|
| 85 |
+
.webassets-cache
|
| 86 |
+
|
| 87 |
+
# Scrapy stuff:
|
| 88 |
+
.scrapy
|
| 89 |
+
|
| 90 |
+
# Sphinx documentation
|
| 91 |
+
docs/_build/
|
| 92 |
+
|
| 93 |
+
# PyBuilder
|
| 94 |
+
target/
|
| 95 |
+
|
| 96 |
+
# Jupyter Notebook
|
| 97 |
+
.ipynb_checkpoints
|
| 98 |
+
|
| 99 |
+
# IPython
|
| 100 |
+
profile_default/
|
| 101 |
+
ipython_config.py
|
| 102 |
+
|
| 103 |
+
# pyenv
|
| 104 |
+
.python-version
|
| 105 |
+
|
| 106 |
+
# pipenv
|
| 107 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 108 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 109 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 110 |
+
# install all needed dependencies.
|
| 111 |
+
#Pipfile.lock
|
| 112 |
+
|
| 113 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 114 |
+
__pypackages__/
|
| 115 |
+
|
| 116 |
+
# Environments
|
| 117 |
+
.env
|
| 118 |
+
.venv
|
| 119 |
+
env/
|
| 120 |
+
venv/
|
| 121 |
+
ENV/
|
| 122 |
+
env.bak/
|
| 123 |
+
venv.bak/
|
OpenTAD/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
OpenTAD/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenTAD: An Open-Source Temporal Action Detection Toolbox.
|
| 2 |
+
|
| 3 |
+
<p align="left">
|
| 4 |
+
<!-- <a href="https://arxiv.org/abs/xxx.xxx" alt="arXiv"> -->
|
| 5 |
+
<!-- <img src="https://img.shields.io/badge/arXiv-xxx.xxx-b31b1b.svg?style=flat" /></a> -->
|
| 6 |
+
<a href="https://github.com/sming256/opentad/blob/main/LICENSE" alt="license">
|
| 7 |
+
<img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" /></a>
|
| 8 |
+
<a href="https://github.com/sming256/OpenTAD/issues" alt="docs">
|
| 9 |
+
<img src="https://img.shields.io/github/issues-raw/sming256/OpenTAD?color=%23FF9600" /></a>
|
| 10 |
+
<a href="https://img.shields.io/github/stars/sming256/opentad" alt="arXiv">
|
| 11 |
+
<img src="https://img.shields.io/github/stars/sming256/opentad" /></a>
|
| 12 |
+
</p>
|
| 13 |
+
|
| 14 |
+
OpenTAD is an open-source temporal action detection (TAD) toolbox based on PyTorch.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
## 🥳 What's New
|
| 18 |
+
|
| 19 |
+
- A technical report of this library will be provided soon.
|
| 20 |
+
- 2024/03/28: The beta version v0.1.0 of OpenTAD is released. Any feedbacks and suggestions are welcome!
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
## 📖 Major Features
|
| 24 |
+
|
| 25 |
+
- **Support SoTA TAD methods with modular design.** We decompose the TAD pipeline into different components, and implement them in a modular way. This design makes it easy to implement new methods and reproduce existing methods.
|
| 26 |
+
- **Support multiple TAD datasets.** We support 8 TAD datasets, including ActivityNet-1.3, THUMOS-14, HACS, Ego4D-MQ, Epic-Kitchens-100, FineAction, Multi-THUMOS, Charades datasets.
|
| 27 |
+
- **Support feature-based training and end-to-end training.** The feature-based training can easily be extended to end-to-end training with raw video input, and the video backbone can be easily replaced.
|
| 28 |
+
- **Release various pre-extracted features.** We release the feature extraction code, as well as many pre-extracted features on each dataset.
|
| 29 |
+
|
| 30 |
+
## 🌟 Model Zoo
|
| 31 |
+
|
| 32 |
+
<table align="center">
|
| 33 |
+
<tbody>
|
| 34 |
+
<tr align="center" valign="bottom">
|
| 35 |
+
<td>
|
| 36 |
+
<b>One Stage</b>
|
| 37 |
+
</td>
|
| 38 |
+
<td>
|
| 39 |
+
<b>Two Stage</b>
|
| 40 |
+
</td>
|
| 41 |
+
<td>
|
| 42 |
+
<b>DETR</b>
|
| 43 |
+
</td>
|
| 44 |
+
<td>
|
| 45 |
+
<b>End-to-End Training</b>
|
| 46 |
+
</td>
|
| 47 |
+
</tr>
|
| 48 |
+
<tr valign="top">
|
| 49 |
+
<td>
|
| 50 |
+
<ul>
|
| 51 |
+
<li><a href="configs/actionformer">ActionFormer (ECCV'22)</a></li>
|
| 52 |
+
<li><a href="configs/tridet">TriDet (CVPR'23)</a></li>
|
| 53 |
+
<li><a href="configs/temporalmaxer">TemporalMaxer (arXiv'23)</a></li>
|
| 54 |
+
<li><a href="configs/videomambasuite">VideoMambaSuite (arXiv'24)</a></li>
|
| 55 |
+
</ul>
|
| 56 |
+
</td>
|
| 57 |
+
<td>
|
| 58 |
+
<ul>
|
| 59 |
+
<li><a href="configs/bmn">BMN (ICCV'19)</a></li>
|
| 60 |
+
<li><a href="configs/gtad">GTAD (CVPR'20)</a></li>
|
| 61 |
+
<li><a href="configs/tsi">TSI (ACCV'20)</a></li>
|
| 62 |
+
<li><a href="configs/vsgn">VSGN (ICCV'21)</a></li>
|
| 63 |
+
</ul>
|
| 64 |
+
</td>
|
| 65 |
+
<td>
|
| 66 |
+
<ul>
|
| 67 |
+
<li><a href="configs/tadtr">TadTR (TIP'22)</a></li>
|
| 68 |
+
</ul>
|
| 69 |
+
</td>
|
| 70 |
+
<td>
|
| 71 |
+
<ul>
|
| 72 |
+
<li><a href="configs/afsd">AFSD (CVPR'21)</a></li>
|
| 73 |
+
<li><a href="configs/tadtr">E2E-TAD (CVPR'22)</a></li>
|
| 74 |
+
<li><a href="configs/etad">ETAD (CVPRW'23)</a></li>
|
| 75 |
+
<li><a href="configs/re2tal">Re2TAL (CVPR'23)</a></li>
|
| 76 |
+
<li><a href="configs/adatad">AdaTAD (CVPR'24)</a></li>
|
| 77 |
+
</ul>
|
| 78 |
+
</td>
|
| 79 |
+
</tr>
|
| 80 |
+
</td>
|
| 81 |
+
</tr>
|
| 82 |
+
</tbody>
|
| 83 |
+
</table>
|
| 84 |
+
|
| 85 |
+
The detailed configs, results, and pretrained models of each method can be found in above folders.
|
| 86 |
+
|
| 87 |
+
## 🛠️ Installation
|
| 88 |
+
|
| 89 |
+
Please refer to [install.md](docs/en/install.md) for installation and data preparation.
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
## 🚀 Usage
|
| 93 |
+
|
| 94 |
+
Please refer to [usage.md](docs/en/usage.md) for details of training and evaluation scripts.
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
## 📄 Updates
|
| 98 |
+
Please refer to [changelog.md](docs/en/changelog.md) for update details.
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
## 🤝 Roadmap
|
| 102 |
+
|
| 103 |
+
All the things that need to be done in the future is in [roadmap.md](docs/en/roadmap.md).
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
## 🖊️ Citation
|
| 107 |
+
|
| 108 |
+
**[Acknowledgement]** This repo is inspired by [OpenMMLab](https://github.com/open-mmlab) project, and we give our thanks to their contributors.
|
| 109 |
+
|
| 110 |
+
If you think this repo is helpful, please cite us:
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@misc{2024opentad,
|
| 114 |
+
title={OpenTAD: An Open-Source Toolbox for Temporal Action Detection},
|
| 115 |
+
author={Shuming Liu, Chen Zhao, Fatimah Zohra, Mattia Soldan, Carlos Hinojosa, Alejandro Pardo, Anthony Cioppa, Lama Alssum, Mengmeng Xu, Merey Ramazanova, Juan León Alcázar, Silvio Giancola, Bernard Ghanem},
|
| 116 |
+
howpublished = {\url{https://github.com/sming256/opentad}},
|
| 117 |
+
year={2024}
|
| 118 |
+
}
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
If you have any questions, please contact: `shuming.liu@kaust.edu.sa`.
|
OpenTAD/configs/_base_/datasets/activitynet-1.3/e2e_resize_768_1x224x224.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetResizeDataset"
|
| 2 |
+
annotation_path = "data/activitynet-1.3/annotations/activity_net.v1-3.min.json"
|
| 3 |
+
class_map = "data/activitynet-1.3/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/activitynet-1.3/raw_data/Anet_videos_15fps_short256"
|
| 5 |
+
block_list = "data/activitynet-1.3/raw_data/Anet_videos_15fps_short256/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
resize_length = 768
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
resize_length=resize_length,
|
| 19 |
+
class_agnostic=True,
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="PrepareVideoInfo", format="mp4", prefix="v_"),
|
| 22 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 23 |
+
dict(type="LoadFrames", num_clips=1, method="resize"),
|
| 24 |
+
dict(type="mmaction.DecordDecode"),
|
| 25 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 26 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 27 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 28 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 29 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 30 |
+
],
|
| 31 |
+
),
|
| 32 |
+
val=dict(
|
| 33 |
+
type=dataset_type,
|
| 34 |
+
ann_file=annotation_path,
|
| 35 |
+
subset_name="validation",
|
| 36 |
+
block_list=block_list,
|
| 37 |
+
class_map=class_map,
|
| 38 |
+
data_path=data_path,
|
| 39 |
+
filter_gt=True,
|
| 40 |
+
resize_length=resize_length,
|
| 41 |
+
class_agnostic=True,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="PrepareVideoInfo", format="mp4", prefix="v_"),
|
| 44 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 45 |
+
dict(type="LoadFrames", num_clips=1, method="resize"),
|
| 46 |
+
dict(type="mmaction.DecordDecode"),
|
| 47 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 48 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 49 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 50 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 51 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 52 |
+
],
|
| 53 |
+
),
|
| 54 |
+
test=dict(
|
| 55 |
+
type=dataset_type,
|
| 56 |
+
ann_file=annotation_path,
|
| 57 |
+
subset_name="validation",
|
| 58 |
+
block_list=block_list,
|
| 59 |
+
class_map=class_map,
|
| 60 |
+
data_path=data_path,
|
| 61 |
+
filter_gt=False,
|
| 62 |
+
test_mode=True,
|
| 63 |
+
resize_length=resize_length,
|
| 64 |
+
class_agnostic=True,
|
| 65 |
+
pipeline=[
|
| 66 |
+
dict(type="PrepareVideoInfo", format="mp4", prefix="v_"),
|
| 67 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 68 |
+
dict(type="LoadFrames", num_clips=1, method="resize"),
|
| 69 |
+
dict(type="mmaction.DecordDecode"),
|
| 70 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 71 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 72 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 73 |
+
dict(type="ConvertToTensor", keys=["imgs"]),
|
| 74 |
+
dict(type="Collect", inputs="imgs", keys=["masks"]),
|
| 75 |
+
],
|
| 76 |
+
),
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
evaluation = dict(
|
| 80 |
+
type="mAP",
|
| 81 |
+
subset="validation",
|
| 82 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 83 |
+
ground_truth_filename=annotation_path,
|
| 84 |
+
blocked_videos="data/activitynet-1.3/annotations/blocked.json",
|
| 85 |
+
)
|
OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_pad.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetPaddingDataset"
|
| 2 |
+
annotation_path = "data/activitynet-1.3/annotations/activity_net.v1-3.min.json"
|
| 3 |
+
class_map = "data/activitynet-1.3/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/activitynet-1.3/features/anet_tsp_npy_unresize/"
|
| 5 |
+
block_list = "data/activitynet-1.3/features/anet_tsp_npy_unresize/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
pad_len = 768
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
feature_stride=16,
|
| 19 |
+
sample_stride=1, # 1x16=16
|
| 20 |
+
offset_frames=8,
|
| 21 |
+
fps=15,
|
| 22 |
+
class_agnostic=True,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 25 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=pad_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="validation",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=True,
|
| 39 |
+
feature_stride=16,
|
| 40 |
+
sample_stride=1, # 1x16=16
|
| 41 |
+
offset_frames=8,
|
| 42 |
+
fps=15,
|
| 43 |
+
class_agnostic=True,
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 46 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 47 |
+
dict(type="Padding", length=pad_len),
|
| 48 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 49 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 50 |
+
],
|
| 51 |
+
),
|
| 52 |
+
test=dict(
|
| 53 |
+
type=dataset_type,
|
| 54 |
+
ann_file=annotation_path,
|
| 55 |
+
subset_name="validation",
|
| 56 |
+
block_list=block_list,
|
| 57 |
+
class_map=class_map,
|
| 58 |
+
data_path=data_path,
|
| 59 |
+
filter_gt=False,
|
| 60 |
+
test_mode=True,
|
| 61 |
+
feature_stride=16,
|
| 62 |
+
sample_stride=1, # 1x16=16
|
| 63 |
+
offset_frames=8,
|
| 64 |
+
fps=15,
|
| 65 |
+
class_agnostic=True,
|
| 66 |
+
pipeline=[
|
| 67 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 68 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 69 |
+
dict(type="Padding", length=pad_len),
|
| 70 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 71 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 72 |
+
],
|
| 73 |
+
),
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
evaluation = dict(
|
| 77 |
+
type="mAP",
|
| 78 |
+
subset="validation",
|
| 79 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 80 |
+
ground_truth_filename=annotation_path,
|
| 81 |
+
blocked_videos="data/activitynet-1.3/annotations/blocked.json",
|
| 82 |
+
)
|
OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_resize.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetResizeDataset"
|
| 2 |
+
annotation_path = "data/activitynet-1.3/annotations/activity_net.v1-3.min.json"
|
| 3 |
+
class_map = "data/activitynet-1.3/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/activitynet-1.3/features/anet_tsp_npy_unresize/"
|
| 5 |
+
block_list = "data/activitynet-1.3/features/anet_tsp_npy_unresize/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
resize_length = 128
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
resize_length=resize_length,
|
| 19 |
+
class_agnostic=True,
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 22 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 23 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 24 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 25 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 26 |
+
],
|
| 27 |
+
),
|
| 28 |
+
val=dict(
|
| 29 |
+
type=dataset_type,
|
| 30 |
+
ann_file=annotation_path,
|
| 31 |
+
subset_name="validation",
|
| 32 |
+
block_list=block_list,
|
| 33 |
+
class_map=class_map,
|
| 34 |
+
data_path=data_path,
|
| 35 |
+
filter_gt=True,
|
| 36 |
+
resize_length=resize_length,
|
| 37 |
+
class_agnostic=True,
|
| 38 |
+
pipeline=[
|
| 39 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 40 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 41 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 42 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 43 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 44 |
+
],
|
| 45 |
+
),
|
| 46 |
+
test=dict(
|
| 47 |
+
type=dataset_type,
|
| 48 |
+
ann_file=annotation_path,
|
| 49 |
+
subset_name="validation",
|
| 50 |
+
block_list=block_list,
|
| 51 |
+
class_map=class_map,
|
| 52 |
+
data_path=data_path,
|
| 53 |
+
filter_gt=False,
|
| 54 |
+
test_mode=True,
|
| 55 |
+
resize_length=resize_length,
|
| 56 |
+
class_agnostic=True,
|
| 57 |
+
pipeline=[
|
| 58 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 59 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 60 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 61 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 62 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 63 |
+
],
|
| 64 |
+
),
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
evaluation = dict(
|
| 68 |
+
type="mAP",
|
| 69 |
+
subset="validation",
|
| 70 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 71 |
+
ground_truth_filename=annotation_path,
|
| 72 |
+
blocked_videos="data/activitynet-1.3/annotations/blocked.json",
|
| 73 |
+
)
|
OpenTAD/configs/_base_/datasets/activitynet-1.3/features_tsp_resize_trunc.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetResizeDataset"
|
| 2 |
+
annotation_path = "data/activitynet-1.3/annotations/activity_net.v1-3.min.json"
|
| 3 |
+
class_map = "data/activitynet-1.3/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/activitynet-1.3/features/anet_tsp_npy_unresize/"
|
| 5 |
+
block_list = "data/activitynet-1.3/features/anet_tsp_npy_unresize/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
resize_length = 192
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
resize_length=resize_length,
|
| 19 |
+
class_agnostic=True,
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 22 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 23 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 24 |
+
dict(type="RandomTrunc", trunc_len=resize_length, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 25 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 26 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 27 |
+
],
|
| 28 |
+
),
|
| 29 |
+
val=dict(
|
| 30 |
+
type=dataset_type,
|
| 31 |
+
ann_file=annotation_path,
|
| 32 |
+
subset_name="validation",
|
| 33 |
+
block_list=block_list,
|
| 34 |
+
class_map=class_map,
|
| 35 |
+
data_path=data_path,
|
| 36 |
+
filter_gt=True,
|
| 37 |
+
resize_length=resize_length,
|
| 38 |
+
class_agnostic=True,
|
| 39 |
+
pipeline=[
|
| 40 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 41 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 42 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 43 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 44 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 45 |
+
],
|
| 46 |
+
),
|
| 47 |
+
test=dict(
|
| 48 |
+
type=dataset_type,
|
| 49 |
+
ann_file=annotation_path,
|
| 50 |
+
subset_name="testing", # validation
|
| 51 |
+
block_list=block_list,
|
| 52 |
+
class_map=class_map,
|
| 53 |
+
data_path=data_path,
|
| 54 |
+
filter_gt=False,
|
| 55 |
+
test_mode=True,
|
| 56 |
+
resize_length=resize_length,
|
| 57 |
+
class_agnostic=True,
|
| 58 |
+
pipeline=[
|
| 59 |
+
dict(type="LoadFeats", feat_format="npy", prefix="v_"),
|
| 60 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 61 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 62 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 63 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 64 |
+
],
|
| 65 |
+
),
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
evaluation = dict(
|
| 69 |
+
type="mAP",
|
| 70 |
+
subset="validation",
|
| 71 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 72 |
+
ground_truth_filename=annotation_path,
|
| 73 |
+
blocked_videos="data/activitynet-1.3/annotations/blocked.json",
|
| 74 |
+
)
|
OpenTAD/configs/_base_/datasets/charades/features_i3d_pad.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "EpicKitchensPaddingDataset"
|
| 2 |
+
annotation_path = "data/charades/annotations/charades.json"
|
| 3 |
+
class_map = "data/charades/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/charades/features/i3d_charades_finetuned_stride8/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 768
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# dataloader setting
|
| 19 |
+
fps=24,
|
| 20 |
+
feature_stride=8,
|
| 21 |
+
sample_stride=1,
|
| 22 |
+
offset_frames=0,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 25 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="testing",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=False,
|
| 39 |
+
# dataloader setting
|
| 40 |
+
fps=24,
|
| 41 |
+
feature_stride=8,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=0,
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 46 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 47 |
+
dict(type="Padding", length=trunc_len),
|
| 48 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 49 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 50 |
+
],
|
| 51 |
+
),
|
| 52 |
+
test=dict(
|
| 53 |
+
type=dataset_type,
|
| 54 |
+
ann_file=annotation_path,
|
| 55 |
+
subset_name="testing",
|
| 56 |
+
block_list=block_list,
|
| 57 |
+
class_map=class_map,
|
| 58 |
+
data_path=data_path,
|
| 59 |
+
filter_gt=False,
|
| 60 |
+
test_mode=True,
|
| 61 |
+
# dataloader setting
|
| 62 |
+
fps=24,
|
| 63 |
+
feature_stride=8,
|
| 64 |
+
sample_stride=1,
|
| 65 |
+
offset_frames=0,
|
| 66 |
+
pipeline=[
|
| 67 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 68 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 69 |
+
dict(type="Padding", length=trunc_len),
|
| 70 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 71 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 72 |
+
],
|
| 73 |
+
),
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
evaluation = dict(
|
| 78 |
+
type="mAP",
|
| 79 |
+
subset="testing",
|
| 80 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
|
| 81 |
+
ground_truth_filename=annotation_path,
|
| 82 |
+
)
|
OpenTAD/configs/_base_/datasets/charades/features_vgg_rgb_pad.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "EpicKitchensPaddingDataset"
|
| 2 |
+
annotation_path = "data/charades/annotations/charades.json"
|
| 3 |
+
class_map = "data/charades/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/charades/features/Charades_v1_features_vgg_rgb_stride4/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 1200
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# dataloader setting
|
| 19 |
+
fps=24,
|
| 20 |
+
feature_stride=4,
|
| 21 |
+
sample_stride=1,
|
| 22 |
+
offset_frames=0,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 25 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="testing",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=False,
|
| 39 |
+
# dataloader setting
|
| 40 |
+
fps=24,
|
| 41 |
+
feature_stride=4,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=0,
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 46 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 47 |
+
dict(type="Padding", length=trunc_len),
|
| 48 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 49 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 50 |
+
],
|
| 51 |
+
),
|
| 52 |
+
test=dict(
|
| 53 |
+
type=dataset_type,
|
| 54 |
+
ann_file=annotation_path,
|
| 55 |
+
subset_name="testing",
|
| 56 |
+
block_list=block_list,
|
| 57 |
+
class_map=class_map,
|
| 58 |
+
data_path=data_path,
|
| 59 |
+
filter_gt=False,
|
| 60 |
+
test_mode=True,
|
| 61 |
+
# dataloader setting
|
| 62 |
+
fps=24,
|
| 63 |
+
feature_stride=4,
|
| 64 |
+
sample_stride=1,
|
| 65 |
+
offset_frames=0,
|
| 66 |
+
pipeline=[
|
| 67 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 68 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 69 |
+
dict(type="Padding", length=trunc_len),
|
| 70 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 71 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 72 |
+
],
|
| 73 |
+
),
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
evaluation = dict(
|
| 78 |
+
type="mAP",
|
| 79 |
+
subset="testing",
|
| 80 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
|
| 81 |
+
ground_truth_filename=annotation_path,
|
| 82 |
+
)
|
OpenTAD/configs/_base_/datasets/ego4d_mq/e2e_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/ego4d/annotations/ego4d_v2_220429.json"
|
| 2 |
+
class_map = "data/ego4d/annotations/category_idx.txt"
|
| 3 |
+
data_path = "data/ego4d/raw_data/MQ_data/mq_videos_short320/"
|
| 4 |
+
block_list = None
|
| 5 |
+
|
| 6 |
+
window_size = 900
|
| 7 |
+
# size 900 is enough for all ego4d mq videos
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="Ego4DPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# dataloader setting
|
| 18 |
+
feature_stride=16,
|
| 19 |
+
sample_stride=1,
|
| 20 |
+
offset_frames=8, # after resizing, the offset is 8 frames
|
| 21 |
+
pipeline=[
|
| 22 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 23 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 24 |
+
dict(
|
| 25 |
+
type="LoadFrames",
|
| 26 |
+
num_clips=1,
|
| 27 |
+
method="random_trunc",
|
| 28 |
+
trunc_len=window_size,
|
| 29 |
+
trunc_thresh=0.3,
|
| 30 |
+
crop_ratio=[0.9, 1.0],
|
| 31 |
+
),
|
| 32 |
+
dict(type="mmaction.DecordDecode"),
|
| 33 |
+
dict(type="mmaction.Resize", scale=(-1, 256)),
|
| 34 |
+
dict(type="mmaction.RandomResizedCrop"),
|
| 35 |
+
dict(type="mmaction.Resize", scale=(224, 224), keep_ratio=False),
|
| 36 |
+
dict(type="mmaction.Flip", flip_ratio=0.5),
|
| 37 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 38 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 39 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 40 |
+
],
|
| 41 |
+
),
|
| 42 |
+
val=dict(
|
| 43 |
+
type="Ego4DSlidingDataset",
|
| 44 |
+
ann_file=annotation_path,
|
| 45 |
+
subset_name="val",
|
| 46 |
+
block_list=block_list,
|
| 47 |
+
class_map=class_map,
|
| 48 |
+
data_path=data_path,
|
| 49 |
+
filter_gt=False,
|
| 50 |
+
# dataloader setting
|
| 51 |
+
window_size=window_size,
|
| 52 |
+
feature_stride=16,
|
| 53 |
+
sample_stride=1,
|
| 54 |
+
offset_frames=8, # after resizing, the offset is 8 frames
|
| 55 |
+
window_overlap_ratio=0,
|
| 56 |
+
pipeline=[
|
| 57 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 58 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 59 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 60 |
+
dict(type="mmaction.DecordDecode"),
|
| 61 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 62 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 63 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 64 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 65 |
+
],
|
| 66 |
+
),
|
| 67 |
+
test=dict(
|
| 68 |
+
type="Ego4DSlidingDataset",
|
| 69 |
+
ann_file=annotation_path,
|
| 70 |
+
subset_name="val",
|
| 71 |
+
block_list=block_list,
|
| 72 |
+
class_map=class_map,
|
| 73 |
+
data_path=data_path,
|
| 74 |
+
filter_gt=False,
|
| 75 |
+
test_mode=True,
|
| 76 |
+
# dataloader setting
|
| 77 |
+
window_size=window_size,
|
| 78 |
+
feature_stride=16,
|
| 79 |
+
sample_stride=1,
|
| 80 |
+
offset_frames=8, # after resizing, the offset is 8 frames
|
| 81 |
+
window_overlap_ratio=0,
|
| 82 |
+
pipeline=[
|
| 83 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 84 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 85 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 86 |
+
dict(type="mmaction.DecordDecode"),
|
| 87 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 88 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 89 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 90 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 91 |
+
],
|
| 92 |
+
),
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
evaluation = dict(
|
| 97 |
+
type="mAP",
|
| 98 |
+
subset="val",
|
| 99 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 100 |
+
ground_truth_filename=annotation_path,
|
| 101 |
+
)
|
OpenTAD/configs/_base_/datasets/ego4d_mq/features_internvideo_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/ego4d/annotations/ego4d_v2_220429.json"
|
| 2 |
+
class_map = "data/ego4d/annotations/category_idx.txt"
|
| 3 |
+
data_path = "data/ego4d/features/zoo_project/videomae_large_internvideo_img224_stride16_len16_interval1_ego4d/"
|
| 4 |
+
block_list = None
|
| 5 |
+
|
| 6 |
+
window_size = 900
|
| 7 |
+
# size 900 is enough for all ego4d mq videos
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="Ego4DPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# dataloader setting
|
| 18 |
+
feature_stride=16,
|
| 19 |
+
sample_stride=1,
|
| 20 |
+
offset_frames=8,
|
| 21 |
+
pipeline=[
|
| 22 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 23 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 24 |
+
dict(type="RandomTrunc", trunc_len=window_size, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 25 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 26 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 27 |
+
],
|
| 28 |
+
),
|
| 29 |
+
val=dict(
|
| 30 |
+
type="Ego4DSlidingDataset",
|
| 31 |
+
ann_file=annotation_path,
|
| 32 |
+
subset_name="val",
|
| 33 |
+
block_list=block_list,
|
| 34 |
+
class_map=class_map,
|
| 35 |
+
data_path=data_path,
|
| 36 |
+
filter_gt=False,
|
| 37 |
+
# dataloader setting
|
| 38 |
+
window_size=window_size,
|
| 39 |
+
feature_stride=16,
|
| 40 |
+
sample_stride=1,
|
| 41 |
+
offset_frames=8,
|
| 42 |
+
window_overlap_ratio=0,
|
| 43 |
+
pipeline=[
|
| 44 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 45 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 46 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type="Ego4DSlidingDataset",
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="val",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# dataloader setting
|
| 61 |
+
window_size=window_size,
|
| 62 |
+
feature_stride=16,
|
| 63 |
+
sample_stride=1,
|
| 64 |
+
offset_frames=8,
|
| 65 |
+
window_overlap_ratio=0,
|
| 66 |
+
pipeline=[
|
| 67 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 68 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 69 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 70 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 71 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 72 |
+
],
|
| 73 |
+
),
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
evaluation = dict(
|
| 78 |
+
type="mAP",
|
| 79 |
+
subset="val",
|
| 80 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 81 |
+
ground_truth_filename=annotation_path,
|
| 82 |
+
)
|
OpenTAD/configs/_base_/datasets/ego4d_mq/features_slowfast_trunc.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "Ego4DPaddingDataset"
|
| 2 |
+
annotation_path = "data/ego4d/annotations/ego4d_v2_220429_feature.json"
|
| 3 |
+
class_map = "data/ego4d/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/ego4d/features/mq_slowfast/"
|
| 5 |
+
block_list = None
|
| 6 |
+
|
| 7 |
+
trunc_len = 1024
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="train",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=16,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=16,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="val",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# thumos dataloader setting
|
| 39 |
+
feature_stride=16,
|
| 40 |
+
sample_stride=1,
|
| 41 |
+
offset_frames=16,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 44 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 45 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 46 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 47 |
+
],
|
| 48 |
+
),
|
| 49 |
+
test=dict(
|
| 50 |
+
type=dataset_type,
|
| 51 |
+
ann_file=annotation_path,
|
| 52 |
+
subset_name="val",
|
| 53 |
+
block_list=block_list,
|
| 54 |
+
class_map=class_map,
|
| 55 |
+
data_path=data_path,
|
| 56 |
+
filter_gt=False,
|
| 57 |
+
test_mode=True,
|
| 58 |
+
# thumos dataloader setting
|
| 59 |
+
feature_stride=16,
|
| 60 |
+
sample_stride=1,
|
| 61 |
+
offset_frames=16,
|
| 62 |
+
pipeline=[
|
| 63 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 64 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 65 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 66 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 67 |
+
],
|
| 68 |
+
),
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
evaluation = dict(
|
| 73 |
+
type="mAP",
|
| 74 |
+
subset="val",
|
| 75 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 76 |
+
ground_truth_filename=annotation_path,
|
| 77 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/e2e_noun_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_noun.json"
|
| 2 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_noun.txt"
|
| 3 |
+
data_path = "data/epic_kitchens-100/raw_data/epic_kitchens_100_30fps_512x288/"
|
| 4 |
+
block_list = None
|
| 5 |
+
|
| 6 |
+
window_size = 768
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="EpicKitchensPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# epic-kitchens dataloader setting
|
| 18 |
+
fps=30,
|
| 19 |
+
feature_stride=16,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=8,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 24 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 25 |
+
dict(
|
| 26 |
+
type="LoadFrames",
|
| 27 |
+
num_clips=1,
|
| 28 |
+
method="random_trunc",
|
| 29 |
+
trunc_len=window_size,
|
| 30 |
+
trunc_thresh=0.3,
|
| 31 |
+
crop_ratio=[0.9, 1.0],
|
| 32 |
+
),
|
| 33 |
+
dict(type="mmaction.DecordDecode"),
|
| 34 |
+
dict(type="mmaction.Resize", scale=(-1, 256)),
|
| 35 |
+
dict(type="mmaction.RandomResizedCrop"),
|
| 36 |
+
dict(type="mmaction.Resize", scale=(224, 224), keep_ratio=False),
|
| 37 |
+
dict(type="mmaction.Flip", flip_ratio=0.5),
|
| 38 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 39 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 40 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 41 |
+
],
|
| 42 |
+
),
|
| 43 |
+
val=dict(
|
| 44 |
+
type="EpicKitchensSlidingDataset",
|
| 45 |
+
ann_file=annotation_path,
|
| 46 |
+
subset_name="val",
|
| 47 |
+
block_list=block_list,
|
| 48 |
+
class_map=class_map,
|
| 49 |
+
data_path=data_path,
|
| 50 |
+
filter_gt=False,
|
| 51 |
+
# dataloader setting
|
| 52 |
+
window_size=window_size,
|
| 53 |
+
fps=30,
|
| 54 |
+
feature_stride=16,
|
| 55 |
+
sample_stride=1,
|
| 56 |
+
offset_frames=8,
|
| 57 |
+
window_overlap_ratio=0.25,
|
| 58 |
+
pipeline=[
|
| 59 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 60 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 61 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 62 |
+
dict(type="mmaction.DecordDecode"),
|
| 63 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 64 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 65 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 66 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 67 |
+
],
|
| 68 |
+
),
|
| 69 |
+
test=dict(
|
| 70 |
+
type="EpicKitchensSlidingDataset",
|
| 71 |
+
ann_file=annotation_path,
|
| 72 |
+
subset_name="val",
|
| 73 |
+
block_list=block_list,
|
| 74 |
+
class_map=class_map,
|
| 75 |
+
data_path=data_path,
|
| 76 |
+
filter_gt=False,
|
| 77 |
+
test_mode=True,
|
| 78 |
+
# epic-kitchens dataloader setting
|
| 79 |
+
window_size=window_size,
|
| 80 |
+
fps=30,
|
| 81 |
+
feature_stride=16,
|
| 82 |
+
sample_stride=1,
|
| 83 |
+
offset_frames=8,
|
| 84 |
+
window_overlap_ratio=0.5,
|
| 85 |
+
pipeline=[
|
| 86 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 87 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 88 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 89 |
+
dict(type="mmaction.DecordDecode"),
|
| 90 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 91 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 92 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 93 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 94 |
+
],
|
| 95 |
+
),
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
evaluation = dict(
|
| 100 |
+
type="mAP",
|
| 101 |
+
subset="val",
|
| 102 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 103 |
+
ground_truth_filename=annotation_path,
|
| 104 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/e2e_verb_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_verb.json"
|
| 2 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_verb.txt"
|
| 3 |
+
data_path = "data/epic_kitchens-100/raw_data/epic_kitchens_100_30fps_512x288/"
|
| 4 |
+
block_list = None
|
| 5 |
+
|
| 6 |
+
window_size = 768
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="EpicKitchensPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# epic-kitchens dataloader setting
|
| 18 |
+
fps=30,
|
| 19 |
+
feature_stride=16,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=8,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 24 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 25 |
+
dict(
|
| 26 |
+
type="LoadFrames",
|
| 27 |
+
num_clips=1,
|
| 28 |
+
method="random_trunc",
|
| 29 |
+
trunc_len=window_size,
|
| 30 |
+
trunc_thresh=0.3,
|
| 31 |
+
crop_ratio=[0.9, 1.0],
|
| 32 |
+
),
|
| 33 |
+
dict(type="mmaction.DecordDecode"),
|
| 34 |
+
dict(type="mmaction.Resize", scale=(-1, 256)),
|
| 35 |
+
dict(type="mmaction.RandomResizedCrop"),
|
| 36 |
+
dict(type="mmaction.Resize", scale=(224, 224), keep_ratio=False),
|
| 37 |
+
dict(type="mmaction.Flip", flip_ratio=0.5),
|
| 38 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 39 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 40 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 41 |
+
],
|
| 42 |
+
),
|
| 43 |
+
val=dict(
|
| 44 |
+
type="EpicKitchensSlidingDataset",
|
| 45 |
+
ann_file=annotation_path,
|
| 46 |
+
subset_name="val",
|
| 47 |
+
block_list=block_list,
|
| 48 |
+
class_map=class_map,
|
| 49 |
+
data_path=data_path,
|
| 50 |
+
filter_gt=False,
|
| 51 |
+
# dataloader setting
|
| 52 |
+
window_size=window_size,
|
| 53 |
+
fps=30,
|
| 54 |
+
feature_stride=16,
|
| 55 |
+
sample_stride=1,
|
| 56 |
+
offset_frames=8,
|
| 57 |
+
window_overlap_ratio=0.25,
|
| 58 |
+
pipeline=[
|
| 59 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 60 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 61 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 62 |
+
dict(type="mmaction.DecordDecode"),
|
| 63 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 64 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 65 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 66 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 67 |
+
],
|
| 68 |
+
),
|
| 69 |
+
test=dict(
|
| 70 |
+
type="EpicKitchensSlidingDataset",
|
| 71 |
+
ann_file=annotation_path,
|
| 72 |
+
subset_name="val",
|
| 73 |
+
block_list=block_list,
|
| 74 |
+
class_map=class_map,
|
| 75 |
+
data_path=data_path,
|
| 76 |
+
filter_gt=False,
|
| 77 |
+
test_mode=True,
|
| 78 |
+
# epic-kitchens dataloader setting
|
| 79 |
+
window_size=window_size,
|
| 80 |
+
fps=30,
|
| 81 |
+
feature_stride=16,
|
| 82 |
+
sample_stride=1,
|
| 83 |
+
offset_frames=8,
|
| 84 |
+
window_overlap_ratio=0.5,
|
| 85 |
+
pipeline=[
|
| 86 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 87 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 88 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 89 |
+
dict(type="mmaction.DecordDecode"),
|
| 90 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 91 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 92 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 93 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 94 |
+
],
|
| 95 |
+
),
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
evaluation = dict(
|
| 100 |
+
type="mAP",
|
| 101 |
+
subset="val",
|
| 102 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 103 |
+
ground_truth_filename=annotation_path,
|
| 104 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_noun.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "EpicKitchensPaddingDataset"
|
| 2 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_noun.json"
|
| 3 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_noun.txt"
|
| 4 |
+
data_path = "data/epic_kitchens-100/features/slowfast_fps30_stride16_clip32/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="train",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
# epic-kitchens dataloader setting
|
| 19 |
+
fps=30,
|
| 20 |
+
feature_stride=16,
|
| 21 |
+
sample_stride=1,
|
| 22 |
+
offset_frames=16,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 25 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="val",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=False,
|
| 39 |
+
# epic-kitchens dataloader setting
|
| 40 |
+
fps=30,
|
| 41 |
+
feature_stride=16,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=16,
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 46 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type=dataset_type,
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="val",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# epic-kitchens dataloader setting
|
| 61 |
+
fps=30,
|
| 62 |
+
feature_stride=16,
|
| 63 |
+
sample_stride=1,
|
| 64 |
+
offset_frames=16,
|
| 65 |
+
pipeline=[
|
| 66 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 67 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 68 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 69 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 70 |
+
],
|
| 71 |
+
),
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
evaluation = dict(
|
| 76 |
+
type="mAP",
|
| 77 |
+
subset="val",
|
| 78 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 79 |
+
ground_truth_filename=annotation_path,
|
| 80 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_noun_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_noun.json"
|
| 2 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_noun.txt"
|
| 3 |
+
data_path = "data/epic_kitchens-100/features/slowfast_fps30_stride16_clip32/"
|
| 4 |
+
block_list = data_path + "missing_files.txt"
|
| 5 |
+
|
| 6 |
+
window_size = 2304
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="EpicKitchensPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# epic-kitchens dataloader setting
|
| 18 |
+
fps=30,
|
| 19 |
+
feature_stride=16,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=16,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=window_size, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type="EpicKitchensSlidingDataset",
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="val",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# dataloader setting
|
| 39 |
+
window_size=window_size,
|
| 40 |
+
fps=30,
|
| 41 |
+
feature_stride=16,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=16,
|
| 44 |
+
window_overlap_ratio=0.25,
|
| 45 |
+
pipeline=[
|
| 46 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 47 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 48 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 49 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 50 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 51 |
+
],
|
| 52 |
+
),
|
| 53 |
+
test=dict(
|
| 54 |
+
type="EpicKitchensSlidingDataset",
|
| 55 |
+
ann_file=annotation_path,
|
| 56 |
+
subset_name="val",
|
| 57 |
+
block_list=block_list,
|
| 58 |
+
class_map=class_map,
|
| 59 |
+
data_path=data_path,
|
| 60 |
+
filter_gt=False,
|
| 61 |
+
test_mode=True,
|
| 62 |
+
# epic-kitchens dataloader setting
|
| 63 |
+
window_size=window_size,
|
| 64 |
+
fps=30,
|
| 65 |
+
feature_stride=16,
|
| 66 |
+
sample_stride=1,
|
| 67 |
+
offset_frames=16,
|
| 68 |
+
window_overlap_ratio=0.5,
|
| 69 |
+
pipeline=[
|
| 70 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 71 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 72 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 73 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 74 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 75 |
+
],
|
| 76 |
+
),
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
evaluation = dict(
|
| 81 |
+
type="mAP",
|
| 82 |
+
subset="val",
|
| 83 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 84 |
+
ground_truth_filename=annotation_path,
|
| 85 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_verb.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "EpicKitchensPaddingDataset"
|
| 2 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_verb.json"
|
| 3 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_verb.txt"
|
| 4 |
+
data_path = "data/epic_kitchens-100/features/slowfast_fps30_stride16_clip32/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="train",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
# epic-kitchens dataloader setting
|
| 19 |
+
fps=30,
|
| 20 |
+
feature_stride=16,
|
| 21 |
+
sample_stride=1,
|
| 22 |
+
offset_frames=16,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 25 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="val",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=False,
|
| 39 |
+
# epic-kitchens dataloader setting
|
| 40 |
+
fps=30,
|
| 41 |
+
feature_stride=16,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=16,
|
| 44 |
+
pipeline=[
|
| 45 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 46 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type=dataset_type,
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="val",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# epic-kitchens dataloader setting
|
| 61 |
+
fps=30,
|
| 62 |
+
feature_stride=16,
|
| 63 |
+
sample_stride=1,
|
| 64 |
+
offset_frames=16,
|
| 65 |
+
pipeline=[
|
| 66 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 67 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 68 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 69 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 70 |
+
],
|
| 71 |
+
),
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
evaluation = dict(
|
| 76 |
+
type="mAP",
|
| 77 |
+
subset="val",
|
| 78 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 79 |
+
ground_truth_filename=annotation_path,
|
| 80 |
+
)
|
OpenTAD/configs/_base_/datasets/epic_kitchens-100/features_slowfast_verb_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/epic_kitchens-100/annotations/epic_kitchens_verb.json"
|
| 2 |
+
class_map = "data/epic_kitchens-100/annotations/category_idx_verb.txt"
|
| 3 |
+
data_path = "data/epic_kitchens-100/features/slowfast_fps30_stride16_clip32/"
|
| 4 |
+
block_list = data_path + "missing_files.txt"
|
| 5 |
+
|
| 6 |
+
window_size = 2304
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="EpicKitchensPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="train",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=True,
|
| 17 |
+
# epic-kitchens dataloader setting
|
| 18 |
+
fps=30,
|
| 19 |
+
feature_stride=16,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=16,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=window_size, trunc_thresh=0.3, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type="EpicKitchensSlidingDataset",
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="val",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# dataloader setting
|
| 39 |
+
window_size=window_size,
|
| 40 |
+
fps=30,
|
| 41 |
+
feature_stride=16,
|
| 42 |
+
sample_stride=1,
|
| 43 |
+
offset_frames=16,
|
| 44 |
+
window_overlap_ratio=0.25,
|
| 45 |
+
pipeline=[
|
| 46 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 47 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 48 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 49 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 50 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 51 |
+
],
|
| 52 |
+
),
|
| 53 |
+
test=dict(
|
| 54 |
+
type="EpicKitchensSlidingDataset",
|
| 55 |
+
ann_file=annotation_path,
|
| 56 |
+
subset_name="val",
|
| 57 |
+
block_list=block_list,
|
| 58 |
+
class_map=class_map,
|
| 59 |
+
data_path=data_path,
|
| 60 |
+
filter_gt=False,
|
| 61 |
+
test_mode=True,
|
| 62 |
+
# epic-kitchens dataloader setting
|
| 63 |
+
window_size=window_size,
|
| 64 |
+
fps=30,
|
| 65 |
+
feature_stride=16,
|
| 66 |
+
sample_stride=1,
|
| 67 |
+
offset_frames=16,
|
| 68 |
+
window_overlap_ratio=0.5,
|
| 69 |
+
pipeline=[
|
| 70 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 71 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 72 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 73 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 74 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 75 |
+
],
|
| 76 |
+
),
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
evaluation = dict(
|
| 81 |
+
type="mAP",
|
| 82 |
+
subset="val",
|
| 83 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5],
|
| 84 |
+
ground_truth_filename=annotation_path,
|
| 85 |
+
)
|
OpenTAD/configs/_base_/datasets/fineaction/features_internvideo_pad.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetPaddingDataset"
|
| 2 |
+
annotation_path = "data/fineaction/annotations/annotations_gt.json"
|
| 3 |
+
class_map = "data/fineaction/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/fineaction/features/intervideo_mae_huge_k700_stride16_len16_fineaction/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
pad_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
feature_stride=16,
|
| 19 |
+
sample_stride=1,
|
| 20 |
+
offset_frames=8,
|
| 21 |
+
fps=30,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=pad_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="validation",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=True,
|
| 38 |
+
feature_stride=16,
|
| 39 |
+
sample_stride=1,
|
| 40 |
+
offset_frames=8,
|
| 41 |
+
fps=30,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 44 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 45 |
+
dict(type="Padding", length=pad_len),
|
| 46 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 47 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 48 |
+
],
|
| 49 |
+
),
|
| 50 |
+
test=dict(
|
| 51 |
+
type=dataset_type,
|
| 52 |
+
ann_file=annotation_path,
|
| 53 |
+
subset_name="validation",
|
| 54 |
+
block_list=block_list,
|
| 55 |
+
class_map=class_map,
|
| 56 |
+
data_path=data_path,
|
| 57 |
+
filter_gt=False,
|
| 58 |
+
test_mode=True,
|
| 59 |
+
feature_stride=16,
|
| 60 |
+
sample_stride=1,
|
| 61 |
+
offset_frames=8,
|
| 62 |
+
fps=30,
|
| 63 |
+
pipeline=[
|
| 64 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 65 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 66 |
+
dict(type="Padding", length=pad_len),
|
| 67 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 68 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 69 |
+
],
|
| 70 |
+
),
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
evaluation = dict(
|
| 75 |
+
type="mAP",
|
| 76 |
+
subset="validation",
|
| 77 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 78 |
+
ground_truth_filename=annotation_path,
|
| 79 |
+
)
|
OpenTAD/configs/_base_/datasets/fineaction/features_internvideo_resize_trunc.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetResizeDataset"
|
| 2 |
+
annotation_path = "data/fineaction/annotations/annotations_gt.json"
|
| 3 |
+
class_map = "data/fineaction/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/fineaction/features/intervideo_mae_huge_k700_stride16_len16_fineaction/"
|
| 5 |
+
block_list = "data/fineaction/features/intervideo_mae_huge_k700_stride16_len16_fineaction/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
resize_length = 192
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
resize_length=resize_length,
|
| 19 |
+
class_agnostic=True,
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 22 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 23 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 24 |
+
dict(type="RandomTrunc", trunc_len=resize_length, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 25 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 26 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 27 |
+
],
|
| 28 |
+
),
|
| 29 |
+
val=dict(
|
| 30 |
+
type=dataset_type,
|
| 31 |
+
ann_file=annotation_path,
|
| 32 |
+
subset_name="validation",
|
| 33 |
+
block_list=block_list,
|
| 34 |
+
class_map=class_map,
|
| 35 |
+
data_path=data_path,
|
| 36 |
+
filter_gt=True,
|
| 37 |
+
resize_length=resize_length,
|
| 38 |
+
class_agnostic=True,
|
| 39 |
+
pipeline=[
|
| 40 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 41 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 42 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 43 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 44 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 45 |
+
],
|
| 46 |
+
),
|
| 47 |
+
test=dict(
|
| 48 |
+
type=dataset_type,
|
| 49 |
+
ann_file=annotation_path,
|
| 50 |
+
subset_name="validation",
|
| 51 |
+
block_list=block_list,
|
| 52 |
+
class_map=class_map,
|
| 53 |
+
data_path=data_path,
|
| 54 |
+
filter_gt=False,
|
| 55 |
+
test_mode=True,
|
| 56 |
+
resize_length=resize_length,
|
| 57 |
+
class_agnostic=True,
|
| 58 |
+
pipeline=[
|
| 59 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 60 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 61 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 62 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 63 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 64 |
+
],
|
| 65 |
+
),
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
evaluation = dict(
|
| 69 |
+
type="mAP",
|
| 70 |
+
subset="validation",
|
| 71 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 72 |
+
ground_truth_filename=annotation_path,
|
| 73 |
+
)
|
OpenTAD/configs/_base_/datasets/hacs-1.1.1/features_slowfast_pad.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetPaddingDataset"
|
| 2 |
+
annotation_path = "data/hacs-1.1.1/annotations/HACS_segments_v1.1.1.json"
|
| 3 |
+
class_map = "data/hacs-1.1.1/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/hacs-1.1.1/features/slowfast101_15fps_stride8_len32_hacs/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
pad_len = 960
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
feature_stride=8,
|
| 19 |
+
sample_stride=1, # 1x8=8
|
| 20 |
+
offset_frames=16,
|
| 21 |
+
fps=15,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=pad_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="validation",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
feature_stride=8,
|
| 39 |
+
sample_stride=1, # 1x8=8
|
| 40 |
+
offset_frames=16,
|
| 41 |
+
fps=15,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 44 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 45 |
+
dict(type="Padding", length=pad_len),
|
| 46 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 47 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 48 |
+
],
|
| 49 |
+
),
|
| 50 |
+
test=dict(
|
| 51 |
+
type=dataset_type,
|
| 52 |
+
ann_file=annotation_path,
|
| 53 |
+
subset_name="validation",
|
| 54 |
+
block_list=block_list,
|
| 55 |
+
class_map=class_map,
|
| 56 |
+
data_path=data_path,
|
| 57 |
+
filter_gt=False,
|
| 58 |
+
test_mode=True,
|
| 59 |
+
feature_stride=8,
|
| 60 |
+
sample_stride=1, # 1x8=8
|
| 61 |
+
offset_frames=16,
|
| 62 |
+
fps=15,
|
| 63 |
+
pipeline=[
|
| 64 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 65 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 66 |
+
dict(type="Padding", length=pad_len),
|
| 67 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 68 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 69 |
+
],
|
| 70 |
+
),
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
evaluation = dict(
|
| 75 |
+
type="mAP",
|
| 76 |
+
subset="validation",
|
| 77 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 78 |
+
ground_truth_filename=annotation_path,
|
| 79 |
+
)
|
OpenTAD/configs/_base_/datasets/hacs-1.1.1/features_slowfast_resize.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "AnetResizeDataset"
|
| 2 |
+
annotation_path = "data/hacs-1.1.1/annotations/HACS_segments_v1.1.1.json"
|
| 3 |
+
class_map = "data/hacs-1.1.1/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/hacs-1.1.1/features/slowfast101_15fps_stride8_len32_hacs/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
resize_length = 224
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=True,
|
| 18 |
+
resize_length=resize_length,
|
| 19 |
+
class_agnostic=True,
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 22 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 23 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 24 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 25 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 26 |
+
],
|
| 27 |
+
),
|
| 28 |
+
val=dict(
|
| 29 |
+
type=dataset_type,
|
| 30 |
+
ann_file=annotation_path,
|
| 31 |
+
subset_name="validation",
|
| 32 |
+
block_list=block_list,
|
| 33 |
+
class_map=class_map,
|
| 34 |
+
data_path=data_path,
|
| 35 |
+
filter_gt=False,
|
| 36 |
+
resize_length=resize_length,
|
| 37 |
+
class_agnostic=True,
|
| 38 |
+
pipeline=[
|
| 39 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 40 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 41 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 42 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 43 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 44 |
+
],
|
| 45 |
+
),
|
| 46 |
+
test=dict(
|
| 47 |
+
type=dataset_type,
|
| 48 |
+
ann_file=annotation_path,
|
| 49 |
+
subset_name="validation",
|
| 50 |
+
block_list=block_list,
|
| 51 |
+
class_map=class_map,
|
| 52 |
+
data_path=data_path,
|
| 53 |
+
filter_gt=False,
|
| 54 |
+
test_mode=True,
|
| 55 |
+
resize_length=resize_length,
|
| 56 |
+
class_agnostic=True,
|
| 57 |
+
pipeline=[
|
| 58 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 59 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 60 |
+
dict(type="ResizeFeat", tool="torchvision_align"),
|
| 61 |
+
dict(type="Rearrange", keys=["feats"], ops="t c-> c t"),
|
| 62 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 63 |
+
],
|
| 64 |
+
),
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
evaluation = dict(
|
| 69 |
+
type="mAP",
|
| 70 |
+
subset="validation",
|
| 71 |
+
tiou_thresholds=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
|
| 72 |
+
ground_truth_filename=annotation_path,
|
| 73 |
+
)
|
OpenTAD/configs/_base_/datasets/multithumos/features_i3d_pad.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosPaddingDataset"
|
| 2 |
+
annotation_path = "data/multithumos/annotations/multithumos_anno.json"
|
| 3 |
+
class_map = "data/multithumos/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/features/i3d_actionformer_stride4_thumos/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=4,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=8,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="validation",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# thumos dataloader setting
|
| 39 |
+
feature_stride=4,
|
| 40 |
+
sample_stride=1,
|
| 41 |
+
offset_frames=8,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 44 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 45 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 46 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 47 |
+
],
|
| 48 |
+
),
|
| 49 |
+
test=dict(
|
| 50 |
+
type=dataset_type,
|
| 51 |
+
ann_file=annotation_path,
|
| 52 |
+
subset_name="validation",
|
| 53 |
+
block_list=block_list,
|
| 54 |
+
class_map=class_map,
|
| 55 |
+
data_path=data_path,
|
| 56 |
+
filter_gt=False,
|
| 57 |
+
test_mode=True,
|
| 58 |
+
# thumos dataloader setting
|
| 59 |
+
feature_stride=4,
|
| 60 |
+
sample_stride=1,
|
| 61 |
+
offset_frames=8,
|
| 62 |
+
pipeline=[
|
| 63 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 64 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 65 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 66 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 67 |
+
],
|
| 68 |
+
),
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
evaluation = dict(
|
| 73 |
+
type="mAP",
|
| 74 |
+
subset="validation",
|
| 75 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
|
| 76 |
+
ground_truth_filename=annotation_path,
|
| 77 |
+
)
|
OpenTAD/configs/_base_/datasets/multithumos/features_i3d_rgb_pad.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosPaddingDataset"
|
| 2 |
+
annotation_path = "data/multithumos/annotations/multithumos_anno.json"
|
| 3 |
+
class_map = "data/multithumos/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/features/i3d_actionformer_stride4_thumos/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=4,
|
| 20 |
+
sample_stride=1,
|
| 21 |
+
offset_frames=8,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="ChannelReduction", in_channels=2048, index=[0, 1024]), # only use rgb features
|
| 26 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 27 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 28 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 29 |
+
],
|
| 30 |
+
),
|
| 31 |
+
val=dict(
|
| 32 |
+
type=dataset_type,
|
| 33 |
+
ann_file=annotation_path,
|
| 34 |
+
subset_name="validation",
|
| 35 |
+
block_list=block_list,
|
| 36 |
+
class_map=class_map,
|
| 37 |
+
data_path=data_path,
|
| 38 |
+
filter_gt=False,
|
| 39 |
+
# thumos dataloader setting
|
| 40 |
+
feature_stride=4,
|
| 41 |
+
sample_stride=1,
|
| 42 |
+
offset_frames=8,
|
| 43 |
+
pipeline=[
|
| 44 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 45 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 46 |
+
dict(type="ChannelReduction", in_channels=2048, index=[0, 1024]), # only use rgb features
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type=dataset_type,
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="validation",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# thumos dataloader setting
|
| 61 |
+
feature_stride=4,
|
| 62 |
+
sample_stride=1,
|
| 63 |
+
offset_frames=8,
|
| 64 |
+
pipeline=[
|
| 65 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 66 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 67 |
+
dict(type="ChannelReduction", in_channels=2048, index=[0, 1024]), # only use rgb features
|
| 68 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 69 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 70 |
+
],
|
| 71 |
+
),
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
evaluation = dict(
|
| 76 |
+
type="mAP",
|
| 77 |
+
subset="validation",
|
| 78 |
+
tiou_thresholds=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
|
| 79 |
+
ground_truth_filename=annotation_path,
|
| 80 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/e2e_sw_256x224x224.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosSlidingDataset"
|
| 2 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 3 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/raw_data/video"
|
| 5 |
+
block_list = None
|
| 6 |
+
|
| 7 |
+
window_size = 256
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=4,
|
| 20 |
+
sample_stride=1, # 1x4=4
|
| 21 |
+
window_size=window_size,
|
| 22 |
+
window_overlap_ratio=0.25,
|
| 23 |
+
pipeline=[
|
| 24 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 25 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 26 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 27 |
+
dict(type="mmaction.DecordDecode"),
|
| 28 |
+
dict(type="mmaction.Resize", scale=(-1, 256)),
|
| 29 |
+
dict(type="mmaction.RandomResizedCrop"),
|
| 30 |
+
dict(type="mmaction.Resize", scale=(224, 224), keep_ratio=False),
|
| 31 |
+
dict(type="mmaction.Flip", flip_ratio=0.5),
|
| 32 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 33 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 34 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 35 |
+
],
|
| 36 |
+
),
|
| 37 |
+
val=dict(
|
| 38 |
+
type=dataset_type,
|
| 39 |
+
ann_file=annotation_path,
|
| 40 |
+
subset_name="validation",
|
| 41 |
+
block_list=block_list,
|
| 42 |
+
class_map=class_map,
|
| 43 |
+
data_path=data_path,
|
| 44 |
+
filter_gt=False,
|
| 45 |
+
# thumos dataloader setting
|
| 46 |
+
feature_stride=4,
|
| 47 |
+
sample_stride=1, # 1x4=4
|
| 48 |
+
window_size=window_size,
|
| 49 |
+
window_overlap_ratio=0.25,
|
| 50 |
+
pipeline=[
|
| 51 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 52 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 53 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 54 |
+
dict(type="mmaction.DecordDecode"),
|
| 55 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 56 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 57 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 58 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 59 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 60 |
+
],
|
| 61 |
+
),
|
| 62 |
+
test=dict(
|
| 63 |
+
type=dataset_type,
|
| 64 |
+
ann_file=annotation_path,
|
| 65 |
+
subset_name="validation",
|
| 66 |
+
block_list=block_list,
|
| 67 |
+
class_map=class_map,
|
| 68 |
+
data_path=data_path,
|
| 69 |
+
filter_gt=False,
|
| 70 |
+
test_mode=True,
|
| 71 |
+
# thumos dataloader setting
|
| 72 |
+
feature_stride=4,
|
| 73 |
+
sample_stride=1, # 1x4=4
|
| 74 |
+
window_size=window_size,
|
| 75 |
+
window_overlap_ratio=0.5,
|
| 76 |
+
pipeline=[
|
| 77 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 78 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 79 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 80 |
+
dict(type="mmaction.DecordDecode"),
|
| 81 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 82 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 83 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 84 |
+
dict(type="ConvertToTensor", keys=["imgs"]),
|
| 85 |
+
dict(type="Collect", inputs="imgs", keys=["masks"]),
|
| 86 |
+
],
|
| 87 |
+
),
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
evaluation = dict(
|
| 92 |
+
type="mAP",
|
| 93 |
+
subset="validation",
|
| 94 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 95 |
+
ground_truth_filename=annotation_path,
|
| 96 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/e2e_train_trunc_test_sw_256x224x224.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 2 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 3 |
+
data_path = "data/thumos-14/raw_data/video"
|
| 4 |
+
block_list = None
|
| 5 |
+
|
| 6 |
+
window_size = 256
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="ThumosPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="training",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=False,
|
| 17 |
+
# thumos dataloader setting
|
| 18 |
+
feature_stride=4,
|
| 19 |
+
sample_stride=1, # 1x4=4
|
| 20 |
+
pipeline=[
|
| 21 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 22 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 23 |
+
dict(
|
| 24 |
+
type="LoadFrames",
|
| 25 |
+
num_clips=1,
|
| 26 |
+
method="random_trunc",
|
| 27 |
+
trunc_len=window_size,
|
| 28 |
+
trunc_thresh=0.5,
|
| 29 |
+
crop_ratio=[0.9, 1.0],
|
| 30 |
+
),
|
| 31 |
+
dict(type="mmaction.DecordDecode"),
|
| 32 |
+
dict(type="mmaction.Resize", scale=(-1, 256)),
|
| 33 |
+
dict(type="mmaction.RandomResizedCrop"),
|
| 34 |
+
dict(type="mmaction.Resize", scale=(224, 224), keep_ratio=False),
|
| 35 |
+
dict(type="mmaction.Flip", flip_ratio=0.5),
|
| 36 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 37 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 38 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 39 |
+
],
|
| 40 |
+
),
|
| 41 |
+
val=dict(
|
| 42 |
+
type="ThumosSlidingDataset",
|
| 43 |
+
ann_file=annotation_path,
|
| 44 |
+
subset_name="validation",
|
| 45 |
+
block_list=block_list,
|
| 46 |
+
class_map=class_map,
|
| 47 |
+
data_path=data_path,
|
| 48 |
+
filter_gt=False,
|
| 49 |
+
# thumos dataloader setting
|
| 50 |
+
feature_stride=4,
|
| 51 |
+
sample_stride=1, # 1x4=4
|
| 52 |
+
window_size=window_size,
|
| 53 |
+
window_overlap_ratio=0.25,
|
| 54 |
+
pipeline=[
|
| 55 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 56 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 57 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 58 |
+
dict(type="mmaction.DecordDecode"),
|
| 59 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 60 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 61 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 62 |
+
dict(type="ConvertToTensor", keys=["imgs", "gt_segments", "gt_labels"]),
|
| 63 |
+
dict(type="Collect", inputs="imgs", keys=["masks", "gt_segments", "gt_labels"]),
|
| 64 |
+
],
|
| 65 |
+
),
|
| 66 |
+
test=dict(
|
| 67 |
+
type="ThumosSlidingDataset",
|
| 68 |
+
ann_file=annotation_path,
|
| 69 |
+
subset_name="validation",
|
| 70 |
+
block_list=block_list,
|
| 71 |
+
class_map=class_map,
|
| 72 |
+
data_path=data_path,
|
| 73 |
+
filter_gt=False,
|
| 74 |
+
test_mode=True,
|
| 75 |
+
# thumos dataloader setting
|
| 76 |
+
feature_stride=4,
|
| 77 |
+
sample_stride=1, # 1x4=4
|
| 78 |
+
window_size=window_size,
|
| 79 |
+
window_overlap_ratio=0.5,
|
| 80 |
+
pipeline=[
|
| 81 |
+
dict(type="PrepareVideoInfo", format="mp4"),
|
| 82 |
+
dict(type="mmaction.DecordInit", num_threads=4),
|
| 83 |
+
dict(type="LoadFrames", num_clips=1, method="sliding_window"),
|
| 84 |
+
dict(type="mmaction.DecordDecode"),
|
| 85 |
+
dict(type="mmaction.Resize", scale=(-1, 224)),
|
| 86 |
+
dict(type="mmaction.CenterCrop", crop_size=224),
|
| 87 |
+
dict(type="mmaction.FormatShape", input_format="NCTHW"),
|
| 88 |
+
dict(type="ConvertToTensor", keys=["imgs"]),
|
| 89 |
+
dict(type="Collect", inputs="imgs", keys=["masks"]),
|
| 90 |
+
],
|
| 91 |
+
),
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
evaluation = dict(
|
| 96 |
+
type="mAP",
|
| 97 |
+
subset="validation",
|
| 98 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 99 |
+
ground_truth_filename=annotation_path,
|
| 100 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_pad.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosPaddingDataset"
|
| 2 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 3 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/features/i3d_actionformer_stride4_thumos/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
trunc_len = 2304
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=4,
|
| 20 |
+
sample_stride=1, # 1x4=4
|
| 21 |
+
offset_frames=8,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="RandomTrunc", trunc_len=trunc_len, trunc_thresh=0.5, crop_ratio=[0.9, 1.0]),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="validation",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# thumos dataloader setting
|
| 39 |
+
feature_stride=4,
|
| 40 |
+
sample_stride=1, # 1x4=4
|
| 41 |
+
offset_frames=8,
|
| 42 |
+
pipeline=[
|
| 43 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 44 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 45 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 46 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 47 |
+
],
|
| 48 |
+
),
|
| 49 |
+
test=dict(
|
| 50 |
+
type=dataset_type,
|
| 51 |
+
ann_file=annotation_path,
|
| 52 |
+
subset_name="validation",
|
| 53 |
+
block_list=block_list,
|
| 54 |
+
class_map=class_map,
|
| 55 |
+
data_path=data_path,
|
| 56 |
+
filter_gt=False,
|
| 57 |
+
test_mode=True,
|
| 58 |
+
# thumos dataloader setting
|
| 59 |
+
feature_stride=4,
|
| 60 |
+
sample_stride=1, # 1x4=4
|
| 61 |
+
offset_frames=8,
|
| 62 |
+
pipeline=[
|
| 63 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 64 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 65 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 66 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 67 |
+
],
|
| 68 |
+
),
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
evaluation = dict(
|
| 73 |
+
type="mAP",
|
| 74 |
+
subset="validation",
|
| 75 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 76 |
+
ground_truth_filename=annotation_path,
|
| 77 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_sw.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosSlidingDataset"
|
| 2 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 3 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/features/i3d_actionformer_stride4_thumos/"
|
| 5 |
+
block_list = data_path + "missing_files.txt"
|
| 6 |
+
|
| 7 |
+
window_size = 256
|
| 8 |
+
|
| 9 |
+
dataset = dict(
|
| 10 |
+
train=dict(
|
| 11 |
+
type=dataset_type,
|
| 12 |
+
ann_file=annotation_path,
|
| 13 |
+
subset_name="training",
|
| 14 |
+
block_list=block_list,
|
| 15 |
+
class_map=class_map,
|
| 16 |
+
data_path=data_path,
|
| 17 |
+
filter_gt=False,
|
| 18 |
+
# thumos dataloader setting
|
| 19 |
+
feature_stride=4,
|
| 20 |
+
sample_stride=1, # 1x4=4
|
| 21 |
+
window_size=window_size,
|
| 22 |
+
window_overlap_ratio=0.25,
|
| 23 |
+
offset_frames=8,
|
| 24 |
+
pipeline=[
|
| 25 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 26 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 27 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 28 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 29 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 30 |
+
],
|
| 31 |
+
),
|
| 32 |
+
val=dict(
|
| 33 |
+
type=dataset_type,
|
| 34 |
+
ann_file=annotation_path,
|
| 35 |
+
subset_name="validation",
|
| 36 |
+
block_list=block_list,
|
| 37 |
+
class_map=class_map,
|
| 38 |
+
data_path=data_path,
|
| 39 |
+
filter_gt=False,
|
| 40 |
+
# thumos dataloader setting
|
| 41 |
+
feature_stride=4,
|
| 42 |
+
sample_stride=1, # 1x4=4
|
| 43 |
+
window_size=window_size,
|
| 44 |
+
window_overlap_ratio=0.25,
|
| 45 |
+
offset_frames=8,
|
| 46 |
+
pipeline=[
|
| 47 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 48 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 49 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 50 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 51 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 52 |
+
],
|
| 53 |
+
),
|
| 54 |
+
test=dict(
|
| 55 |
+
type=dataset_type,
|
| 56 |
+
ann_file=annotation_path,
|
| 57 |
+
subset_name="validation",
|
| 58 |
+
block_list=block_list,
|
| 59 |
+
class_map=class_map,
|
| 60 |
+
data_path=data_path,
|
| 61 |
+
filter_gt=False,
|
| 62 |
+
test_mode=True,
|
| 63 |
+
# thumos dataloader setting
|
| 64 |
+
feature_stride=4,
|
| 65 |
+
sample_stride=1, # 1x4=4
|
| 66 |
+
window_size=window_size,
|
| 67 |
+
window_overlap_ratio=0.5,
|
| 68 |
+
offset_frames=8,
|
| 69 |
+
pipeline=[
|
| 70 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 71 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 72 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 73 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 74 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 75 |
+
],
|
| 76 |
+
),
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
evaluation = dict(
|
| 81 |
+
type="mAP",
|
| 82 |
+
subset="validation",
|
| 83 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 84 |
+
ground_truth_filename=annotation_path,
|
| 85 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/features_i3d_train_trunc_test_sw.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 2 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 3 |
+
data_path = "data/thumos-14/features/i3d_actionformer_stride4_thumos/"
|
| 4 |
+
block_list = data_path + "missing_files.txt"
|
| 5 |
+
|
| 6 |
+
window_size = 2304
|
| 7 |
+
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type="ThumosPaddingDataset",
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="training",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=False,
|
| 17 |
+
# thumos dataloader setting
|
| 18 |
+
feature_stride=4,
|
| 19 |
+
sample_stride=1, # 1x4=4
|
| 20 |
+
offset_frames=8,
|
| 21 |
+
pipeline=[
|
| 22 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 23 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 24 |
+
dict(type="RandomTrunc", trunc_len=window_size, trunc_thresh=0.75, crop_ratio=[0.9, 1.0]),
|
| 25 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 26 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 27 |
+
],
|
| 28 |
+
),
|
| 29 |
+
val=dict(
|
| 30 |
+
type="ThumosSlidingDataset",
|
| 31 |
+
ann_file=annotation_path,
|
| 32 |
+
subset_name="validation",
|
| 33 |
+
block_list=block_list,
|
| 34 |
+
class_map=class_map,
|
| 35 |
+
data_path=data_path,
|
| 36 |
+
filter_gt=False,
|
| 37 |
+
# thumos dataloader setting
|
| 38 |
+
feature_stride=4,
|
| 39 |
+
sample_stride=1, # 1x4=4
|
| 40 |
+
window_size=window_size,
|
| 41 |
+
offset_frames=8,
|
| 42 |
+
window_overlap_ratio=0.25,
|
| 43 |
+
pipeline=[
|
| 44 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 45 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 46 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type="ThumosSlidingDataset",
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="validation",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# thumos dataloader setting
|
| 61 |
+
feature_stride=4,
|
| 62 |
+
sample_stride=1, # 1x4=4
|
| 63 |
+
window_size=window_size,
|
| 64 |
+
offset_frames=8,
|
| 65 |
+
window_overlap_ratio=0.5,
|
| 66 |
+
pipeline=[
|
| 67 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 68 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 69 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 70 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 71 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 72 |
+
],
|
| 73 |
+
),
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
evaluation = dict(
|
| 78 |
+
type="mAP",
|
| 79 |
+
subset="validation",
|
| 80 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 81 |
+
ground_truth_filename=annotation_path,
|
| 82 |
+
)
|
OpenTAD/configs/_base_/datasets/thumos-14/features_tsn_sw.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_type = "ThumosSlidingDataset"
|
| 2 |
+
annotation_path = "data/thumos-14/annotations/thumos_14_anno.json"
|
| 3 |
+
class_map = "data/thumos-14/annotations/category_idx.txt"
|
| 4 |
+
data_path = "data/thumos-14/features/tsn_gtad_stride1_thumos"
|
| 5 |
+
block_list = "data/thumos-14/features/tsn_gtad_stride1_thumos/missing_files.txt"
|
| 6 |
+
|
| 7 |
+
window_size = 128
|
| 8 |
+
dataset = dict(
|
| 9 |
+
train=dict(
|
| 10 |
+
type=dataset_type,
|
| 11 |
+
ann_file=annotation_path,
|
| 12 |
+
subset_name="training",
|
| 13 |
+
block_list=block_list,
|
| 14 |
+
class_map=class_map,
|
| 15 |
+
data_path=data_path,
|
| 16 |
+
filter_gt=False,
|
| 17 |
+
# thumos dataloader setting
|
| 18 |
+
feature_stride=1,
|
| 19 |
+
sample_stride=5, # 1x4=4
|
| 20 |
+
window_size=window_size,
|
| 21 |
+
window_overlap_ratio=0.25,
|
| 22 |
+
pipeline=[
|
| 23 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 24 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 25 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 26 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 27 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 28 |
+
],
|
| 29 |
+
),
|
| 30 |
+
val=dict(
|
| 31 |
+
type=dataset_type,
|
| 32 |
+
ann_file=annotation_path,
|
| 33 |
+
subset_name="validation",
|
| 34 |
+
block_list=block_list,
|
| 35 |
+
class_map=class_map,
|
| 36 |
+
data_path=data_path,
|
| 37 |
+
filter_gt=False,
|
| 38 |
+
# thumos dataloader setting
|
| 39 |
+
feature_stride=1,
|
| 40 |
+
sample_stride=5, # 1x4=4
|
| 41 |
+
window_size=window_size,
|
| 42 |
+
window_overlap_ratio=0.25,
|
| 43 |
+
pipeline=[
|
| 44 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 45 |
+
dict(type="ConvertToTensor", keys=["feats", "gt_segments", "gt_labels"]),
|
| 46 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 47 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 48 |
+
dict(type="Collect", inputs="feats", keys=["masks", "gt_segments", "gt_labels"]),
|
| 49 |
+
],
|
| 50 |
+
),
|
| 51 |
+
test=dict(
|
| 52 |
+
type=dataset_type,
|
| 53 |
+
ann_file=annotation_path,
|
| 54 |
+
subset_name="validation",
|
| 55 |
+
block_list=block_list,
|
| 56 |
+
class_map=class_map,
|
| 57 |
+
data_path=data_path,
|
| 58 |
+
filter_gt=False,
|
| 59 |
+
test_mode=True,
|
| 60 |
+
# thumos dataloader setting
|
| 61 |
+
feature_stride=1,
|
| 62 |
+
sample_stride=5, # 1x4=4
|
| 63 |
+
window_size=window_size,
|
| 64 |
+
window_overlap_ratio=0.5,
|
| 65 |
+
pipeline=[
|
| 66 |
+
dict(type="LoadFeats", feat_format="npy"),
|
| 67 |
+
dict(type="ConvertToTensor", keys=["feats"]),
|
| 68 |
+
dict(type="SlidingWindowTrunc", with_mask=True),
|
| 69 |
+
dict(type="Rearrange", keys=["feats"], ops="t c -> c t"),
|
| 70 |
+
dict(type="Collect", inputs="feats", keys=["masks"]),
|
| 71 |
+
],
|
| 72 |
+
),
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
evaluation = dict(
|
| 77 |
+
type="mAP",
|
| 78 |
+
subset="validation",
|
| 79 |
+
tiou_thresholds=[0.3, 0.4, 0.5, 0.6, 0.7],
|
| 80 |
+
ground_truth_filename=annotation_path,
|
| 81 |
+
)
|
OpenTAD/configs/_base_/models/actionformer.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="ActionFormer",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="Conv1DTransformerProj",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=512,
|
| 7 |
+
arch=(2, 2, 5), # layers in embed / stem / branch
|
| 8 |
+
conv_cfg=dict(kernel_size=3, proj_pdrop=0.0),
|
| 9 |
+
norm_cfg=dict(type="LN"),
|
| 10 |
+
attn_cfg=dict(n_head=4, n_mha_win_size=19),
|
| 11 |
+
path_pdrop=0.1,
|
| 12 |
+
use_abs_pe=False,
|
| 13 |
+
max_seq_len=2304,
|
| 14 |
+
),
|
| 15 |
+
neck=dict(
|
| 16 |
+
type="FPNIdentity",
|
| 17 |
+
in_channels=512,
|
| 18 |
+
out_channels=512,
|
| 19 |
+
num_levels=6,
|
| 20 |
+
),
|
| 21 |
+
rpn_head=dict(
|
| 22 |
+
type="ActionFormerHead",
|
| 23 |
+
num_classes=20,
|
| 24 |
+
in_channels=512,
|
| 25 |
+
feat_channels=512,
|
| 26 |
+
num_convs=2,
|
| 27 |
+
cls_prior_prob=0.01,
|
| 28 |
+
prior_generator=dict(
|
| 29 |
+
type="PointGenerator",
|
| 30 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 31 |
+
regression_range=[(0, 4), (4, 8), (8, 16), (16, 32), (32, 64), (64, 10000)],
|
| 32 |
+
),
|
| 33 |
+
loss_normalizer=100,
|
| 34 |
+
loss_normalizer_momentum=0.9,
|
| 35 |
+
center_sample="radius",
|
| 36 |
+
center_sample_radius=1.5,
|
| 37 |
+
label_smoothing=0.0,
|
| 38 |
+
loss=dict(
|
| 39 |
+
cls_loss=dict(type="FocalLoss"),
|
| 40 |
+
reg_loss=dict(type="DIOULoss"),
|
| 41 |
+
),
|
| 42 |
+
),
|
| 43 |
+
)
|
OpenTAD/configs/_base_/models/afsd.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="AFSD",
|
| 3 |
+
neck=dict(
|
| 4 |
+
type="AFSDNeck",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=512,
|
| 7 |
+
frame_num=768, # 96*8
|
| 8 |
+
layer_num=6,
|
| 9 |
+
),
|
| 10 |
+
rpn_head=dict(
|
| 11 |
+
type="AFSDCoarseHead",
|
| 12 |
+
in_channels=512,
|
| 13 |
+
out_channels=512,
|
| 14 |
+
frame_num=768, # 96*8
|
| 15 |
+
fpn_strides=[4, 8, 16, 32, 64, 128],
|
| 16 |
+
num_classes=2,
|
| 17 |
+
layer_num=6,
|
| 18 |
+
feat_t=768 // 8,
|
| 19 |
+
),
|
| 20 |
+
roi_head=dict(
|
| 21 |
+
type="AFSDRefineHead",
|
| 22 |
+
in_channels=512,
|
| 23 |
+
num_classes=2,
|
| 24 |
+
# for loss
|
| 25 |
+
overlap_thresh=0.6,
|
| 26 |
+
loc_weight=1.0,
|
| 27 |
+
loc_bounded=True,
|
| 28 |
+
use_smooth_l1=True,
|
| 29 |
+
),
|
| 30 |
+
)
|
OpenTAD/configs/_base_/models/bmn.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="BMN",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="ConvSingleProj",
|
| 5 |
+
in_channels=400,
|
| 6 |
+
out_channels=256,
|
| 7 |
+
num_convs=2,
|
| 8 |
+
conv_cfg=dict(groups=4),
|
| 9 |
+
),
|
| 10 |
+
rpn_head=dict(
|
| 11 |
+
type="TemporalEvaluationHead", # tem
|
| 12 |
+
in_channels=256,
|
| 13 |
+
num_classes=2,
|
| 14 |
+
conv_cfg=dict(groups=4),
|
| 15 |
+
loss=dict(pos_thresh=0.5, gt_type=["startness", "endness"]),
|
| 16 |
+
),
|
| 17 |
+
roi_head=dict(
|
| 18 |
+
type="StandardProposalMapHead",
|
| 19 |
+
proposal_generator=dict(type="DenseProposalMap", tscale=128, dscale=128),
|
| 20 |
+
proposal_roi_extractor=dict(
|
| 21 |
+
type="BMNExtractor",
|
| 22 |
+
in_channels=256,
|
| 23 |
+
roi_channels=512,
|
| 24 |
+
out_channels=128,
|
| 25 |
+
tscale=128,
|
| 26 |
+
dscale=128,
|
| 27 |
+
prop_extend_ratio=0.5,
|
| 28 |
+
),
|
| 29 |
+
proposal_head=dict(
|
| 30 |
+
type="PEMHead", # FC_head
|
| 31 |
+
in_channels=128,
|
| 32 |
+
feat_channels=128,
|
| 33 |
+
num_convs=2,
|
| 34 |
+
num_classes=2,
|
| 35 |
+
loss=dict(
|
| 36 |
+
cls_loss=dict(type="BalancedBCELoss", pos_thresh=0.9),
|
| 37 |
+
reg_loss=dict(type="BalancedL2Loss", high_thresh=0.7, low_thresh=0.3, weight=5.0),
|
| 38 |
+
),
|
| 39 |
+
),
|
| 40 |
+
),
|
| 41 |
+
)
|
OpenTAD/configs/_base_/models/etad.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="ETAD",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="ConvSingleProj",
|
| 5 |
+
in_channels=400,
|
| 6 |
+
out_channels=256,
|
| 7 |
+
num_convs=1,
|
| 8 |
+
conv_cfg=dict(groups=4),
|
| 9 |
+
norm_cfg=dict(type="GN", num_groups=16),
|
| 10 |
+
),
|
| 11 |
+
neck=dict(
|
| 12 |
+
type="LSTMNeck",
|
| 13 |
+
in_channels=256,
|
| 14 |
+
out_channels=256,
|
| 15 |
+
conv_cfg=dict(groups=4),
|
| 16 |
+
norm_cfg=dict(type="GN", num_groups=16),
|
| 17 |
+
),
|
| 18 |
+
rpn_head=dict(
|
| 19 |
+
type="TemporalEvaluationHead", # tem
|
| 20 |
+
in_channels=256,
|
| 21 |
+
num_classes=2,
|
| 22 |
+
shared=True,
|
| 23 |
+
conv_cfg=dict(groups=4),
|
| 24 |
+
loss=dict(pos_thresh=0.5, gt_type=["startness", "endness"]),
|
| 25 |
+
),
|
| 26 |
+
roi_head=dict(
|
| 27 |
+
type="ETADRoIHead",
|
| 28 |
+
stages=dict(
|
| 29 |
+
number=3,
|
| 30 |
+
loss_weight=[1, 1, 1],
|
| 31 |
+
pos_iou_thresh=[0.7, 0.8, 0.9],
|
| 32 |
+
),
|
| 33 |
+
proposal_generator=dict(
|
| 34 |
+
type="ProposalMapSampling",
|
| 35 |
+
tscale=128,
|
| 36 |
+
dscale=128,
|
| 37 |
+
sampling_ratio=0.06,
|
| 38 |
+
strategy="random",
|
| 39 |
+
),
|
| 40 |
+
proposal_roi_extractor=dict(
|
| 41 |
+
type="ROIAlignExtractor",
|
| 42 |
+
roi_size=16,
|
| 43 |
+
extend_ratio=0.5,
|
| 44 |
+
base_stride=1,
|
| 45 |
+
),
|
| 46 |
+
proposal_head=dict(
|
| 47 |
+
type="ETADHead",
|
| 48 |
+
in_channels=256,
|
| 49 |
+
roi_size=16,
|
| 50 |
+
feat_channels=512,
|
| 51 |
+
fcs_num=3,
|
| 52 |
+
fcs_channels=128,
|
| 53 |
+
loss=dict(
|
| 54 |
+
cls_weight=1.0,
|
| 55 |
+
reg_weight=5.0,
|
| 56 |
+
boundary_weight=10.0,
|
| 57 |
+
),
|
| 58 |
+
),
|
| 59 |
+
),
|
| 60 |
+
)
|
OpenTAD/configs/_base_/models/gtad.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="GTAD",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="ConvSingleProj",
|
| 5 |
+
num_convs=1,
|
| 6 |
+
in_channels=400,
|
| 7 |
+
out_channels=256,
|
| 8 |
+
conv_cfg=dict(groups=4),
|
| 9 |
+
),
|
| 10 |
+
neck=dict(
|
| 11 |
+
type="GCNeXt",
|
| 12 |
+
in_channels=256,
|
| 13 |
+
out_channels=256,
|
| 14 |
+
k=3,
|
| 15 |
+
groups=32,
|
| 16 |
+
),
|
| 17 |
+
rpn_head=dict(
|
| 18 |
+
type="GCNextTemporalEvaluationHead",
|
| 19 |
+
in_channels=256,
|
| 20 |
+
num_classes=2,
|
| 21 |
+
loss=dict(pos_thresh=0.5, gt_type=["startness", "endness"]),
|
| 22 |
+
),
|
| 23 |
+
roi_head=dict(
|
| 24 |
+
type="StandardProposalMapHead",
|
| 25 |
+
proposal_generator=dict(type="DenseProposalMap", tscale=100, dscale=100),
|
| 26 |
+
proposal_roi_extractor=dict(
|
| 27 |
+
type="GTADExtractor",
|
| 28 |
+
in_channels=256,
|
| 29 |
+
out_channels=512,
|
| 30 |
+
tscale=100,
|
| 31 |
+
dscale=100,
|
| 32 |
+
),
|
| 33 |
+
proposal_head=dict(
|
| 34 |
+
type="PEMHead", # FC_head
|
| 35 |
+
in_channels=512,
|
| 36 |
+
feat_channels=128,
|
| 37 |
+
num_convs=3,
|
| 38 |
+
num_classes=2,
|
| 39 |
+
kernel_size=1,
|
| 40 |
+
loss=dict(
|
| 41 |
+
cls_loss=dict(type="BalancedBCELoss", pos_thresh=0.9),
|
| 42 |
+
reg_loss=dict(type="BalancedL2Loss", high_thresh=0.7, low_thresh=0.3, weight=5.0),
|
| 43 |
+
),
|
| 44 |
+
),
|
| 45 |
+
),
|
| 46 |
+
)
|
OpenTAD/configs/_base_/models/tadtr.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="TadTR", # Done
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="ConvSingleProj",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=256,
|
| 7 |
+
num_convs=1,
|
| 8 |
+
conv_cfg=dict(kernel_size=1, padding=0),
|
| 9 |
+
norm_cfg=dict(type="GN", num_groups=32),
|
| 10 |
+
act_cfg=None,
|
| 11 |
+
),
|
| 12 |
+
transformer=dict(
|
| 13 |
+
type="TadTRTransformer",
|
| 14 |
+
num_proposals=40,
|
| 15 |
+
num_classes=20,
|
| 16 |
+
with_act_reg=True,
|
| 17 |
+
roi_size=16,
|
| 18 |
+
roi_extend_ratio=0.25,
|
| 19 |
+
aux_loss=True,
|
| 20 |
+
position_embedding=dict(
|
| 21 |
+
type="PositionEmbeddingSine",
|
| 22 |
+
num_pos_feats=256,
|
| 23 |
+
temperature=10000,
|
| 24 |
+
offset=-0.5,
|
| 25 |
+
normalize=True,
|
| 26 |
+
),
|
| 27 |
+
encoder=dict(
|
| 28 |
+
type="DeformableDETREncoder",
|
| 29 |
+
embed_dim=256,
|
| 30 |
+
num_heads=8,
|
| 31 |
+
num_points=4,
|
| 32 |
+
attn_dropout=0.1,
|
| 33 |
+
ffn_dim=1024,
|
| 34 |
+
ffn_dropout=0.1,
|
| 35 |
+
num_layers=4,
|
| 36 |
+
num_feature_levels=1,
|
| 37 |
+
post_norm=False,
|
| 38 |
+
),
|
| 39 |
+
decoder=dict(
|
| 40 |
+
type="DeformableDETRDecoder",
|
| 41 |
+
embed_dim=256,
|
| 42 |
+
num_heads=8,
|
| 43 |
+
num_points=4,
|
| 44 |
+
attn_dropout=0.1,
|
| 45 |
+
ffn_dim=1024,
|
| 46 |
+
ffn_dropout=0.1,
|
| 47 |
+
num_layers=4,
|
| 48 |
+
num_feature_levels=1,
|
| 49 |
+
return_intermediate=True,
|
| 50 |
+
),
|
| 51 |
+
loss=dict(
|
| 52 |
+
type="TadTRSetCriterion",
|
| 53 |
+
num_classes=20,
|
| 54 |
+
matcher=dict(
|
| 55 |
+
type="HungarianMatcher",
|
| 56 |
+
cost_class=6.0,
|
| 57 |
+
cost_bbox=5.0,
|
| 58 |
+
cost_giou=2.0,
|
| 59 |
+
cost_class_type="focal_loss_cost", # ce_cost, focal_loss_cost
|
| 60 |
+
iou_type="iou",
|
| 61 |
+
use_multi_class=False,
|
| 62 |
+
),
|
| 63 |
+
loss_class_type="focal_loss", # ce_loss, focal_loss
|
| 64 |
+
weight_dict=dict(
|
| 65 |
+
loss_class=2.0,
|
| 66 |
+
loss_bbox=5.0,
|
| 67 |
+
loss_iou=2.0,
|
| 68 |
+
loss_actionness=4.0,
|
| 69 |
+
),
|
| 70 |
+
use_multi_class=False,
|
| 71 |
+
),
|
| 72 |
+
),
|
| 73 |
+
)
|
OpenTAD/configs/_base_/models/temporalmaxer.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="TemporalMaxer",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="TemporalMaxerProj",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=512,
|
| 7 |
+
arch=(2, 0, 5), # feature projection layers, downsampling layer
|
| 8 |
+
conv_cfg=dict(kernel_size=3),
|
| 9 |
+
norm_cfg=dict(type="LN"),
|
| 10 |
+
),
|
| 11 |
+
neck=dict(
|
| 12 |
+
type="FPNIdentity",
|
| 13 |
+
in_channels=512,
|
| 14 |
+
out_channels=512,
|
| 15 |
+
num_levels=6,
|
| 16 |
+
),
|
| 17 |
+
rpn_head=dict(
|
| 18 |
+
type="TemporalMaxerHead",
|
| 19 |
+
num_classes=20,
|
| 20 |
+
in_channels=512,
|
| 21 |
+
feat_channels=512,
|
| 22 |
+
num_convs=2,
|
| 23 |
+
cls_prior_prob=0.01,
|
| 24 |
+
prior_generator=dict(
|
| 25 |
+
type="PointGenerator",
|
| 26 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 27 |
+
regression_range=[(0, 4), (4, 8), (8, 16), (16, 32), (32, 64), (64, 10000)],
|
| 28 |
+
),
|
| 29 |
+
loss_normalizer=100,
|
| 30 |
+
loss_normalizer_momentum=0.9,
|
| 31 |
+
loss=dict(
|
| 32 |
+
cls_loss=dict(type="FocalLoss"),
|
| 33 |
+
reg_loss=dict(type="DIOULoss"),
|
| 34 |
+
),
|
| 35 |
+
assigner=dict(
|
| 36 |
+
type="AnchorFreeSimOTAAssigner",
|
| 37 |
+
iou_weight=2,
|
| 38 |
+
cls_weight=1.0,
|
| 39 |
+
center_radius=1.5,
|
| 40 |
+
keep_percent=1.0,
|
| 41 |
+
confuse_weight=0.0,
|
| 42 |
+
),
|
| 43 |
+
),
|
| 44 |
+
)
|
OpenTAD/configs/_base_/models/tridet.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="TriDet",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="TriDetProj",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=512,
|
| 7 |
+
sgp_mlp_dim=768,
|
| 8 |
+
arch=(2, 2, 5), # layers in embed / stem / branch
|
| 9 |
+
downsample_type="max",
|
| 10 |
+
sgp_win_size=[1, 1, 1, 1, 1, 1],
|
| 11 |
+
k=5,
|
| 12 |
+
init_conv_vars=0,
|
| 13 |
+
conv_cfg=dict(kernel_size=3),
|
| 14 |
+
norm_cfg=dict(type="LN"),
|
| 15 |
+
path_pdrop=0.1,
|
| 16 |
+
use_abs_pe=False,
|
| 17 |
+
max_seq_len=2304,
|
| 18 |
+
input_noise=0.0,
|
| 19 |
+
),
|
| 20 |
+
neck=dict(
|
| 21 |
+
type="FPNIdentity",
|
| 22 |
+
in_channels=512,
|
| 23 |
+
out_channels=512,
|
| 24 |
+
num_levels=6,
|
| 25 |
+
),
|
| 26 |
+
rpn_head=dict(
|
| 27 |
+
type="TriDetHead",
|
| 28 |
+
num_classes=20,
|
| 29 |
+
in_channels=512,
|
| 30 |
+
feat_channels=512,
|
| 31 |
+
num_convs=2,
|
| 32 |
+
cls_prior_prob=0.01,
|
| 33 |
+
prior_generator=dict(
|
| 34 |
+
type="PointGenerator",
|
| 35 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 36 |
+
regression_range=[(0, 4), (4, 8), (8, 16), (16, 32), (32, 64), (64, 10000)],
|
| 37 |
+
),
|
| 38 |
+
loss_normalizer=100,
|
| 39 |
+
loss_normalizer_momentum=0.9,
|
| 40 |
+
center_sample="radius",
|
| 41 |
+
center_sample_radius=1.5,
|
| 42 |
+
label_smoothing=0.0,
|
| 43 |
+
boundary_kernel_size=3,
|
| 44 |
+
iou_weight_power=0.2,
|
| 45 |
+
num_bins=16,
|
| 46 |
+
loss=dict(
|
| 47 |
+
cls_loss=dict(type="FocalLoss"),
|
| 48 |
+
reg_loss=dict(type="DIOULoss"),
|
| 49 |
+
iou_rate=dict(type="GIOULoss"),
|
| 50 |
+
),
|
| 51 |
+
),
|
| 52 |
+
)
|
OpenTAD/configs/_base_/models/tsi.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="TSI",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="ConvSingleProj",
|
| 5 |
+
in_channels=400,
|
| 6 |
+
out_channels=256,
|
| 7 |
+
num_convs=2,
|
| 8 |
+
conv_cfg=dict(groups=4),
|
| 9 |
+
),
|
| 10 |
+
rpn_head=dict(
|
| 11 |
+
type="LocalGlobalTemporalEvaluationHead",
|
| 12 |
+
in_channels=256,
|
| 13 |
+
loss=dict(pos_thresh=0.5),
|
| 14 |
+
),
|
| 15 |
+
roi_head=dict(
|
| 16 |
+
type="StandardProposalMapHead",
|
| 17 |
+
proposal_generator=dict(type="DenseProposalMap", tscale=128, dscale=128),
|
| 18 |
+
proposal_roi_extractor=dict(
|
| 19 |
+
type="BMNExtractor",
|
| 20 |
+
in_channels=256,
|
| 21 |
+
roi_channels=512,
|
| 22 |
+
out_channels=128,
|
| 23 |
+
tscale=128,
|
| 24 |
+
dscale=128,
|
| 25 |
+
prop_extend_ratio=0.5,
|
| 26 |
+
),
|
| 27 |
+
proposal_head=dict(
|
| 28 |
+
type="TSIHead", # modified on PEMHead
|
| 29 |
+
in_channels=128,
|
| 30 |
+
feat_channels=128,
|
| 31 |
+
num_convs=2,
|
| 32 |
+
num_classes=2,
|
| 33 |
+
loss=dict(
|
| 34 |
+
cls_loss=dict(type="ScaleInvariantLoss", pos_thresh=0.9),
|
| 35 |
+
reg_loss=dict(type="BalancedL2Loss", high_thresh=0.7, low_thresh=0.3, weight=5.0),
|
| 36 |
+
),
|
| 37 |
+
),
|
| 38 |
+
),
|
| 39 |
+
)
|
OpenTAD/configs/_base_/models/videomambasuite.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model = dict(
|
| 2 |
+
type="VideoMambaSuite",
|
| 3 |
+
projection=dict(
|
| 4 |
+
type="MambaProj",
|
| 5 |
+
in_channels=2048,
|
| 6 |
+
out_channels=512,
|
| 7 |
+
arch=(2, 2, 5), # layers in embed / stem / branch
|
| 8 |
+
conv_cfg=dict(kernel_size=3),
|
| 9 |
+
norm_cfg=dict(type="LN"),
|
| 10 |
+
use_abs_pe=False,
|
| 11 |
+
max_seq_len=2304,
|
| 12 |
+
mamba_cfg=dict(kernel_size=4, drop_path_rate=0.3, use_mamba_type="dbm"),
|
| 13 |
+
),
|
| 14 |
+
neck=dict(
|
| 15 |
+
type="FPNIdentity",
|
| 16 |
+
in_channels=512,
|
| 17 |
+
out_channels=512,
|
| 18 |
+
num_levels=6,
|
| 19 |
+
),
|
| 20 |
+
rpn_head=dict(
|
| 21 |
+
type="ActionFormerHead",
|
| 22 |
+
num_classes=20,
|
| 23 |
+
in_channels=512,
|
| 24 |
+
feat_channels=512,
|
| 25 |
+
num_convs=2,
|
| 26 |
+
cls_prior_prob=0.01,
|
| 27 |
+
prior_generator=dict(
|
| 28 |
+
type="PointGenerator",
|
| 29 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 30 |
+
regression_range=[(0, 4), (4, 8), (8, 16), (16, 32), (32, 64), (64, 10000)],
|
| 31 |
+
),
|
| 32 |
+
loss_normalizer=100,
|
| 33 |
+
loss_normalizer_momentum=0.9,
|
| 34 |
+
center_sample="radius",
|
| 35 |
+
center_sample_radius=1.5,
|
| 36 |
+
label_smoothing=0.0,
|
| 37 |
+
loss=dict(
|
| 38 |
+
cls_loss=dict(type="FocalLoss"),
|
| 39 |
+
reg_loss=dict(type="DIOULoss"),
|
| 40 |
+
),
|
| 41 |
+
),
|
| 42 |
+
)
|
OpenTAD/configs/_base_/models/vsgn.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tscale = 256
|
| 2 |
+
model = dict(
|
| 3 |
+
type="VSGN",
|
| 4 |
+
projection=dict(
|
| 5 |
+
type="VSGNPyramidProj",
|
| 6 |
+
in_channels=2048,
|
| 7 |
+
out_channels=256,
|
| 8 |
+
pyramid_levels=[2, 4, 8, 16, 32],
|
| 9 |
+
),
|
| 10 |
+
neck=dict(
|
| 11 |
+
type="VSGNFPN",
|
| 12 |
+
in_channels=256,
|
| 13 |
+
out_channels=256,
|
| 14 |
+
num_levels=5,
|
| 15 |
+
),
|
| 16 |
+
rpn_head=dict(
|
| 17 |
+
type="VSGNRPNHead",
|
| 18 |
+
in_channels=256,
|
| 19 |
+
num_layers=4,
|
| 20 |
+
num_classes=1,
|
| 21 |
+
iou_thr=0.6,
|
| 22 |
+
anchor_generator=dict(
|
| 23 |
+
pyramid_levels=[2, 4, 8, 16, 32],
|
| 24 |
+
tscale=tscale,
|
| 25 |
+
anchor_scale=[7, 7.5],
|
| 26 |
+
),
|
| 27 |
+
tem_head=dict(
|
| 28 |
+
type="TemporalEvaluationHead",
|
| 29 |
+
in_channels=256,
|
| 30 |
+
num_classes=3,
|
| 31 |
+
loss=dict(pos_thresh=0.5, gt_type=["startness", "endness", "actionness"]),
|
| 32 |
+
),
|
| 33 |
+
loss_cls=dict(type="BalancedCEloss"), # CE for THUMOS, Sigmoid for ANET
|
| 34 |
+
loss_loc=dict(type="GIoULoss"), # this is only a placeholder
|
| 35 |
+
),
|
| 36 |
+
roi_head=dict(
|
| 37 |
+
type="VSGNRoIHead",
|
| 38 |
+
in_channels=256,
|
| 39 |
+
iou_thr=0.7,
|
| 40 |
+
roi_extractor=dict(type="CornerExtractor", beta=8.0, base_stride=2, tscale=tscale),
|
| 41 |
+
loss_loc=dict(type="GIoULoss"), # this is only a placeholder
|
| 42 |
+
),
|
| 43 |
+
)
|
OpenTAD/configs/actionformer/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ActionFormer
|
| 2 |
+
|
| 3 |
+
> [ActionFormer: Localizing Moments of Actions with Transformers](https://arxiv.org/abs/2202.07925)
|
| 4 |
+
> Chen-Lin Zhang, Jianxin Wu, Yin Li
|
| 5 |
+
|
| 6 |
+
<!-- [ALGORITHM] -->
|
| 7 |
+
|
| 8 |
+
## Abstract
|
| 9 |
+
|
| 10 |
+
Self-attention based Transformer models have demonstrated impressive results for image classification and object detection, and more recently for video understanding. Inspired by this success, we investigate the application of Transformer networks for temporal action localization in videos. To this end, we present ActionFormer -- a simple yet powerful model to identify actions in time and recognize their categories in a single shot, without using action proposals or relying on pre-defined anchor windows. ActionFormer combines a multiscale feature representation with local self-attention, and uses a light-weighted decoder to classify every moment in time and estimate the corresponding action boundaries. We show that this orchestrated design results in major improvements upon prior works. Without bells and whistles, ActionFormer achieves 71.0% mAP at tIoU=0.5 on THUMOS14, outperforming the best prior model by 14.1 absolute percentage points. Further, ActionFormer demonstrates strong results on ActivityNet 1.3 (36.6% average mAP) and EPIC-Kitchens 100 (+13.5% average mAP over prior works).
|
| 11 |
+
|
| 12 |
+
## Results and Models
|
| 13 |
+
|
| 14 |
+
**ActivityNet-1.3** with CUHK classifier.
|
| 15 |
+
|
| 16 |
+
| Features | mAP@0.5 | mAP@0.75 | mAP@0.95 | ave. mAP | Config | Download |
|
| 17 |
+
| :------: | :-----: | :------: | :------: | :------: | :-------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 18 |
+
| TSP | 55.08 | 38.27 | 8.91 | 37.07 | [config](anet_tsp.py) | [model](https://drive.google.com/file/d/1loC72F4U79jWfoRL9SB2rdk3xykBKqHN/view?usp=sharing) \| [log](https://drive.google.com/file/d/1YveGerbI1es51t2Ii7WZDgPlJy3lGBLf/view?usp=sharing) |
|
| 19 |
+
|
| 20 |
+
**THUMOS-14**
|
| 21 |
+
|
| 22 |
+
| Features | mAP@0.3 | mAP@0.4 | mAP@0.5 | mAP@0.6 | mAP@0.7 | ave. mAP | Config | Download |
|
| 23 |
+
| :------: | :-----: | :-----: | :-----: | :-----: | :-----: | :------: | :---------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 24 |
+
| I3D | 83.78 | 80.06 | 73.16 | 60.46 | 44.72 | 68.44 | [config](thumos_i3d.py) | [model](https://drive.google.com/file/d/17oP-fMOjw6wwnaQWTlikWwoZoSkiIFkt/view?usp=sharing) \| [log](https://drive.google.com/file/d/1WJe98mKoXaP2X9Th-gKC8rw0JeKxfJkq/view?usp=sharing) |
|
| 25 |
+
|
| 26 |
+
**HACS**
|
| 27 |
+
|
| 28 |
+
| Features | mAP@0.5 | mAP@0.75 | mAP@0.95 | ave. mAP | Config | Download |
|
| 29 |
+
| :------: | :-----: | :------: | :------: | :------: | :------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 30 |
+
| SlowFast | 56.18 | 37.97 | 11.05 | 37.71 | [config](hacs_slowfast.py) | [model](https://drive.google.com/file/d/1IdxR5lyfXzk5wjl-8YDcH0Nw2BEDwzWz/view?usp=sharing) \| [log](https://drive.google.com/file/d/1Eu2O9IKuR8XLeZ37OxCq7NjSUKPE-3Zw/view?usp=sharing) |
|
| 31 |
+
|
| 32 |
+
**Epic-Kitchens-100**
|
| 33 |
+
|
| 34 |
+
| Subset | Features | mAP@0.1 | mAP@0.2 | mAP@0.3 | mAP@0.4 | mAP@0.5 | ave. mAP | Config | Download |
|
| 35 |
+
| :----: | :------: | :-----: | :-----: | :-----: | :-----: | :-----: | :------: | :--------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 36 |
+
| Noun | SlowFast | 25.78 | 24.73 | 22.83 | 20.84 | 17.45 | 22.33 | [config](epic_kitchens_slowfast_noun.py) | [model](https://drive.google.com/file/d/1RckzXf5W8oD_ARZw5dyYo03ZKVrU1n9-/view?usp=sharing) \| [log](https://drive.google.com/file/d/18dVA27hWRBjM8lp4S12DscCkNJBqFrWp/view?usp=sharing) |
|
| 37 |
+
| Verb | SlowFast | 27.68 | 26.79 | 25.62 | 24.06 | 20.48 | 24.93 | [config](epic_kitchens_slowfast_verb.py) | [model](https://drive.google.com/file/d/1-RLtnku727Fh39rihyGVxLCU5klTIvbn/view?usp=sharing) \| [log](https://drive.google.com/file/d/1w18Ccyi22ZHgM0ECx6rAKOXqFoO9L0Iq/view?usp=sharing) |
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
**MultiTHUMOS**
|
| 41 |
+
|
| 42 |
+
| Features | mAP@0.2 | mAP@0.5 | mAP@0.7 | ave. mAP (0.1:0.9:0.1) | Config | Download |
|
| 43 |
+
| :------------: | :-----: | :-----: | :-----: | :--------------------: | :------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 44 |
+
| I3D (rgb) | 53.50 | 39.04 | 19.69 | 34.01 | [config](multithumos_i3d_rgb.py) | [model](https://drive.google.com/file/d/1ufrZRt9uVu6_IJXPa-JdRK05vsc0UQXO/view?usp=sharing) \| [log](https://drive.google.com/file/d/1PGrIRfWOHPIofDdSNRQX4UglzBWvlVhO/view?usp=sharing) |
|
| 45 |
+
| I3D (rgb+flow) | 60.16 | 44.99 | 24.55 | 39.18 | [config](multithumos_i3d.py) | [model](https://drive.google.com/file/d/1rBOoxuUR3tlzyQmWZGUtPXmsKUT7yLFm/view?usp=sharing) \| [log](https://drive.google.com/file/d/1-h_9g0HppsqnrvirVNoiZSTTuSWmmRxC/view?usp=sharing) |
|
| 46 |
+
|
| 47 |
+
**Charades**
|
| 48 |
+
|
| 49 |
+
| Features | mAP@0.2 | mAP@0.5 | mAP@0.7 | ave. mAP (0.1:0.9:0.1) | Config | Download |
|
| 50 |
+
| :-------: | :-----: | :-----: | :-----: | :--------------------: | :---------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 51 |
+
| I3D (rgb) | 29.42 | 21.76 | 12.78 | 19.39 | [config](charades_i3d_rgb.py) | [model](https://drive.google.com/file/d/1EFCNke077m4JC_6OMJZXEnaKW2UAgFpA/view?usp=sharing) \| [log](https://drive.google.com/file/d/1CuwGJ9m2YtvnKHsq9slkgtANoNEmbqVP/view?usp=sharing) |
|
| 52 |
+
|
| 53 |
+
**FineAction** with InternVideo classifier
|
| 54 |
+
|
| 55 |
+
| Features | mAP@0.5 | mAP@0.75 | mAP@0.95 | ave. mAP | Config | Download |
|
| 56 |
+
| :---------------: | :-----: | :------: | :------: | :------: | :----------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
| 57 |
+
| VideoMAE_H_K700 | 29.44 | 19.46 | 5.06 | 19.32 | [config](fineaction_videomae_h.py) | [model](https://drive.google.com/file/d/1uNQufJMf9U6Igv6w4J70xiEVqYUKteTE/view?usp=sharing) \| [log](https://drive.google.com/file/d/1VAQbtZuvRiTk8oFS7EIF9ilOKm1165u-/view?usp=sharing) |
|
| 58 |
+
| VideoMAEv2_g_K710 | 29.85 | 19.72 | 5.17 | 19.62 | [config](fineaction_videomaev2_g.py) | [model](https://drive.google.com/file/d/1o7HdsZIR-JufAGHD6cq-xRRIEX3IMlyY/view?usp=sharing) \| [log](https://drive.google.com/file/d/1QenPC5OV9gI62wKkgbrdYyJpLSxP5awp/view?usp=sharing) |
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
## Train
|
| 62 |
+
|
| 63 |
+
You can use the following command to train a model.
|
| 64 |
+
|
| 65 |
+
```shell
|
| 66 |
+
torchrun --nnodes=1 --nproc_per_node=1 --rdzv_backend=c10d --rdzv_endpoint=localhost:0 tools/train.py ${CONFIG_FILE} [optional arguments]
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Example: train ActionFormer on ActivityNet dataset.
|
| 70 |
+
|
| 71 |
+
```shell
|
| 72 |
+
torchrun --nnodes=1 --nproc_per_node=1 --rdzv_backend=c10d --rdzv_endpoint=localhost:0 tools/train.py configs/actionformer/anet_tsp.py
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
For more details, you can refer to the Training part in the [Usage](../../docs/en/usage.md).
|
| 76 |
+
|
| 77 |
+
## Test
|
| 78 |
+
|
| 79 |
+
You can use the following command to test a model.
|
| 80 |
+
|
| 81 |
+
```shell
|
| 82 |
+
torchrun --nnodes=1 --nproc_per_node=1 --rdzv_backend=c10d --rdzv_endpoint=localhost:0 tools/test.py ${CONFIG_FILE} --checkpoint ${CHECKPOINT_FILE} [optional arguments]
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
Example: test ActionFormer on ActivityNet dataset.
|
| 86 |
+
|
| 87 |
+
```shell
|
| 88 |
+
torchrun --nnodes=1 --nproc_per_node=1 --rdzv_backend=c10d --rdzv_endpoint=localhost:0 tools/test.py configs/actionformer/anet_tsp.py --checkpoint exps/anet/actionformer_tsp/gpu1_id0/checkpoint/epoch_14.pth
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
For more details, you can refer to the Test part in the [Usage](../../docs/en/usage.md).
|
| 92 |
+
|
| 93 |
+
## Citation
|
| 94 |
+
|
| 95 |
+
```latex
|
| 96 |
+
@inproceedings{zhang2022actionformer,
|
| 97 |
+
title={Actionformer: Localizing moments of actions with transformers},
|
| 98 |
+
author={Zhang, Chen-Lin and Wu, Jianxin and Li, Yin},
|
| 99 |
+
booktitle={Computer Vision--ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23--27, 2022, Proceedings, Part IV},
|
| 100 |
+
pages={492--510},
|
| 101 |
+
year={2022},
|
| 102 |
+
organization={Springer}
|
| 103 |
+
}
|
| 104 |
+
```
|
OpenTAD/configs/actionformer/anet_tsp.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/datasets/activitynet-1.3/features_tsp_resize_trunc.py", # dataset config
|
| 3 |
+
"../_base_/models/actionformer.py", # model config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(
|
| 8 |
+
in_channels=512,
|
| 9 |
+
out_channels=256,
|
| 10 |
+
attn_cfg=dict(n_mha_win_size=[7, 7, 7, 7, 7, -1]),
|
| 11 |
+
use_abs_pe=True,
|
| 12 |
+
max_seq_len=192,
|
| 13 |
+
input_pdrop=0.2,
|
| 14 |
+
),
|
| 15 |
+
neck=dict(in_channels=256, out_channels=256),
|
| 16 |
+
rpn_head=dict(
|
| 17 |
+
in_channels=256,
|
| 18 |
+
feat_channels=256,
|
| 19 |
+
num_classes=1,
|
| 20 |
+
label_smoothing=0.1,
|
| 21 |
+
loss_weight=2.0,
|
| 22 |
+
loss_normalizer=200,
|
| 23 |
+
),
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
solver = dict(
|
| 27 |
+
train=dict(batch_size=16, num_workers=4),
|
| 28 |
+
val=dict(batch_size=16, num_workers=4),
|
| 29 |
+
test=dict(batch_size=16, num_workers=4),
|
| 30 |
+
clip_grad_norm=1,
|
| 31 |
+
ema=True,
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
optimizer = dict(type="AdamW", lr=1e-3, weight_decay=0.05, paramwise=True)
|
| 35 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=15)
|
| 36 |
+
|
| 37 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 38 |
+
post_processing = dict(
|
| 39 |
+
nms=dict(
|
| 40 |
+
use_soft_nms=True,
|
| 41 |
+
sigma=0.75,
|
| 42 |
+
max_seg_num=100,
|
| 43 |
+
iou_threshold=0, # does not matter when use soft nms
|
| 44 |
+
min_score=0.001,
|
| 45 |
+
multiclass=False,
|
| 46 |
+
voting_thresh=0.9, # set 0 to disable
|
| 47 |
+
),
|
| 48 |
+
#external_cls=dict(
|
| 49 |
+
# type="CUHKANETClassifier",
|
| 50 |
+
# path="data/activitynet-1.3/classifiers/cuhk_val_simp_7.json",
|
| 51 |
+
# topk=2,
|
| 52 |
+
#),
|
| 53 |
+
save_dict=True,
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
workflow = dict(
|
| 57 |
+
logging_interval=200,
|
| 58 |
+
checkpoint_interval=1,
|
| 59 |
+
val_loss_interval=1,
|
| 60 |
+
val_eval_interval=1,
|
| 61 |
+
val_start_epoch=7,
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
work_dir = "exps/anet/actionformer_tsp"
|
OpenTAD/configs/actionformer/charades_i3d_rgb.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/datasets/charades/features_i3d_pad.py", # dataset config
|
| 3 |
+
"../_base_/models/actionformer.py", # model config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(in_channels=1024),
|
| 8 |
+
rpn_head=dict(num_classes=157),
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
solver = dict(
|
| 12 |
+
train=dict(batch_size=16, num_workers=4),
|
| 13 |
+
val=dict(batch_size=16, num_workers=4),
|
| 14 |
+
test=dict(batch_size=16, num_workers=4),
|
| 15 |
+
clip_grad_norm=1,
|
| 16 |
+
ema=True,
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
optimizer = dict(type="AdamW", lr=1e-4, weight_decay=0.05, paramwise=True)
|
| 20 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=15)
|
| 21 |
+
|
| 22 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 23 |
+
post_processing = dict(
|
| 24 |
+
pre_nms_topk=8000,
|
| 25 |
+
pre_nms_thresh=0.001,
|
| 26 |
+
nms=dict(
|
| 27 |
+
use_soft_nms=True,
|
| 28 |
+
sigma=0.5,
|
| 29 |
+
max_seg_num=8000,
|
| 30 |
+
min_score=0.001,
|
| 31 |
+
multiclass=True,
|
| 32 |
+
voting_thresh=0.7, # set 0 to disable
|
| 33 |
+
),
|
| 34 |
+
save_dict=False,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
workflow = dict(
|
| 38 |
+
logging_interval=200,
|
| 39 |
+
checkpoint_interval=1,
|
| 40 |
+
val_loss_interval=1,
|
| 41 |
+
val_eval_interval=1,
|
| 42 |
+
val_start_epoch=5,
|
| 43 |
+
end_epoch=10,
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
work_dir = "exps/charades/actionformer_i3d_rgb"
|
OpenTAD/configs/actionformer/ego4d_egovlp.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = ["ego4d_slowfast.py"]
|
| 2 |
+
|
| 3 |
+
data_path = "data/ego4d/features/mq_egovlp/"
|
| 4 |
+
dataset = dict(
|
| 5 |
+
train=dict(data_path=data_path, offset_frames=8),
|
| 6 |
+
val=dict(data_path=data_path, offset_frames=8),
|
| 7 |
+
test=dict(data_path=data_path, offset_frames=8),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
model = dict(
|
| 11 |
+
projection=dict(in_channels=256, out_channels=384),
|
| 12 |
+
neck=dict(in_channels=384, out_channels=384),
|
| 13 |
+
rpn_head=dict(in_channels=384, feat_channels=384),
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
work_dir = "exps/ego4d/actionformer_egovlp"
|
OpenTAD/configs/actionformer/ego4d_internvideo.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = ["ego4d_slowfast.py"]
|
| 2 |
+
|
| 3 |
+
model = dict(projection=dict(in_channels=1024))
|
| 4 |
+
|
| 5 |
+
work_dir = "exps/ego4d/actionformer_internvideo"
|
OpenTAD/configs/actionformer/ego4d_slowfast.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/models/actionformer.py", # model config
|
| 3 |
+
"../_base_/datasets/ego4d_mq/features_slowfast_trunc.py", # dataset config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(
|
| 8 |
+
in_channels=2304,
|
| 9 |
+
arch=(2, 2, 7),
|
| 10 |
+
use_abs_pe=True,
|
| 11 |
+
max_seq_len=1024,
|
| 12 |
+
conv_cfg=dict(proj_pdrop=0.1),
|
| 13 |
+
attn_cfg=dict(n_mha_win_size=9),
|
| 14 |
+
),
|
| 15 |
+
neck=dict(type="FPNIdentity", num_levels=8),
|
| 16 |
+
rpn_head=dict(
|
| 17 |
+
num_classes=110,
|
| 18 |
+
prior_generator=dict(
|
| 19 |
+
strides=[1, 2, 4, 8, 16, 32, 64, 128],
|
| 20 |
+
regression_range=[(0, 4), (2, 8), (4, 16), (8, 32), (16, 64), (32, 128), (64, 256), (128, 10000)],
|
| 21 |
+
),
|
| 22 |
+
),
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
solver = dict(
|
| 26 |
+
train=dict(batch_size=2, num_workers=2),
|
| 27 |
+
val=dict(batch_size=1, num_workers=1),
|
| 28 |
+
test=dict(batch_size=1, num_workers=1),
|
| 29 |
+
clip_grad_norm=1,
|
| 30 |
+
ema=True,
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
optimizer = dict(type="AdamW", lr=1e-4, weight_decay=0.05, paramwise=True)
|
| 34 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=15)
|
| 35 |
+
|
| 36 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 37 |
+
post_processing = dict(
|
| 38 |
+
pre_nms_topk=5000,
|
| 39 |
+
nms=dict(
|
| 40 |
+
use_soft_nms=True,
|
| 41 |
+
sigma=0.9,
|
| 42 |
+
max_seg_num=2000,
|
| 43 |
+
min_score=0.001,
|
| 44 |
+
multiclass=True,
|
| 45 |
+
voting_thresh=0.95, # set 0 to disable
|
| 46 |
+
),
|
| 47 |
+
save_dict=False,
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
workflow = dict(
|
| 51 |
+
logging_interval=200,
|
| 52 |
+
checkpoint_interval=1,
|
| 53 |
+
val_loss_interval=1,
|
| 54 |
+
val_eval_interval=1,
|
| 55 |
+
val_start_epoch=8,
|
| 56 |
+
)
|
| 57 |
+
|
| 58 |
+
work_dir = "exps/ego4d/actionformer_slowfast"
|
OpenTAD/configs/actionformer/epic_kitchens_slowfast_noun.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/datasets/epic_kitchens-100/features_slowfast_noun.py", # dataset config
|
| 3 |
+
"../_base_/models/actionformer.py", # model config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(
|
| 8 |
+
in_channels=2304,
|
| 9 |
+
attn_cfg=dict(n_mha_win_size=9),
|
| 10 |
+
),
|
| 11 |
+
rpn_head=dict(
|
| 12 |
+
num_classes=293, # total 300, but 7 classes are empty
|
| 13 |
+
prior_generator=dict(
|
| 14 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 15 |
+
regression_range=[(0, 4), (2, 8), (4, 16), (8, 32), (16, 64), (32, 10000)],
|
| 16 |
+
),
|
| 17 |
+
label_smoothing=0.1,
|
| 18 |
+
loss_normalizer=250,
|
| 19 |
+
),
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
solver = dict(
|
| 23 |
+
train=dict(batch_size=2, num_workers=2),
|
| 24 |
+
val=dict(batch_size=1, num_workers=1),
|
| 25 |
+
test=dict(batch_size=1, num_workers=1),
|
| 26 |
+
clip_grad_norm=1,
|
| 27 |
+
ema=True,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
optimizer = dict(type="AdamW", lr=1e-4, weight_decay=0.05, paramwise=True)
|
| 31 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=20)
|
| 32 |
+
|
| 33 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 34 |
+
post_processing = dict(
|
| 35 |
+
pre_nms_topk=5000,
|
| 36 |
+
nms=dict(
|
| 37 |
+
use_soft_nms=True,
|
| 38 |
+
sigma=0.4,
|
| 39 |
+
max_seg_num=2000,
|
| 40 |
+
iou_threshold=0, # does not matter when use soft nms
|
| 41 |
+
min_score=0.001,
|
| 42 |
+
multiclass=True,
|
| 43 |
+
voting_thresh=0.75, # set 0 to disable
|
| 44 |
+
),
|
| 45 |
+
save_dict=False,
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
workflow = dict(
|
| 49 |
+
logging_interval=200,
|
| 50 |
+
checkpoint_interval=1,
|
| 51 |
+
val_loss_interval=1,
|
| 52 |
+
val_eval_interval=1,
|
| 53 |
+
val_start_epoch=15,
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
work_dir = "exps/epic_kitchens/actionformer_slowfast_noun"
|
OpenTAD/configs/actionformer/epic_kitchens_slowfast_verb.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/datasets/epic_kitchens-100/features_slowfast_verb.py", # dataset config
|
| 3 |
+
"../_base_/models/actionformer.py", # model config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(
|
| 8 |
+
in_channels=2304,
|
| 9 |
+
attn_cfg=dict(n_mha_win_size=9),
|
| 10 |
+
),
|
| 11 |
+
rpn_head=dict(
|
| 12 |
+
num_classes=97,
|
| 13 |
+
prior_generator=dict(
|
| 14 |
+
strides=[1, 2, 4, 8, 16, 32],
|
| 15 |
+
regression_range=[(0, 4), (2, 8), (4, 16), (8, 32), (16, 64), (32, 10000)],
|
| 16 |
+
),
|
| 17 |
+
loss_normalizer=250,
|
| 18 |
+
),
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
solver = dict(
|
| 22 |
+
train=dict(batch_size=2, num_workers=2),
|
| 23 |
+
val=dict(batch_size=1, num_workers=1),
|
| 24 |
+
test=dict(batch_size=1, num_workers=1),
|
| 25 |
+
clip_grad_norm=1,
|
| 26 |
+
ema=True,
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
optimizer = dict(type="AdamW", lr=1e-4, weight_decay=0.05, paramwise=True)
|
| 30 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=20)
|
| 31 |
+
|
| 32 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 33 |
+
post_processing = dict(
|
| 34 |
+
pre_nms_topk=5000,
|
| 35 |
+
nms=dict(
|
| 36 |
+
use_soft_nms=True,
|
| 37 |
+
sigma=0.4,
|
| 38 |
+
max_seg_num=2000,
|
| 39 |
+
iou_threshold=0, # does not matter when use soft nms
|
| 40 |
+
min_score=0.001,
|
| 41 |
+
multiclass=True,
|
| 42 |
+
voting_thresh=0.75, # set 0 to disable
|
| 43 |
+
),
|
| 44 |
+
save_dict=False,
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
workflow = dict(
|
| 48 |
+
logging_interval=200,
|
| 49 |
+
checkpoint_interval=1,
|
| 50 |
+
val_loss_interval=1,
|
| 51 |
+
val_eval_interval=1,
|
| 52 |
+
val_start_epoch=15,
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
work_dir = "exps/epic_kitchens/actionformer_slowfast_verb"
|
OpenTAD/configs/actionformer/fineaction_videomae_h.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
"../_base_/datasets/fineaction/features_internvideo_resize_trunc.py", # dataset config
|
| 3 |
+
"../_base_/models/actionformer.py", # model config
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
model = dict(
|
| 7 |
+
projection=dict(
|
| 8 |
+
in_channels=1280,
|
| 9 |
+
out_channels=256,
|
| 10 |
+
attn_cfg=dict(n_mha_win_size=[7, 7, 7, 7, 7, -1]),
|
| 11 |
+
use_abs_pe=True,
|
| 12 |
+
max_seq_len=192,
|
| 13 |
+
),
|
| 14 |
+
neck=dict(in_channels=256, out_channels=256),
|
| 15 |
+
rpn_head=dict(
|
| 16 |
+
in_channels=256,
|
| 17 |
+
feat_channels=256,
|
| 18 |
+
num_classes=1,
|
| 19 |
+
label_smoothing=0.1,
|
| 20 |
+
loss_weight=2.0,
|
| 21 |
+
loss_normalizer=200,
|
| 22 |
+
),
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
solver = dict(
|
| 26 |
+
train=dict(batch_size=16, num_workers=4),
|
| 27 |
+
val=dict(batch_size=16, num_workers=4),
|
| 28 |
+
test=dict(batch_size=16, num_workers=4),
|
| 29 |
+
clip_grad_norm=1,
|
| 30 |
+
ema=True,
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
optimizer = dict(type="AdamW", lr=1e-3, weight_decay=0.05, paramwise=True)
|
| 34 |
+
scheduler = dict(type="LinearWarmupCosineAnnealingLR", warmup_epoch=5, max_epoch=20)
|
| 35 |
+
|
| 36 |
+
inference = dict(load_from_raw_predictions=False, save_raw_prediction=False)
|
| 37 |
+
post_processing = dict(
|
| 38 |
+
nms=dict(
|
| 39 |
+
use_soft_nms=True,
|
| 40 |
+
sigma=0.75,
|
| 41 |
+
max_seg_num=100,
|
| 42 |
+
iou_threshold=0, # does not matter when use soft nms
|
| 43 |
+
min_score=0.001,
|
| 44 |
+
multiclass=False,
|
| 45 |
+
voting_thresh=0.9, # set 0 to disable
|
| 46 |
+
),
|
| 47 |
+
external_cls=dict(
|
| 48 |
+
type="StandardClassifier",
|
| 49 |
+
path="./data/fineaction/classifiers/new_swinB_1x1x256_views2x3_max_label_avg_prob.json",
|
| 50 |
+
topk=2,
|
| 51 |
+
),
|
| 52 |
+
save_dict=False,
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
workflow = dict(
|
| 56 |
+
logging_interval=200,
|
| 57 |
+
checkpoint_interval=1,
|
| 58 |
+
val_loss_interval=1,
|
| 59 |
+
val_eval_interval=1,
|
| 60 |
+
val_start_epoch=10,
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
work_dir = "exps/fineaction/actionformer_videomae_h"
|