├── mmaction ├── core │ ├── evaluation │ │ ├── ava_evaluation │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── metrics.cpython-36.pyc │ │ │ │ ├── metrics.cpython-37.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── np_box_ops.cpython-36.pyc │ │ │ │ ├── np_box_ops.cpython-37.pyc │ │ │ │ ├── np_box_list.cpython-36.pyc │ │ │ │ ├── np_box_list.cpython-37.pyc │ │ │ │ ├── standard_fields.cpython-36.pyc │ │ │ │ ├── standard_fields.cpython-37.pyc │ │ │ │ ├── per_image_evaluation.cpython-36.pyc │ │ │ │ ├── per_image_evaluation.cpython-37.pyc │ │ │ │ ├── object_detection_evaluation.cpython-36.pyc │ │ │ │ └── object_detection_evaluation.cpython-37.pyc │ │ │ ├── README.md │ │ │ └── np_box_ops.py │ │ ├── __pycache__ │ │ │ ├── recall.cpython-36.pyc │ │ │ ├── recall.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── accuracy.cpython-36.pyc │ │ │ ├── accuracy.cpython-37.pyc │ │ │ ├── ava_utils.cpython-36.pyc │ │ │ ├── ava_utils.cpython-37.pyc │ │ │ ├── eval_hooks.cpython-36.pyc │ │ │ ├── eval_hooks.cpython-37.pyc │ │ │ ├── eval_detection.cpython-36.pyc │ │ │ └── eval_detection.cpython-37.pyc │ │ ├── __init__.py │ │ └── recall.py │ ├── hooks │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── output.cpython-36.pyc │ │ │ ├── output.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── __init__.cpython-37.pyc │ │ └── output.py │ ├── lr │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── tin_lr_hook.cpython-36.pyc │ │ │ └── tin_lr_hook.cpython-37.pyc │ │ └── tin_lr_hook.py │ ├── bbox │ │ ├── assigners │ │ │ ├── __init__.py │ │ │ └── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── max_iou_assigner_ava.cpython-36.pyc │ │ │ │ └── max_iou_assigner_ava.cpython-37.pyc │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bbox_target.cpython-36.pyc │ │ │ ├── bbox_target.cpython-37.pyc │ │ │ ├── transforms.cpython-36.pyc │ │ │ └── transforms.cpython-37.pyc │ │ ├── __init__.py │ │ ├── transforms.py │ │ └── bbox_target.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── __init__.cpython-37.pyc │ ├── runner │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── omnisource_runner.cpython-36.pyc │ │ │ └── omnisource_runner.cpython-37.pyc │ ├── optimizer │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── copy_of_sgd.cpython-36.pyc │ │ │ ├── copy_of_sgd.cpython-37.pyc │ │ │ ├── tsm_optimizer_constructor.cpython-36.pyc │ │ │ └── tsm_optimizer_constructor.cpython-37.pyc │ │ ├── __init__.py │ │ └── copy_of_sgd.py │ └── __init__.py ├── models │ ├── necks │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── tpn.cpython-36.pyc │ │ │ ├── tpn.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── __init__.cpython-37.pyc │ ├── localizers │ │ ├── utils │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── post_processing.cpython-36.pyc │ │ │ │ └── post_processing.cpython-37.pyc │ │ │ └── post_processing.py │ │ ├── __pycache__ │ │ │ ├── bmn.cpython-36.pyc │ │ │ ├── bmn.cpython-37.pyc │ │ │ ├── bsn.cpython-36.pyc │ │ │ ├── bsn.cpython-37.pyc │ │ │ ├── ssn.cpython-36.pyc │ │ │ ├── ssn.cpython-37.pyc │ │ │ ├── base.cpython-36.pyc │ │ │ ├── base.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── __init__.cpython-37.pyc │ │ └── __init__.py │ ├── roi_extractors │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── single_straight3d.cpython-36.pyc │ │ │ └── single_straight3d.cpython-37.pyc │ │ └── single_straight3d.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── builder.cpython-36.pyc │ │ ├── builder.cpython-37.pyc │ │ ├── registry.cpython-36.pyc │ │ └── registry.cpython-37.pyc │ ├── common │ │ ├── __pycache__ │ │ │ ├── tam.cpython-36.pyc │ │ │ ├── tam.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── conv2plus1d.cpython-36.pyc │ │ │ ├── conv2plus1d.cpython-37.pyc │ │ │ ├── conv_audio.cpython-36.pyc │ │ │ └── conv_audio.cpython-37.pyc │ │ ├── __init__.py │ │ ├── conv_audio.py │ │ └── conv2plus1d.py │ ├── heads │ │ ├── __pycache__ │ │ │ ├── base.cpython-36.pyc │ │ │ ├── base.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── i3d_head.cpython-36.pyc │ │ │ ├── i3d_head.cpython-37.pyc │ │ │ ├── roi_head.cpython-36.pyc │ │ │ ├── roi_head.cpython-37.pyc │ │ │ ├── ssn_head.cpython-36.pyc │ │ │ ├── ssn_head.cpython-37.pyc │ │ │ ├── tpn_head.cpython-36.pyc │ │ │ ├── tpn_head.cpython-37.pyc │ │ │ ├── tsm_head.cpython-36.pyc │ │ │ ├── tsm_head.cpython-37.pyc │ │ │ ├── tsn_head.cpython-36.pyc │ │ │ ├── tsn_head.cpython-37.pyc │ │ │ ├── x3d_head.cpython-36.pyc │ │ │ ├── x3d_head.cpython-37.pyc │ │ │ ├── bbox_head.cpython-36.pyc │ │ │ ├── bbox_head.cpython-37.pyc │ │ │ ├── slowfast_head.cpython-36.pyc │ │ │ ├── slowfast_head.cpython-37.pyc │ │ │ ├── audio_tsn_head.cpython-36.pyc │ │ │ └── audio_tsn_head.cpython-37.pyc │ │ ├── __init__.py │ │ ├── audio_tsn_head.py │ │ ├── i3d_head.py │ │ ├── tpn_head.py │ │ ├── slowfast_head.py │ │ ├── x3d_head.py │ │ ├── roi_head.py │ │ ├── tsn_head.py │ │ └── base.py │ ├── losses │ │ ├── __pycache__ │ │ │ ├── base.cpython-36.pyc │ │ │ ├── base.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── bmn_loss.cpython-36.pyc │ │ │ ├── bmn_loss.cpython-37.pyc │ │ │ ├── hvu_loss.cpython-36.pyc │ │ │ ├── hvu_loss.cpython-37.pyc │ │ │ ├── nll_loss.cpython-36.pyc │ │ │ ├── nll_loss.cpython-37.pyc │ │ │ ├── ssn_loss.cpython-36.pyc │ │ │ ├── ssn_loss.cpython-37.pyc │ │ │ ├── ohem_hinge_loss.cpython-36.pyc │ │ │ ├── ohem_hinge_loss.cpython-37.pyc │ │ │ ├── cross_entropy_loss.cpython-36.pyc │ │ │ ├── cross_entropy_loss.cpython-37.pyc │ │ │ ├── binary_logistic_regression_loss.cpython-36.pyc │ │ │ └── binary_logistic_regression_loss.cpython-37.pyc │ │ ├── __init__.py │ │ ├── nll_loss.py │ │ ├── base.py │ │ ├── binary_logistic_regression_loss.py │ │ └── ohem_hinge_loss.py │ ├── backbones │ │ ├── __pycache__ │ │ │ ├── c3d.cpython-36.pyc │ │ │ ├── c3d.cpython-37.pyc │ │ │ ├── x3d.cpython-36.pyc │ │ │ ├── x3d.cpython-37.pyc │ │ │ ├── resnet.cpython-36.pyc │ │ │ ├── resnet.cpython-37.pyc │ │ │ ├── tanet.cpython-36.pyc │ │ │ ├── tanet.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── resnet3d.cpython-36.pyc │ │ │ ├── resnet3d.cpython-37.pyc │ │ │ ├── resnet_tin.cpython-36.pyc │ │ │ ├── resnet_tin.cpython-37.pyc │ │ │ ├── resnet_tsm.cpython-36.pyc │ │ │ ├── resnet_tsm.cpython-37.pyc │ │ │ ├── mobilenet_v2.cpython-36.pyc │ │ │ ├── mobilenet_v2.cpython-37.pyc │ │ │ ├── resnet2plus1d.cpython-36.pyc │ │ │ ├── resnet2plus1d.cpython-37.pyc │ │ │ ├── resnet3d_csn.cpython-36.pyc │ │ │ ├── resnet3d_csn.cpython-37.pyc │ │ │ ├── resnet3d_stn.cpython-36.pyc │ │ │ ├── resnet3d_stn.cpython-37.pyc │ │ │ ├── resnet_audio.cpython-36.pyc │ │ │ ├── resnet_audio.cpython-37.pyc │ │ │ ├── mobilenet_v2_tsm.cpython-36.pyc │ │ │ ├── mobilenet_v2_tsm.cpython-37.pyc │ │ │ ├── resnet3d_slowfast.cpython-36.pyc │ │ │ ├── resnet3d_slowfast.cpython-37.pyc │ │ │ ├── resnet3d_slowonly.cpython-36.pyc │ │ │ ├── resnet3d_slowonly.cpython-37.pyc │ │ │ ├── resnet3d_slowfast_stn.cpython-36.pyc │ │ │ └── resnet3d_slowfast_stn.cpython-37.pyc │ │ ├── __init__.py │ │ ├── mobilenet_v2_tsm.py │ │ ├── resnet2plus1d.py │ │ ├── resnet3d_slowonly.py │ │ └── tanet.py │ ├── recognizers │ │ ├── __pycache__ │ │ │ ├── base.cpython-36.pyc │ │ │ ├── base.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── recognizer2d.cpython-36.pyc │ │ │ ├── recognizer2d.cpython-37.pyc │ │ │ ├── recognizer3d.cpython-36.pyc │ │ │ ├── recognizer3d.cpython-37.pyc │ │ │ ├── audio_recognizer.cpython-36.pyc │ │ │ └── audio_recognizer.cpython-37.pyc │ │ ├── __init__.py │ │ ├── recognizer3d.py │ │ ├── audio_recognizer.py │ │ └── recognizer2d.py │ ├── registry.py │ ├── __init__.py │ └── builder.py ├── datasets │ ├── registry.py │ ├── __pycache__ │ │ ├── base.cpython-36.pyc │ │ ├── base.cpython-37.pyc │ │ ├── builder.cpython-36.pyc │ │ ├── builder.cpython-37.pyc │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── registry.cpython-36.pyc │ │ ├── registry.cpython-37.pyc │ │ ├── ava_dataset.cpython-36.pyc │ │ ├── ava_dataset.cpython-37.pyc │ │ ├── hvu_dataset.cpython-36.pyc │ │ ├── hvu_dataset.cpython-37.pyc │ │ ├── ssn_dataset.cpython-36.pyc │ │ ├── ssn_dataset.cpython-37.pyc │ │ ├── audio_dataset.cpython-36.pyc │ │ ├── audio_dataset.cpython-37.pyc │ │ ├── image_dataset.cpython-36.pyc │ │ ├── image_dataset.cpython-37.pyc │ │ ├── video_dataset.cpython-36.pyc │ │ ├── video_dataset.cpython-37.pyc │ │ ├── dataset_wrappers.cpython-36.pyc │ │ ├── dataset_wrappers.cpython-37.pyc │ │ ├── rawframe_dataset.cpython-36.pyc │ │ ├── rawframe_dataset.cpython-37.pyc │ │ ├── rawvideo_dataset.cpython-36.pyc │ │ ├── rawvideo_dataset.cpython-37.pyc │ │ ├── activitynet_dataset.cpython-36.pyc │ │ ├── activitynet_dataset.cpython-37.pyc │ │ ├── audio_feature_dataset.cpython-36.pyc │ │ ├── audio_feature_dataset.cpython-37.pyc │ │ ├── audio_visual_dataset.cpython-36.pyc │ │ └── audio_visual_dataset.cpython-37.pyc │ ├── samplers │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── distributed_sampler.cpython-36.pyc │ │ │ └── distributed_sampler.cpython-37.pyc │ │ └── distributed_sampler.py │ ├── pipelines │ │ ├── __pycache__ │ │ │ ├── compose.cpython-36.pyc │ │ │ ├── compose.cpython-37.pyc │ │ │ ├── loading.cpython-36.pyc │ │ │ ├── loading.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── formating.cpython-36.pyc │ │ │ ├── formating.cpython-37.pyc │ │ │ ├── augmentations.cpython-36.pyc │ │ │ └── augmentations.cpython-37.pyc │ │ ├── compose.py │ │ └── __init__.py │ ├── dataset_wrappers.py │ ├── __init__.py │ ├── image_dataset.py │ ├── video_dataset.py │ ├── audio_dataset.py │ ├── audio_feature_dataset.py │ └── audio_visual_dataset.py ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── __init__.cpython-37.pyc │ ├── version.cpython-36.pyc │ └── version.cpython-37.pyc ├── apis │ ├── __pycache__ │ │ ├── test.cpython-36.pyc │ │ ├── test.cpython-37.pyc │ │ ├── train.cpython-36.pyc │ │ ├── train.cpython-37.pyc │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── inference.cpython-36.pyc │ │ └── inference.cpython-37.pyc │ └── __init__.py ├── utils │ ├── __pycache__ │ │ ├── misc.cpython-36.pyc │ │ ├── misc.cpython-37.pyc │ │ ├── logger.cpython-36.pyc │ │ ├── logger.cpython-37.pyc │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── decorators.cpython-36.pyc │ │ ├── decorators.cpython-37.pyc │ │ ├── precise_bn.cpython-36.pyc │ │ ├── precise_bn.cpython-37.pyc │ │ ├── collect_env.cpython-36.pyc │ │ ├── collect_env.cpython-37.pyc │ │ ├── module_hooks.cpython-36.pyc │ │ ├── module_hooks.cpython-37.pyc │ │ ├── gradcam_utils.cpython-36.pyc │ │ └── gradcam_utils.cpython-37.pyc │ ├── collect_env.py │ ├── __init__.py │ ├── misc.py │ ├── logger.py │ └── decorators.py ├── localization │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── bsn_utils.cpython-36.pyc │ │ ├── bsn_utils.cpython-37.pyc │ │ ├── ssn_utils.cpython-36.pyc │ │ ├── ssn_utils.cpython-37.pyc │ │ ├── proposal_utils.cpython-36.pyc │ │ └── proposal_utils.cpython-37.pyc │ ├── __init__.py │ └── proposal_utils.py ├── __init__.py └── version.py ├── work_dirs └── label_map_k400.txt ├── api.py ├── README.md └── requirements.txt /mmaction/core/evaluation/ava_evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mmaction/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | from .tpn import TPN 2 | 3 | __all__ = ['TPN'] 4 | -------------------------------------------------------------------------------- /mmaction/core/hooks/__init__.py: -------------------------------------------------------------------------------- 1 | from .output import OutputHook 2 | 3 | __all__ = ['OutputHook'] 4 | -------------------------------------------------------------------------------- /mmaction/core/lr/__init__.py: -------------------------------------------------------------------------------- 1 | from .tin_lr_hook import TINLrUpdaterHook 2 | 3 | __all__ = ['TINLrUpdaterHook'] 4 | -------------------------------------------------------------------------------- /work_dirs/label_map_k400.txt: -------------------------------------------------------------------------------- 1 | cough 2 | falldown 3 | headache 4 | chestpain 5 | backpain 6 | standup 7 | sitdown 8 | -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .post_processing import post_processing 2 | 3 | __all__ = ['post_processing'] 4 | -------------------------------------------------------------------------------- /mmaction/core/bbox/assigners/__init__.py: -------------------------------------------------------------------------------- 1 | from .max_iou_assigner_ava import MaxIoUAssignerAVA 2 | 3 | __all__ = ['MaxIoUAssignerAVA'] 4 | -------------------------------------------------------------------------------- /mmaction/datasets/registry.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry 2 | 3 | DATASETS = Registry('dataset') 4 | PIPELINES = Registry('pipeline') 5 | -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | from .single_straight3d import SingleRoIExtractor3D 2 | 3 | __all__ = ['SingleRoIExtractor3D'] 4 | -------------------------------------------------------------------------------- /mmaction/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/__pycache__/version.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/__pycache__/version.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/__pycache__/version.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/__pycache__/version.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/test.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/test.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/test.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/test.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/train.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/train.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/misc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/misc.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/misc.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/misc.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/logger.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/logger.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/inference.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/inference.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/apis/__pycache__/inference.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/apis/__pycache__/inference.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/lr/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/lr/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/lr/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/lr/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/builder.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/builder.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/builder.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/builder.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/builder.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/registry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/registry.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/__pycache__/registry.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/__pycache__/registry.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/necks/__pycache__/tpn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/necks/__pycache__/tpn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/necks/__pycache__/tpn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/necks/__pycache__/tpn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/decorators.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/decorators.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/decorators.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/decorators.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/precise_bn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/precise_bn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/precise_bn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/precise_bn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/hooks/__pycache__/output.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/hooks/__pycache__/output.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/hooks/__pycache__/output.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/hooks/__pycache__/output.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/runner/__init__.py: -------------------------------------------------------------------------------- 1 | from .omnisource_runner import OmniSourceDistSamplerSeedHook, OmniSourceRunner 2 | 3 | __all__ = ['OmniSourceRunner', 'OmniSourceDistSamplerSeedHook'] 4 | -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/registry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/registry.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/registry.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/registry.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from .distributed_sampler import DistributedPowerSampler, DistributedSampler 2 | 3 | __all__ = ['DistributedSampler', 'DistributedPowerSampler'] 4 | -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/tam.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/tam.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/tam.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/tam.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/collect_env.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/collect_env.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/collect_env.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/collect_env.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/module_hooks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/module_hooks.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/module_hooks.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/module_hooks.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/bbox_target.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/bbox_target.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/bbox_target.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/bbox_target.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/transforms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/transforms.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__pycache__/transforms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/__pycache__/transforms.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/hooks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/hooks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/hooks/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/hooks/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/lr/__pycache__/tin_lr_hook.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/lr/__pycache__/tin_lr_hook.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/lr/__pycache__/tin_lr_hook.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/lr/__pycache__/tin_lr_hook.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/runner/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/runner/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/runner/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/runner/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/ava_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/ava_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/ava_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/ava_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/hvu_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/hvu_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/hvu_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/hvu_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/ssn_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/ssn_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/ssn_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/ssn_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/c3d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/c3d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/c3d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/c3d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/x3d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/x3d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/x3d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/x3d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__init__.py: -------------------------------------------------------------------------------- 1 | from .conv2plus1d import Conv2plus1d 2 | from .conv_audio import ConvAudio 3 | from .tam import TAM 4 | 5 | __all__ = ['Conv2plus1d', 'ConvAudio', 'TAM'] 6 | -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/i3d_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/i3d_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/i3d_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/i3d_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/roi_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/roi_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/roi_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/roi_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/ssn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/ssn_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/ssn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/ssn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tpn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tpn_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tpn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tpn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tsm_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tsm_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tsm_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tsm_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tsn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tsn_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/tsn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/tsn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/x3d_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/x3d_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/x3d_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/x3d_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/bmn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/bmn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/bmn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/bmn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/bsn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/bsn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/bsn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/bsn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/ssn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/ssn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/ssn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/ssn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/necks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/necks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/necks/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/necks/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/gradcam_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/gradcam_utils.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/utils/__pycache__/gradcam_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/utils/__pycache__/gradcam_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/recall.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/recall.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/recall.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/recall.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/image_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/image_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/image_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/image_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/video_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/video_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/video_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/video_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/bsn_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/bsn_utils.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/bsn_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/bsn_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/ssn_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/ssn_utils.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/ssn_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/ssn_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/tanet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/tanet.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/tanet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/tanet.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/bbox_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/bbox_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/bbox_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/bbox_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/bmn_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/bmn_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/bmn_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/bmn_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/hvu_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/hvu_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/hvu_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/hvu_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/nll_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/nll_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/nll_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/nll_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/ssn_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/ssn_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/ssn_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/ssn_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/base.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/base.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/base.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/base.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/accuracy.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/accuracy.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/accuracy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/accuracy.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/ava_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/ava_utils.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/ava_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/ava_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/eval_hooks.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/eval_hooks.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/eval_hooks.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__init__.py: -------------------------------------------------------------------------------- 1 | from .copy_of_sgd import CopyOfSGD 2 | from .tsm_optimizer_constructor import TSMOptimizerConstructor 3 | 4 | __all__ = ['CopyOfSGD', 'TSMOptimizerConstructor'] 5 | -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/copy_of_sgd.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/copy_of_sgd.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/copy_of_sgd.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/copy_of_sgd.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/dataset_wrappers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/dataset_wrappers.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/dataset_wrappers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/dataset_wrappers.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/rawframe_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/rawframe_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/rawframe_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/rawframe_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/rawvideo_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/rawvideo_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/rawvideo_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/rawvideo_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/compose.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/compose.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/compose.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/compose.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/loading.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/loading.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/loading.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/loading.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/samplers/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/samplers/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/samplers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/samplers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/conv2plus1d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/conv2plus1d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/conv2plus1d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/conv2plus1d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/conv_audio.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/conv_audio.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/common/__pycache__/conv_audio.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/common/__pycache__/conv_audio.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/slowfast_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/slowfast_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/slowfast_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/slowfast_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/assigners/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/assigners/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/assigners/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/activitynet_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/activitynet_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/activitynet_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/activitynet_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/formating.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/formating.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/formating.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/formating.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/proposal_utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/proposal_utils.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/localization/__pycache__/proposal_utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/localization/__pycache__/proposal_utils.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_tin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_tin.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_tin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_tin.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_tsm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_tsm.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_tsm.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_tsm.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/audio_tsn_head.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/audio_tsn_head.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/heads/__pycache__/audio_tsn_head.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/heads/__pycache__/audio_tsn_head.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/eval_detection.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/eval_detection.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/__pycache__/eval_detection.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/__pycache__/eval_detection.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/runner/__pycache__/omnisource_runner.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/runner/__pycache__/omnisource_runner.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/runner/__pycache__/omnisource_runner.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/runner/__pycache__/omnisource_runner.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_feature_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_feature_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_feature_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_feature_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_visual_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_visual_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/__pycache__/audio_visual_dataset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/__pycache__/audio_visual_dataset.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/mobilenet_v2.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/mobilenet_v2.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/mobilenet_v2.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/mobilenet_v2.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet2plus1d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet2plus1d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet2plus1d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet2plus1d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_csn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_csn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_csn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_csn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_stn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_stn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_stn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_stn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_audio.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_audio.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet_audio.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet_audio.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/ohem_hinge_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/ohem_hinge_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/ohem_hinge_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/ohem_hinge_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/recognizer2d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/recognizer2d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/recognizer2d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/recognizer2d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/recognizer3d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/recognizer3d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/recognizer3d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/recognizer3d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/roi_extractors/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/roi_extractors/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/augmentations.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/augmentations.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__pycache__/augmentations.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/pipelines/__pycache__/augmentations.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/mobilenet_v2_tsm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/mobilenet_v2_tsm.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/mobilenet_v2_tsm.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/mobilenet_v2_tsm.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/cross_entropy_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/cross_entropy_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/cross_entropy_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowfast.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowfast.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowfast.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowfast.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowonly.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowonly.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowonly.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowonly.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import BaseLocalizer 2 | from .bmn import BMN 3 | from .bsn import PEM, TEM 4 | from .ssn import SSN 5 | 6 | __all__ = ['PEM', 'TEM', 'BMN', 'SSN', 'BaseLocalizer'] 7 | -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/audio_recognizer.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/audio_recognizer.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/recognizers/__pycache__/audio_recognizer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/recognizers/__pycache__/audio_recognizer.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/__init__.py: -------------------------------------------------------------------------------- 1 | from .assigners import MaxIoUAssignerAVA 2 | from .bbox_target import bbox_target 3 | from .transforms import bbox2result 4 | 5 | __all__ = ['MaxIoUAssignerAVA', 'bbox_target', 'bbox2result'] 6 | -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/metrics.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/metrics.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/metrics.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/metrics.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/datasets/samplers/__pycache__/distributed_sampler.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/samplers/__pycache__/distributed_sampler.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/datasets/samplers/__pycache__/distributed_sampler.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowfast_stn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowfast_stn.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/backbones/__pycache__/resnet3d_slowfast_stn.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/backbones/__pycache__/resnet3d_slowfast_stn.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/assigners/__pycache__/max_iou_assigner_ava.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/assigners/__pycache__/max_iou_assigner_ava.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/bbox/assigners/__pycache__/max_iou_assigner_ava.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/bbox/assigners/__pycache__/max_iou_assigner_ava.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_ops.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_ops.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_ops.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_ops.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/tsm_optimizer_constructor.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/tsm_optimizer_constructor.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/optimizer/__pycache__/tsm_optimizer_constructor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/optimizer/__pycache__/tsm_optimizer_constructor.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/__pycache__/post_processing.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/utils/__pycache__/post_processing.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/__pycache__/post_processing.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/localizers/utils/__pycache__/post_processing.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/__pycache__/single_straight3d.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/roi_extractors/__pycache__/single_straight3d.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/__pycache__/single_straight3d.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/roi_extractors/__pycache__/single_straight3d.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/README.md: -------------------------------------------------------------------------------- 1 | The code under this folder is from the official [ActivityNet repo](https://github.com/activitynet/ActivityNet). 2 | Some unused codes are removed to minimize the length of codes added. 3 | -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_list.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_list.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_list.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/np_box_list.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/standard_fields.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/standard_fields.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/standard_fields.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/standard_fields.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/binary_logistic_regression_loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/binary_logistic_regression_loss.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/models/losses/__pycache__/binary_logistic_regression_loss.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/models/losses/__pycache__/binary_logistic_regression_loss.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/per_image_evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/per_image_evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/per_image_evaluation.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/per_image_evaluation.cpython-37.pyc -------------------------------------------------------------------------------- /api.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | def precess(images): 5 | 6 | return input_queue 7 | 8 | 9 | 10 | def reco_action(input_queue): 11 | 12 | 13 | 14 | 15 | scores = model(return_loss=False, **cur_data)[0] 16 | 17 | 18 | 19 | return result -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/object_detection_evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/object_detection_evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/__pycache__/object_detection_evaluation.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giim-hf-lab/Intelligent-elderly-care-system/HEAD/mmaction/core/evaluation/ava_evaluation/__pycache__/object_detection_evaluation.cpython-37.pyc -------------------------------------------------------------------------------- /mmaction/models/registry.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry 2 | 3 | BACKBONES = Registry('backbone') 4 | NECKS = Registry('neck') 5 | HEADS = Registry('head') 6 | RECOGNIZERS = Registry('recognizer') 7 | LOSSES = Registry('loss') 8 | LOCALIZERS = Registry('localizer') 9 | -------------------------------------------------------------------------------- /mmaction/core/__init__.py: -------------------------------------------------------------------------------- 1 | from .bbox import * # noqa: F401, F403 2 | from .evaluation import * # noqa: F401, F403 3 | from .hooks import * # noqa: F401, F403 4 | from .lr import * # noqa: F401, F403 5 | from .optimizer import * # noqa: F401, F403 6 | from .runner import * # noqa: F401, F403 7 | -------------------------------------------------------------------------------- /mmaction/models/recognizers/__init__.py: -------------------------------------------------------------------------------- 1 | from .audio_recognizer import AudioRecognizer 2 | from .base import BaseRecognizer 3 | from .recognizer2d import Recognizer2D 4 | from .recognizer3d import Recognizer3D 5 | 6 | __all__ = ['BaseRecognizer', 'Recognizer2D', 'Recognizer3D', 'AudioRecognizer'] 7 | -------------------------------------------------------------------------------- /mmaction/apis/__init__.py: -------------------------------------------------------------------------------- 1 | from .inference import inference_recognizer, init_recognizer 2 | from .test import multi_gpu_test, single_gpu_test 3 | from .train import train_model 4 | 5 | __all__ = [ 6 | 'train_model', 'init_recognizer', 'inference_recognizer', 'multi_gpu_test', 7 | 'single_gpu_test' 8 | ] 9 | -------------------------------------------------------------------------------- /mmaction/core/optimizer/copy_of_sgd.py: -------------------------------------------------------------------------------- 1 | from mmcv.runner import OPTIMIZERS 2 | from torch.optim import SGD 3 | 4 | 5 | @OPTIMIZERS.register_module() 6 | class CopyOfSGD(SGD): 7 | """A clone of torch.optim.SGD. 8 | 9 | A customized optimizer could be defined like CopyOfSGD. You may derive from 10 | built-in optimizers in torch.optim, or directly implement a new optimizer. 11 | """ 12 | -------------------------------------------------------------------------------- /mmaction/utils/collect_env.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import collect_env as collect_basic_env 2 | from mmcv.utils import get_git_hash 3 | 4 | import mmaction 5 | 6 | 7 | def collect_env(): 8 | env_info = collect_basic_env() 9 | env_info['MMAction2'] = ( 10 | mmaction.__version__ + '+' + get_git_hash(digits=7)) 11 | return env_info 12 | 13 | 14 | if __name__ == '__main__': 15 | for name, val in collect_env().items(): 16 | print(f'{name}: {val}') 17 | -------------------------------------------------------------------------------- /mmaction/localization/__init__.py: -------------------------------------------------------------------------------- 1 | from .bsn_utils import generate_bsp_feature, generate_candidate_proposals 2 | from .proposal_utils import soft_nms, temporal_iop, temporal_iou 3 | from .ssn_utils import (eval_ap, load_localize_proposal_file, 4 | perform_regression, temporal_nms) 5 | 6 | __all__ = [ 7 | 'generate_candidate_proposals', 'generate_bsp_feature', 'temporal_iop', 8 | 'temporal_iou', 'soft_nms', 'load_localize_proposal_file', 9 | 'perform_regression', 'temporal_nms', 'eval_ap' 10 | ] 11 | -------------------------------------------------------------------------------- /mmaction/__init__.py: -------------------------------------------------------------------------------- 1 | import mmcv 2 | from mmcv import digit_version 3 | 4 | from .version import __version__ 5 | 6 | mmcv_minimum_version = '1.2.6' 7 | mmcv_maximum_version = '1.6.1' #1.3.2 8 | mmcv_version = digit_version(mmcv.__version__) 9 | 10 | assert (digit_version(mmcv_minimum_version) <= mmcv_version 11 | <= digit_version(mmcv_maximum_version)), \ 12 | f'MMCV=={mmcv.__version__} is used but incompatible. ' \ 13 | f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' 14 | 15 | __all__ = ['__version__'] 16 | -------------------------------------------------------------------------------- /mmaction/version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Open-MMLab. All rights reserved. 2 | 3 | __version__ = '0.12.0' 4 | 5 | 6 | def parse_version_info(version_str): 7 | version_info = [] 8 | for x in version_str.split('.'): 9 | if x.isdigit(): 10 | version_info.append(int(x)) 11 | elif x.find('rc') != -1: 12 | patch_version = x.split('rc') 13 | version_info.append(int(patch_version[0])) 14 | version_info.append(f'rc{patch_version[1]}') 15 | return tuple(version_info) 16 | 17 | 18 | version_info = parse_version_info(__version__) 19 | -------------------------------------------------------------------------------- /mmaction/models/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import BaseWeightedLoss 2 | from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss 3 | from .bmn_loss import BMNLoss 4 | from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss 5 | from .hvu_loss import HVULoss 6 | from .nll_loss import NLLLoss 7 | from .ohem_hinge_loss import OHEMHingeLoss 8 | from .ssn_loss import SSNLoss 9 | 10 | __all__ = [ 11 | 'BaseWeightedLoss', 'CrossEntropyLoss', 'NLLLoss', 'BCELossWithLogits', 12 | 'BinaryLogisticRegressionLoss', 'BMNLoss', 'OHEMHingeLoss', 'SSNLoss', 13 | 'HVULoss' 14 | ] 15 | -------------------------------------------------------------------------------- /mmaction/models/heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .audio_tsn_head import AudioTSNHead 2 | from .base import BaseHead 3 | from .bbox_head import BBoxHeadAVA 4 | from .i3d_head import I3DHead 5 | from .roi_head import AVARoIHead 6 | from .slowfast_head import SlowFastHead 7 | from .ssn_head import SSNHead 8 | from .tpn_head import TPNHead 9 | from .tsm_head import TSMHead 10 | from .tsn_head import TSNHead 11 | from .x3d_head import X3DHead 12 | 13 | __all__ = [ 14 | 'TSNHead', 'I3DHead', 'BaseHead', 'TSMHead', 'SlowFastHead', 'SSNHead', 15 | 'TPNHead', 'AudioTSNHead', 'X3DHead', 'BBoxHeadAVA', 'AVARoIHead' 16 | ] 17 | -------------------------------------------------------------------------------- /mmaction/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .collect_env import collect_env 2 | from .decorators import import_module_error_class, import_module_error_func 3 | from .gradcam_utils import GradCAM 4 | from .logger import get_root_logger 5 | from .misc import get_random_string, get_shm_dir, get_thread_id 6 | from .precise_bn import PreciseBNHook 7 | 8 | from .module_hooks import register_module_hooks 9 | from .module_hooks import STN 10 | 11 | __all__ = [ 12 | 'get_root_logger', 'collect_env', 'get_random_string', 'get_thread_id', 13 | 'get_shm_dir', 'GradCAM', 'PreciseBNHook', 'import_module_error_class', 14 | 'import_module_error_func', 'register_module_hooks','STN' 15 | ] 16 | -------------------------------------------------------------------------------- /mmaction/utils/misc.py: -------------------------------------------------------------------------------- 1 | import ctypes 2 | import random 3 | import string 4 | 5 | 6 | def get_random_string(length=15): 7 | """Get random string with letters and digits. 8 | 9 | Args: 10 | length (int): Length of random string. Default: 15. 11 | """ 12 | return ''.join( 13 | random.choice(string.ascii_letters + string.digits) 14 | for _ in range(length)) 15 | 16 | 17 | def get_thread_id(): 18 | """Get current thread id.""" 19 | # use ctype to find thread id 20 | thread_id = ctypes.CDLL('libc.so.6').syscall(186) 21 | return thread_id 22 | 23 | 24 | def get_shm_dir(): 25 | """Get shm dir for temporary usage.""" 26 | return '/dev/shm' 27 | -------------------------------------------------------------------------------- /mmaction/models/losses/nll_loss.py: -------------------------------------------------------------------------------- 1 | import torch.nn.functional as F 2 | 3 | from ..registry import LOSSES 4 | from .base import BaseWeightedLoss 5 | 6 | 7 | @LOSSES.register_module() 8 | class NLLLoss(BaseWeightedLoss): 9 | """NLL Loss. 10 | 11 | It will calculate NLL loss given cls_score and label. 12 | """ 13 | 14 | def _forward(self, cls_score, label, **kwargs): 15 | """Forward function. 16 | 17 | Args: 18 | cls_score (torch.Tensor): The class score. 19 | label (torch.Tensor): The ground truth label. 20 | kwargs: Any keyword argument to be used to calculate nll loss. 21 | 22 | Returns: 23 | torch.Tensor: The returned nll loss. 24 | """ 25 | loss_cls = F.nll_loss(cls_score, label, **kwargs) 26 | return loss_cls 27 | -------------------------------------------------------------------------------- /mmaction/core/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | from .accuracy import (average_precision_at_temporal_iou, 2 | average_recall_at_avg_proposals, confusion_matrix, 3 | get_weighted_score, interpolated_precision_recall, 4 | mean_average_precision, mean_class_accuracy, 5 | mmit_mean_average_precision, pairwise_temporal_iou, 6 | softmax, top_k_accuracy) 7 | from .eval_detection import ActivityNetLocalization 8 | from .eval_hooks import DistEvalHook, EvalHook 9 | 10 | __all__ = [ 11 | 'DistEvalHook', 'EvalHook', 'top_k_accuracy', 'mean_class_accuracy', 12 | 'confusion_matrix', 'mean_average_precision', 'get_weighted_score', 13 | 'average_recall_at_avg_proposals', 'pairwise_temporal_iou', 14 | 'average_precision_at_temporal_iou', 'ActivityNetLocalization', 'softmax', 15 | 'interpolated_precision_recall', 'mmit_mean_average_precision' 16 | ] 17 | -------------------------------------------------------------------------------- /mmaction/datasets/dataset_wrappers.py: -------------------------------------------------------------------------------- 1 | from .registry import DATASETS 2 | 3 | 4 | @DATASETS.register_module() 5 | class RepeatDataset: 6 | """A wrapper of repeated dataset. 7 | 8 | The length of repeated dataset will be ``times`` larger than the original 9 | dataset. This is useful when the data loading time is long but the dataset 10 | is small. Using RepeatDataset can reduce the data loading time between 11 | epochs. 12 | 13 | Args: 14 | dataset (:obj:`Dataset`): The dataset to be repeated. 15 | times (int): Repeat times. 16 | """ 17 | 18 | def __init__(self, dataset, times): 19 | self.dataset = dataset 20 | self.times = times 21 | 22 | self._ori_len = len(self.dataset) 23 | 24 | def __getitem__(self, idx): 25 | """Get data.""" 26 | return self.dataset[idx % self._ori_len] 27 | 28 | def __len__(self): 29 | """Length after repetition.""" 30 | return self.times * self._ori_len 31 | -------------------------------------------------------------------------------- /mmaction/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .activitynet_dataset import ActivityNetDataset 2 | from .audio_dataset import AudioDataset 3 | from .audio_feature_dataset import AudioFeatureDataset 4 | from .audio_visual_dataset import AudioVisualDataset 5 | from .ava_dataset import AVADataset 6 | from .base import BaseDataset 7 | from .builder import build_dataloader, build_dataset 8 | from .dataset_wrappers import RepeatDataset 9 | from .hvu_dataset import HVUDataset 10 | from .image_dataset import ImageDataset 11 | from .rawframe_dataset import RawframeDataset 12 | from .rawvideo_dataset import RawVideoDataset 13 | from .ssn_dataset import SSNDataset 14 | from .video_dataset import VideoDataset 15 | 16 | __all__ = [ 17 | 'VideoDataset', 'build_dataloader', 'build_dataset', 'RepeatDataset', 18 | 'RawframeDataset', 'BaseDataset', 'ActivityNetDataset', 'SSNDataset', 19 | 'HVUDataset', 'AudioDataset', 'AudioFeatureDataset', 'ImageDataset', 20 | 'RawVideoDataset', 'AVADataset', 'AudioVisualDataset' 21 | ] 22 | -------------------------------------------------------------------------------- /mmaction/utils/logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from mmcv.utils import get_logger 4 | 5 | 6 | def get_root_logger(log_file=None, log_level=logging.INFO): 7 | """Use ``get_logger`` method in mmcv to get the root logger. 8 | 9 | The logger will be initialized if it has not been initialized. By default a 10 | StreamHandler will be added. If ``log_file`` is specified, a FileHandler 11 | will also be added. The name of the root logger is the top-level package 12 | name, e.g., "mmaction". 13 | 14 | Args: 15 | log_file (str | None): The log filename. If specified, a FileHandler 16 | will be added to the root logger. 17 | log_level (int): The root logger level. Note that only the process of 18 | rank 0 is affected, while other processes will set the level to 19 | "Error" and be silent most of the time. 20 | 21 | Returns: 22 | :obj:`logging.Logger`: The root logger. 23 | """ 24 | return get_logger(__name__.split('.')[0], log_file, log_level) 25 | -------------------------------------------------------------------------------- /mmaction/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | from .c3d import C3D 2 | from .mobilenet_v2 import MobileNetV2 3 | from .mobilenet_v2_tsm import MobileNetV2TSM 4 | from .resnet import ResNet 5 | from .resnet2plus1d import ResNet2Plus1d 6 | from .resnet3d import ResNet3d, ResNet3dLayer 7 | from .resnet3d_csn import ResNet3dCSN 8 | from .resnet3d_slowfast import ResNet3dSlowFast 9 | from .resnet3d_slowonly import ResNet3dSlowOnly 10 | from .resnet_audio import ResNetAudio 11 | from .resnet_tin import ResNetTIN 12 | from .resnet_tsm import ResNetTSM 13 | from .tanet import TANet 14 | from .x3d import X3D 15 | 16 | from .resnet3d_stn import ResNet3d_stn, ResNet3dLayer_stn 17 | from .resnet3d_slowfast_stn import ResNet3dSlowFast_stn 18 | 19 | __all__ = [ 20 | 'C3D', 'ResNet', 'ResNet3d', 'ResNetTSM', 'ResNet2Plus1d', 21 | 'ResNet3dSlowFast', 'ResNet3dSlowOnly', 'ResNet3dCSN', 'ResNetTIN', 'X3D', 22 | 'ResNetAudio', 'ResNet3dLayer', 'MobileNetV2TSM', 'MobileNetV2', 'TANet', 23 | 'ResNet3d_stn','ResNet3dLayer_stn','ResNet3dSlowFast_stn' 24 | ] 25 | -------------------------------------------------------------------------------- /mmaction/utils/decorators.py: -------------------------------------------------------------------------------- 1 | from types import MethodType 2 | 3 | 4 | def import_module_error_func(module_name): 5 | """When a function is imported incorrectly due to a missing module, raise 6 | an import error when the function is called.""" 7 | 8 | def decorate(func): 9 | 10 | def new_func(*args, **kwargs): 11 | raise ImportError( 12 | f'Please install {module_name} to use {func.__name__}.') 13 | return func(*args, **kwargs) 14 | 15 | return new_func 16 | 17 | return decorate 18 | 19 | 20 | def import_module_error_class(module_name): 21 | """When a class is imported incorrectly due to a missing module, raise an 22 | import error when the class is instantiated.""" 23 | 24 | def decorate(cls): 25 | 26 | def import_error_init(*args, **kwargs): 27 | raise ImportError( 28 | f'Please install {module_name} to use {cls.__name__}.') 29 | 30 | cls.__init__ = MethodType(import_error_init, cls) 31 | return cls 32 | 33 | return decorate 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Intelligent-elderly-care-system 2 | **Introduction** 3 | 4 | This is a repository platform for elderly abnormal behavior care, which can detect the abnormal behaviors including cough, headache, chestpain, backpain,fall,sit down and stand up. Combining with sit down and stand up can determine the sedentary time of elder. In addition, this platform provides the function of recording abnormal information, such as the moment when the behavior occurs, the duration, etc. It should be noted that the repository is a showcase for demonstrations and research. You can run this real-time platform acccording to the following preparation: 5 | 6 | **Configure** 7 | 8 | In hardware: Windows10-64 bit, NVIDIA GTX2060, CUDA10.1 9 | 10 | In sofware: Anaconda3, Python3.7 11 | 12 | **Run** 13 | 14 | There are other open source library shoud be installed, you can install these as the command in your computer terminal: 15 | 16 | ``conda create -n test python=3.7`` 17 | 18 | ``conda activate test`` 19 | 20 | ``pip install -r requirement.txt`` 21 | 22 | Then, download the weights file of the model from google cloud according to the link below, and put it into folder"/xx/works_dir/": 23 | ``https://drive.google.com/file/d/1edWlk2reHC1gqkuNzVfbMR4pkDX1G7MS/view?usp=sharing`` 24 | 25 | Last, the platform can be shown by running the py file: 26 | 27 | ``python demo.py`` 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mmaction/models/losses/base.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | import torch.nn as nn 4 | 5 | 6 | class BaseWeightedLoss(nn.Module, metaclass=ABCMeta): 7 | """Base class for loss. 8 | 9 | All subclass should overwrite the ``_forward()`` method which returns the 10 | normal loss without loss weights. 11 | 12 | Args: 13 | loss_weight (float): Factor scalar multiplied on the loss. 14 | Default: 1.0. 15 | """ 16 | 17 | def __init__(self, loss_weight=1.0): 18 | super().__init__() 19 | self.loss_weight = loss_weight 20 | 21 | @abstractmethod 22 | def _forward(self, *args, **kwargs): 23 | pass 24 | 25 | def forward(self, *args, **kwargs): 26 | """Defines the computation performed at every call. 27 | 28 | Args: 29 | *args: The positional arguments for the corresponding 30 | loss. 31 | **kwargs: The keyword arguments for the corresponding 32 | loss. 33 | 34 | Returns: 35 | torch.Tensor: The calculated loss. 36 | """ 37 | ret = self._forward(*args, **kwargs) 38 | if isinstance(ret, dict): 39 | for k in ret: 40 | if 'loss' in k: 41 | ret[k] *= self.loss_weight 42 | else: 43 | ret *= self.loss_weight 44 | return ret 45 | -------------------------------------------------------------------------------- /mmaction/core/bbox/transforms.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def bbox2result(bboxes, labels, num_classes, thr=0.01): 5 | """Convert detection results to a list of numpy arrays. 6 | 7 | Args: 8 | bboxes (Tensor): shape (n, 4) 9 | labels (Tensor): shape (n, #num_classes) 10 | num_classes (int): class number, including background class 11 | thr (float): The score threshold used when converting predictions to 12 | detection results 13 | Returns: 14 | list(ndarray): bbox results of each class 15 | """ 16 | if bboxes.shape[0] == 0: 17 | return list(np.zeros((num_classes - 1, 0, 5), dtype=np.float32)) 18 | else: 19 | bboxes = bboxes.cpu().numpy() 20 | labels = labels.cpu().numpy() 21 | 22 | # We only handle multilabel now 23 | assert labels.shape[-1] > 1 24 | 25 | scores = labels # rename for clarification 26 | thr = (thr, ) * num_classes if isinstance(thr, float) else thr 27 | assert scores.shape[1] == num_classes 28 | assert len(thr) == num_classes 29 | 30 | result = [] 31 | for i in range(num_classes - 1): 32 | where = scores[:, i + 1] > thr[i + 1] 33 | result.append( 34 | np.concatenate((bboxes[where, :4], scores[where, i + 1:i + 2]), 35 | axis=1)) 36 | return result 37 | -------------------------------------------------------------------------------- /mmaction/core/bbox/bbox_target.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn.functional as F 3 | 4 | 5 | def bbox_target(pos_bboxes_list, neg_bboxes_list, gt_labels, cfg): 6 | """Generate classification targets for bboxes. 7 | 8 | Args: 9 | pos_bboxes_list (list[Tensor]): Positive bboxes list. 10 | neg_bboxes_list (list[Tensor]): Negative bboxes list. 11 | gt_labels (list[Tensor]): Groundtruth classification label list. 12 | cfg (Config): RCNN config. 13 | 14 | Returns: 15 | (Tensor, Tensor): Label and label_weight for bboxes. 16 | """ 17 | labels, label_weights = [], [] 18 | pos_weight = 1.0 if cfg.pos_weight <= 0 else cfg.pos_weight 19 | 20 | assert len(pos_bboxes_list) == len(neg_bboxes_list) == len(gt_labels) 21 | length = len(pos_bboxes_list) 22 | 23 | for i in range(length): 24 | pos_bboxes = pos_bboxes_list[i] 25 | neg_bboxes = neg_bboxes_list[i] 26 | gt_label = gt_labels[i] 27 | 28 | num_pos = pos_bboxes.size(0) 29 | num_neg = neg_bboxes.size(0) 30 | num_samples = num_pos + num_neg 31 | label = F.pad(gt_label, (0, 0, 0, num_neg)) 32 | label_weight = pos_bboxes.new_zeros(num_samples) 33 | label_weight[:num_pos] = pos_weight 34 | label_weight[-num_neg:] = 1. 35 | 36 | labels.append(label) 37 | label_weights.append(label_weight) 38 | 39 | labels = torch.cat(labels, 0) 40 | label_weights = torch.cat(label_weights, 0) 41 | return labels, label_weights 42 | -------------------------------------------------------------------------------- /mmaction/models/backbones/mobilenet_v2_tsm.py: -------------------------------------------------------------------------------- 1 | from ..registry import BACKBONES 2 | from .mobilenet_v2 import InvertedResidual, MobileNetV2 3 | from .resnet_tsm import TemporalShift 4 | 5 | 6 | @BACKBONES.register_module() 7 | class MobileNetV2TSM(MobileNetV2): 8 | """MobileNetV2 backbone for TSM. 9 | 10 | Args: 11 | num_segments (int): Number of frame segments. Default: 8. 12 | is_shift (bool): Whether to make temporal shift in reset layers. 13 | Default: True. 14 | shift_div (int): Number of div for shift. Default: 8. 15 | **kwargs (keyword arguments, optional): Arguments for MobilNetV2. 16 | """ 17 | 18 | def __init__(self, num_segments=8, is_shift=True, shift_div=8, **kwargs): 19 | super().__init__(**kwargs) 20 | self.num_segments = num_segments 21 | self.is_shift = is_shift 22 | self.shift_div = shift_div 23 | 24 | def make_temporal_shift(self): 25 | """Make temporal shift for some layers.""" 26 | for m in self.modules(): 27 | if isinstance(m, InvertedResidual) and \ 28 | len(m.conv) == 3 and m.use_res_connect: 29 | m.conv[0] = TemporalShift( 30 | m.conv[0], 31 | num_segments=self.num_segments, 32 | shift_div=self.shift_div, 33 | ) 34 | 35 | def init_weights(self): 36 | """Initiate the parameters either from existing checkpoint or from 37 | scratch.""" 38 | super().init_weights() 39 | if self.is_shift: 40 | self.make_temporal_shift() 41 | -------------------------------------------------------------------------------- /mmaction/datasets/image_dataset.py: -------------------------------------------------------------------------------- 1 | from .registry import DATASETS 2 | from .video_dataset import VideoDataset 3 | 4 | 5 | @DATASETS.register_module() 6 | class ImageDataset(VideoDataset): 7 | """Image dataset for action recognition, used in the Project OmniSource. 8 | 9 | The dataset loads image list and apply specified transforms to return a 10 | dict containing the image tensors and other information. For the 11 | ImageDataset 12 | 13 | The ann_file is a text file with multiple lines, and each line indicates 14 | the image path and the image label, which are split with a whitespace. 15 | Example of a annotation file: 16 | 17 | .. code-block:: txt 18 | 19 | path/to/image1.jpg 1 20 | path/to/image2.jpg 1 21 | path/to/image3.jpg 2 22 | path/to/image4.jpg 2 23 | path/to/image5.jpg 3 24 | path/to/image6.jpg 3 25 | 26 | Example of a multi-class annotation file: 27 | 28 | .. code-block:: txt 29 | 30 | path/to/image1.jpg 1 3 5 31 | path/to/image2.jpg 1 2 32 | path/to/image3.jpg 2 33 | path/to/image4.jpg 2 4 6 8 34 | path/to/image5.jpg 3 35 | path/to/image6.jpg 3 36 | 37 | Args: 38 | ann_file (str): Path to the annotation file. 39 | pipeline (list[dict | callable]): A sequence of data transforms. 40 | **kwargs: Keyword arguments for ``BaseDataset``. 41 | """ 42 | 43 | def __init__(self, ann_file, pipeline, **kwargs): 44 | super().__init__(ann_file, pipeline, start_index=None, **kwargs) 45 | # use `start_index=None` to indicate it is for `ImageDataset` 46 | -------------------------------------------------------------------------------- /mmaction/core/lr/tin_lr_hook.py: -------------------------------------------------------------------------------- 1 | from mmcv.runner import HOOKS, LrUpdaterHook 2 | from mmcv.runner.hooks.lr_updater import annealing_cos 3 | 4 | 5 | @HOOKS.register_module() 6 | class TINLrUpdaterHook(LrUpdaterHook): 7 | 8 | def __init__(self, min_lr, **kwargs): 9 | self.min_lr = min_lr 10 | super(TINLrUpdaterHook, self).__init__(**kwargs) 11 | 12 | def get_warmup_lr(self, cur_iters): 13 | if self.warmup == 'linear': 14 | # 'linear' warmup is rewritten according to TIN repo: 15 | # https://github.com/deepcs233/TIN/blob/master/main.py#L409-L412 16 | k = (cur_iters / self.warmup_iters) * ( 17 | 1 - self.warmup_ratio) + self.warmup_ratio 18 | warmup_lr = [_lr * k for _lr in self.regular_lr] 19 | elif self.warmup == 'constant': 20 | warmup_lr = [_lr * self.warmup_ratio for _lr in self.regular_lr] 21 | elif self.warmup == 'exp': 22 | k = self.warmup_ratio**(1 - cur_iters / self.warmup_iters) 23 | warmup_lr = [_lr * k for _lr in self.regular_lr] 24 | return warmup_lr 25 | 26 | def get_lr(self, runner, base_lr): 27 | if self.by_epoch: 28 | progress = runner.epoch 29 | max_progress = runner.max_epochs 30 | else: 31 | progress = runner.iter 32 | max_progress = runner.max_iters 33 | 34 | target_lr = self.min_lr 35 | if self.warmup is not None: 36 | progress = progress - self.warmup_iters 37 | max_progress = max_progress - self.warmup_iters 38 | factor = progress / max_progress 39 | return annealing_cos(base_lr, target_lr, factor) 40 | -------------------------------------------------------------------------------- /mmaction/models/backbones/resnet2plus1d.py: -------------------------------------------------------------------------------- 1 | from ..registry import BACKBONES 2 | from .resnet3d import ResNet3d 3 | 4 | 5 | @BACKBONES.register_module() 6 | class ResNet2Plus1d(ResNet3d): 7 | """ResNet (2+1)d backbone. 8 | 9 | This model is proposed in `A Closer Look at Spatiotemporal Convolutions for 10 | Action Recognition `_ 11 | """ 12 | 13 | def __init__(self, *args, **kwargs): 14 | super().__init__(*args, **kwargs) 15 | assert self.pretrained2d is False 16 | assert self.conv_cfg['type'] == 'Conv2plus1d' 17 | 18 | def _freeze_stages(self): 19 | """Prevent all the parameters from being optimized before 20 | ``self.frozen_stages``.""" 21 | if self.frozen_stages >= 0: 22 | self.conv1.eval() 23 | for param in self.conv1.parameters(): 24 | param.requires_grad = False 25 | 26 | for i in range(1, self.frozen_stages + 1): 27 | m = getattr(self, f'layer{i}') 28 | m.eval() 29 | for param in m.parameters(): 30 | param.requires_grad = False 31 | 32 | def forward(self, x): 33 | """Defines the computation performed at every call. 34 | 35 | Args: 36 | x (torch.Tensor): The input data. 37 | 38 | Returns: 39 | torch.Tensor: The feature of the input 40 | samples extracted by the backbone. 41 | """ 42 | x = self.conv1(x) 43 | x = self.maxpool(x) 44 | for layer_name in self.res_layers: 45 | res_layer = getattr(self, layer_name) 46 | # no pool2 in R(2+1)d 47 | x = res_layer(x) 48 | 49 | return x 50 | -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/compose.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Sequence 2 | 3 | from mmcv.utils import build_from_cfg 4 | 5 | from ..registry import PIPELINES 6 | 7 | 8 | @PIPELINES.register_module() 9 | class Compose: 10 | """Compose a data pipeline with a sequence of transforms. 11 | 12 | Args: 13 | transforms (list[dict | callable]): 14 | Either config dicts of transforms or transform objects. 15 | """ 16 | 17 | def __init__(self, transforms): 18 | assert isinstance(transforms, Sequence) 19 | self.transforms = [] 20 | for transform in transforms: 21 | if isinstance(transform, dict): 22 | transform = build_from_cfg(transform, PIPELINES) 23 | self.transforms.append(transform) 24 | elif callable(transform): 25 | self.transforms.append(transform) 26 | else: 27 | raise TypeError(f'transform must be callable or a dict, ' 28 | f'but got {type(transform)}') 29 | 30 | def __call__(self, data): 31 | """Call function to apply transforms sequentially. 32 | 33 | Args: 34 | data (dict): A result dict contains the data to transform. 35 | 36 | Returns: 37 | dict: Transformed data. 38 | """ 39 | 40 | for t in self.transforms: 41 | data = t(data) 42 | if data is None: 43 | return None 44 | return data 45 | 46 | def __repr__(self): 47 | format_string = self.__class__.__name__ + '(' 48 | for t in self.transforms: 49 | format_string += '\n' 50 | format_string += ' {0}'.format(t) 51 | format_string += '\n)' 52 | return format_string 53 | -------------------------------------------------------------------------------- /mmaction/models/backbones/resnet3d_slowonly.py: -------------------------------------------------------------------------------- 1 | from ..registry import BACKBONES 2 | from .resnet3d_slowfast import ResNet3dPathway 3 | 4 | try: 5 | from mmdet.models.builder import BACKBONES as MMDET_BACKBONES 6 | mmdet_imported = True 7 | except (ImportError, ModuleNotFoundError): 8 | mmdet_imported = False 9 | 10 | 11 | @BACKBONES.register_module() 12 | class ResNet3dSlowOnly(ResNet3dPathway): 13 | """SlowOnly backbone based on ResNet3dPathway. 14 | 15 | Args: 16 | *args (arguments): Arguments same as :class:`ResNet3dPathway`. 17 | conv1_kernel (Sequence[int]): Kernel size of the first conv layer. 18 | Default: (1, 7, 7). 19 | conv1_stride_t (int): Temporal stride of the first conv layer. 20 | Default: 1. 21 | pool1_stride_t (int): Temporal stride of the first pooling layer. 22 | Default: 1. 23 | inflate (Sequence[int]): Inflate Dims of each block. 24 | Default: (0, 0, 1, 1). 25 | **kwargs (keyword arguments): Keywords arguments for 26 | :class:`ResNet3dPathway`. 27 | """ 28 | 29 | def __init__(self, 30 | *args, 31 | lateral=False, 32 | conv1_kernel=(1, 7, 7), 33 | conv1_stride_t=1, 34 | pool1_stride_t=1, 35 | inflate=(0, 0, 1, 1), 36 | with_pool2=False, 37 | **kwargs): 38 | super().__init__( 39 | *args, 40 | lateral=lateral, 41 | conv1_kernel=conv1_kernel, 42 | conv1_stride_t=conv1_stride_t, 43 | pool1_stride_t=pool1_stride_t, 44 | inflate=inflate, 45 | with_pool2=with_pool2, 46 | **kwargs) 47 | 48 | assert not self.lateral 49 | 50 | 51 | if mmdet_imported: 52 | MMDET_BACKBONES.register_module()(ResNet3dSlowOnly) 53 | -------------------------------------------------------------------------------- /mmaction/models/localizers/utils/post_processing.py: -------------------------------------------------------------------------------- 1 | from mmaction.localization import soft_nms 2 | 3 | 4 | def post_processing(result, video_info, soft_nms_alpha, soft_nms_low_threshold, 5 | soft_nms_high_threshold, post_process_top_k, 6 | feature_extraction_interval): 7 | """Post process for temporal proposals generation. 8 | 9 | Args: 10 | result (np.ndarray): Proposals generated by network. 11 | video_info (dict): Meta data of video. Required keys are 12 | 'duration_frame', 'duration_second'. 13 | soft_nms_alpha (float): Alpha value of Gaussian decaying function. 14 | soft_nms_low_threshold (float): Low threshold for soft nms. 15 | soft_nms_high_threshold (float): High threshold for soft nms. 16 | post_process_top_k (int): Top k values to be considered. 17 | feature_extraction_interval (int): Interval used in feature extraction. 18 | 19 | Returns: 20 | list[dict]: The updated proposals, e.g. 21 | [{'score': 0.9, 'segment': [0, 1]}, 22 | {'score': 0.8, 'segment': [0, 2]}, 23 | ...]. 24 | """ 25 | if len(result) > 1: 26 | result = soft_nms(result, soft_nms_alpha, soft_nms_low_threshold, 27 | soft_nms_high_threshold, post_process_top_k) 28 | 29 | result = result[result[:, -1].argsort()[::-1]] 30 | video_duration = float( 31 | video_info['duration_frame'] // feature_extraction_interval * 32 | feature_extraction_interval 33 | ) / video_info['duration_frame'] * video_info['duration_second'] 34 | proposal_list = [] 35 | 36 | for j in range(min(post_process_top_k, len(result))): 37 | proposal = {} 38 | proposal['score'] = float(result[j, -1]) 39 | proposal['segment'] = [ 40 | max(0, result[j, 0]) * video_duration, 41 | min(1, result[j, 1]) * video_duration 42 | ] 43 | proposal_list.append(proposal) 44 | return proposal_list 45 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | addict==2.4.0 2 | appdirs==1.4.4 3 | atomicwrites==1.4.1 4 | attrs==21.4.0 5 | audioread==2.1.9 6 | av==9.2.0 7 | certifi @ file:///C:/Windows/TEMP/abs_e9b7158a-aa56-4a5b-87b6-c00d295b01fanefpc8_o/croots/recipe/certifi_1655968940823/work/certifi 8 | cffi==1.15.1 9 | charset-normalizer==2.1.0 10 | click==8.1.3 11 | colorama==0.4.5 12 | coloredlogs==15.0.1 13 | coverage==6.4.2 14 | cycler==0.11.0 15 | decorator==4.4.2 16 | decord==0.6.0 17 | flake8==4.0.1 18 | flatbuffers==2.0 19 | fonttools==4.34.4 20 | humanfriendly==10.0 21 | idna==3.3 22 | imageio==2.20.0 23 | imageio-ffmpeg==0.4.7 24 | imgaug==0.4.0 25 | importlib-metadata==4.2.0 26 | iniconfig==1.1.1 27 | interrogate==1.5.0 28 | isort==4.3.21 29 | joblib==1.1.0 30 | kiwisolver==1.4.4 31 | librosa==0.9.2 32 | llvmlite==0.39.0 33 | matplotlib==3.5.2 34 | mccabe==0.6.1 35 | mmaction2==0.12.0 36 | mmcv==1.6.1 37 | moviepy==1.0.3 38 | mpmath==1.2.1 39 | networkx==2.6.3 40 | numba==0.56.0 41 | numpy==1.21.6 42 | onnx==1.12.0 43 | onnxruntime==1.12.0 44 | opencv-contrib-python==4.6.0.66 45 | opencv-python==4.6.0.66 46 | packaging==21.3 47 | Pillow==9.2.0 48 | pluggy==1.0.0 49 | pooch==1.6.0 50 | proglog==0.1.10 51 | protobuf==3.20.1 52 | py==1.11.0 53 | pycodestyle==2.8.0 54 | pycparser==2.21 55 | pyflakes==2.4.0 56 | pyparsing==3.0.9 57 | PyQt5==5.15.7 58 | PyQt5-Qt5==5.15.2 59 | PyQt5-sip==12.11.0 60 | PyQtChart==5.15.6 61 | PyQtChart-Qt5==5.15.2 62 | pyreadline==2.1 63 | pytest==7.1.2 64 | pytest-runner==6.0.0 65 | python-dateutil==2.8.2 66 | PyTurboJPEG==1.6.7 67 | PyWavelets==1.3.0 68 | PyYAML==6.0 69 | regex==2022.7.25 70 | requests==2.28.1 71 | resampy==0.3.1 72 | scikit-image==0.19.3 73 | scikit-learn==1.0.2 74 | scipy==1.7.3 75 | Shapely==1.8.2 76 | sip==4.19.13 77 | six==1.16.0 78 | SoundFile==0.10.3.post1 79 | sympy==1.10.1 80 | tabulate==0.8.10 81 | threadpoolctl==3.1.0 82 | tifffile==2021.11.2 83 | toml==0.10.2 84 | tomli==2.0.1 85 | torch==1.8.1+cu101 86 | torchaudio==0.8.1 87 | torchvision==0.9.1+cu101 88 | tqdm==4.64.0 89 | typing_extensions==4.3.0 90 | urllib3==1.26.11 91 | wincertstore==0.2 92 | xdoctest==1.0.1 93 | yapf==0.32.0 94 | zipp==3.8.1 95 | -------------------------------------------------------------------------------- /mmaction/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .backbones import (C3D, X3D, MobileNetV2, MobileNetV2TSM, ResNet, 2 | ResNet2Plus1d, ResNet3d, ResNet3dCSN, ResNet3dLayer, 3 | ResNet3dSlowFast, ResNet3dSlowOnly, ResNetAudio, 4 | ResNetTIN, ResNetTSM, TANet) 5 | from .builder import (DETECTORS, build_backbone, build_detector, build_head, 6 | build_localizer, build_loss, build_model, build_neck, 7 | build_recognizer) 8 | from .common import TAM, Conv2plus1d, ConvAudio 9 | from .heads import (AudioTSNHead, AVARoIHead, BaseHead, BBoxHeadAVA, I3DHead, 10 | SlowFastHead, TPNHead, TSMHead, TSNHead, X3DHead) 11 | from .localizers import BMN, PEM, TEM 12 | from .losses import (BCELossWithLogits, BinaryLogisticRegressionLoss, BMNLoss, 13 | CrossEntropyLoss, HVULoss, NLLLoss, OHEMHingeLoss, 14 | SSNLoss) 15 | from .necks import TPN 16 | from .recognizers import (AudioRecognizer, BaseRecognizer, recognizer2d, 17 | recognizer3d) 18 | from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, RECOGNIZERS 19 | from .roi_extractors import SingleRoIExtractor3D 20 | 21 | __all__ = [ 22 | 'BACKBONES', 'HEADS', 'RECOGNIZERS', 'build_recognizer', 'build_head', 23 | 'build_backbone', 'recognizer2d', 'recognizer3d', 'C3D', 'ResNet', 24 | 'ResNet3d', 'ResNet2Plus1d', 'I3DHead', 'TSNHead', 'TSMHead', 'BaseHead', 25 | 'BaseRecognizer', 'LOSSES', 'CrossEntropyLoss', 'NLLLoss', 'HVULoss', 26 | 'ResNetTSM', 'ResNet3dSlowFast', 'SlowFastHead', 'Conv2plus1d', 27 | 'ResNet3dSlowOnly', 'BCELossWithLogits', 'LOCALIZERS', 'build_localizer', 28 | 'PEM', 'TAM', 'TEM', 'BinaryLogisticRegressionLoss', 'BMN', 'BMNLoss', 29 | 'build_model', 'OHEMHingeLoss', 'SSNLoss', 'ResNet3dCSN', 'ResNetTIN', 30 | 'TPN', 'TPNHead', 'build_loss', 'build_neck', 'AudioRecognizer', 31 | 'AudioTSNHead', 'X3D', 'X3DHead', 'ResNet3dLayer', 'DETECTORS', 32 | 'SingleRoIExtractor3D', 'BBoxHeadAVA', 'ResNetAudio', 'build_detector', 33 | 'ConvAudio', 'AVARoIHead', 'MobileNetV2', 'MobileNetV2TSM', 'TANet' 34 | ] 35 | -------------------------------------------------------------------------------- /mmaction/core/hooks/output.py: -------------------------------------------------------------------------------- 1 | import functools 2 | import warnings 3 | 4 | import torch 5 | 6 | 7 | class OutputHook: 8 | """Output feature map of some layers. 9 | 10 | Args: 11 | module (nn.Module): The whole module to get layers. 12 | outputs (tuple[str] | list[str]): Layer name to output. Default: None. 13 | as_tensor (bool): Determine to return a tensor or a numpy array. 14 | Default: False. 15 | """ 16 | 17 | def __init__(self, module, outputs=None, as_tensor=False): 18 | self.outputs = outputs 19 | self.as_tensor = as_tensor 20 | self.layer_outputs = {} 21 | self.handles = [] 22 | self.register(module) 23 | 24 | def register(self, module): 25 | 26 | def hook_wrapper(name): 27 | 28 | def hook(model, input, output): 29 | if not isinstance(output, torch.Tensor): 30 | warnings.warn(f'Directly return the output from {name}, ' 31 | f'since it is not a tensor') 32 | self.layer_outputs[name] = output 33 | elif self.as_tensor: 34 | self.layer_outputs[name] = output 35 | else: 36 | self.layer_outputs[name] = output.detach().cpu().numpy() 37 | 38 | return hook 39 | 40 | if isinstance(self.outputs, (list, tuple)): 41 | for name in self.outputs: 42 | try: 43 | layer = rgetattr(module, name) 44 | h = layer.register_forward_hook(hook_wrapper(name)) 45 | except AttributeError: 46 | raise AttributeError(f'Module {name} not found') 47 | self.handles.append(h) 48 | 49 | def remove(self): 50 | for h in self.handles: 51 | h.remove() 52 | 53 | def __enter__(self): 54 | return self 55 | 56 | def __exit__(self, exc_type, exc_val, exc_tb): 57 | self.remove() 58 | 59 | 60 | # using wonder's beautiful simplification: 61 | # https://stackoverflow.com/questions/31174295/getattr-and-setattr-on-nested-objects 62 | def rgetattr(obj, attr, *args): 63 | 64 | def _getattr(obj, attr): 65 | return getattr(obj, attr, *args) 66 | 67 | return functools.reduce(_getattr, [obj] + attr.split('.')) 68 | -------------------------------------------------------------------------------- /mmaction/datasets/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | from .augmentations import (AudioAmplify, CenterCrop, ColorJitter, 2 | EntityBoxCrop, EntityBoxFlip, EntityBoxRescale, 3 | Flip, Fuse, Imgaug, MelSpectrogram, MultiGroupCrop, 4 | MultiScaleCrop, Normalize, RandomCrop, 5 | RandomRescale, RandomResizedCrop, RandomScale, 6 | Resize, TenCrop, ThreeCrop) 7 | from .compose import Compose 8 | from .formating import (Collect, FormatAudioShape, FormatShape, ImageToTensor, 9 | Rename, ToDataContainer, ToTensor, Transpose) 10 | from .loading import (AudioDecode, AudioDecodeInit, AudioFeatureSelector, 11 | BuildPseudoClip, DecordDecode, DecordInit, 12 | DenseSampleFrames, FrameSelector, 13 | GenerateLocalizationLabels, ImageDecode, 14 | LoadAudioFeature, LoadHVULabel, LoadLocalizationFeature, 15 | LoadProposals, OpenCVDecode, OpenCVInit, PyAVDecode, 16 | PyAVDecodeMotionVector, PyAVInit, RawFrameDecode, 17 | SampleAVAFrames, SampleFrames, SampleProposalFrames, 18 | UntrimmedSampleFrames) 19 | 20 | __all__ = [ 21 | 'SampleFrames', 'PyAVDecode', 'DecordDecode', 'DenseSampleFrames', 22 | 'OpenCVDecode', 'FrameSelector', 'MultiGroupCrop', 'MultiScaleCrop', 23 | 'RandomResizedCrop', 'RandomCrop', 'Resize', 'Flip', 'Fuse', 'Normalize', 24 | 'ThreeCrop', 'CenterCrop', 'TenCrop', 'ImageToTensor', 'Transpose', 25 | 'Collect', 'FormatShape', 'Compose', 'ToTensor', 'ToDataContainer', 26 | 'GenerateLocalizationLabels', 'LoadLocalizationFeature', 'LoadProposals', 27 | 'DecordInit', 'OpenCVInit', 'PyAVInit', 'SampleProposalFrames', 28 | 'UntrimmedSampleFrames', 'RawFrameDecode', 'DecordInit', 'OpenCVInit', 29 | 'PyAVInit', 'SampleProposalFrames', 'ColorJitter', 'LoadHVULabel', 30 | 'SampleAVAFrames', 'AudioAmplify', 'MelSpectrogram', 'AudioDecode', 31 | 'FormatAudioShape', 'LoadAudioFeature', 'AudioFeatureSelector', 32 | 'AudioDecodeInit', 'EntityBoxFlip', 'EntityBoxCrop', 'EntityBoxRescale', 33 | 'RandomScale', 'ImageDecode', 'BuildPseudoClip', 'RandomRescale', 34 | 'PyAVDecodeMotionVector', 'Rename', 'Imgaug' 35 | ] 36 | -------------------------------------------------------------------------------- /mmaction/models/losses/binary_logistic_regression_loss.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | from ..registry import LOSSES 5 | 6 | 7 | def binary_logistic_regression_loss(reg_score, 8 | label, 9 | threshold=0.5, 10 | ratio_range=(1.05, 21), 11 | eps=1e-5): 12 | """Binary Logistic Regression Loss.""" 13 | label = label.view(-1).to(reg_score.device) 14 | reg_score = reg_score.contiguous().view(-1) 15 | 16 | pmask = (label > threshold).float().to(reg_score.device) 17 | num_positive = max(torch.sum(pmask), 1) 18 | num_entries = len(label) 19 | ratio = num_entries / num_positive 20 | # clip ratio value between ratio_range 21 | ratio = min(max(ratio, ratio_range[0]), ratio_range[1]) 22 | 23 | coef_0 = 0.5 * ratio / (ratio - 1) 24 | coef_1 = 0.5 * ratio 25 | loss = coef_1 * pmask * torch.log(reg_score + eps) + coef_0 * ( 26 | 1.0 - pmask) * torch.log(1.0 - reg_score + eps) 27 | loss = -torch.mean(loss) 28 | return loss 29 | 30 | 31 | @LOSSES.register_module() 32 | class BinaryLogisticRegressionLoss(nn.Module): 33 | """Binary Logistic Regression Loss. 34 | 35 | It will calculate binary logistic regression loss given reg_score and 36 | label. 37 | """ 38 | 39 | def forward(self, 40 | reg_score, 41 | label, 42 | threshold=0.5, 43 | ratio_range=(1.05, 21), 44 | eps=1e-5): 45 | """Calculate Binary Logistic Regression Loss. 46 | 47 | Args: 48 | reg_score (torch.Tensor): Predicted score by model. 49 | label (torch.Tensor): Groundtruth labels. 50 | threshold (float): Threshold for positive instances. 51 | Default: 0.5. 52 | ratio_range (tuple): Lower bound and upper bound for ratio. 53 | Default: (1.05, 21) 54 | eps (float): Epsilon for small value. Default: 1e-5. 55 | 56 | Returns: 57 | torch.Tensor: Returned binary logistic loss. 58 | """ 59 | 60 | return binary_logistic_regression_loss(reg_score, label, threshold, 61 | ratio_range, eps) 62 | -------------------------------------------------------------------------------- /mmaction/datasets/video_dataset.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | 3 | import torch 4 | 5 | from .base import BaseDataset 6 | from .registry import DATASETS 7 | 8 | 9 | @DATASETS.register_module() 10 | class VideoDataset(BaseDataset): 11 | """Video dataset for action recognition. 12 | 13 | The dataset loads raw videos and apply specified transforms to return a 14 | dict containing the frame tensors and other information. 15 | 16 | The ann_file is a text file with multiple lines, and each line indicates 17 | a sample video with the filepath and label, which are split with a 18 | whitespace. Example of a annotation file: 19 | 20 | .. code-block:: txt 21 | 22 | some/path/000.mp4 1 23 | some/path/001.mp4 1 24 | some/path/002.mp4 2 25 | some/path/003.mp4 2 26 | some/path/004.mp4 3 27 | some/path/005.mp4 3 28 | 29 | 30 | Args: 31 | ann_file (str): Path to the annotation file. 32 | pipeline (list[dict | callable]): A sequence of data transforms. 33 | start_index (int): Specify a start index for frames in consideration of 34 | different filename format. However, when taking videos as input, 35 | it should be set to 0, since frames loaded from videos count 36 | from 0. Default: 0. 37 | **kwargs: Keyword arguments for ``BaseDataset``. 38 | """ 39 | 40 | def __init__(self, ann_file, pipeline, start_index=0, **kwargs): 41 | super().__init__(ann_file, pipeline, start_index=start_index, **kwargs) 42 | 43 | def load_annotations(self): 44 | """Load annotation file to get video information.""" 45 | if self.ann_file.endswith('.json'): 46 | return self.load_json_annotations() 47 | 48 | video_infos = [] 49 | with open(self.ann_file, 'r') as fin: 50 | for line in fin: 51 | line_split = line.strip().split() 52 | if self.multi_class: 53 | assert self.num_classes is not None 54 | filename, label = line_split[0], line_split[1:] 55 | label = list(map(int, label)) 56 | onehot = torch.zeros(self.num_classes) 57 | onehot[label] = 1.0 58 | else: 59 | filename, label = line_split 60 | label = int(label) 61 | if self.data_prefix is not None: 62 | filename = osp.join(self.data_prefix, filename) 63 | video_infos.append( 64 | dict( 65 | filename=filename, 66 | label=onehot if self.multi_class else label)) 67 | return video_infos 68 | -------------------------------------------------------------------------------- /mmaction/models/heads/audio_tsn_head.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from mmcv.cnn import normal_init 3 | 4 | from ..registry import HEADS 5 | from .base import BaseHead 6 | 7 | 8 | @HEADS.register_module() 9 | class AudioTSNHead(BaseHead): 10 | """Classification head for TSN on audio. 11 | 12 | Args: 13 | num_classes (int): Number of classes to be classified. 14 | in_channels (int): Number of channels in input feature. 15 | loss_cls (dict): Config for building loss. 16 | Default: dict(type='CrossEntropyLoss'). 17 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 18 | dropout_ratio (float): Probability of dropout layer. Default: 0.4. 19 | init_std (float): Std value for Initiation. Default: 0.01. 20 | kwargs (dict, optional): Any keyword argument to be used to initialize 21 | the head. 22 | """ 23 | 24 | def __init__(self, 25 | num_classes, 26 | in_channels, 27 | loss_cls=dict(type='CrossEntropyLoss'), 28 | spatial_type='avg', 29 | dropout_ratio=0.4, 30 | init_std=0.01, 31 | **kwargs): 32 | super().__init__(num_classes, in_channels, loss_cls=loss_cls, **kwargs) 33 | 34 | self.spatial_type = spatial_type 35 | self.dropout_ratio = dropout_ratio 36 | self.init_std = init_std 37 | 38 | if self.spatial_type == 'avg': 39 | # use `nn.AdaptiveAvgPool2d` to adaptively match the in_channels. 40 | self.avg_pool = nn.AdaptiveAvgPool2d((1, 1)) 41 | else: 42 | self.avg_pool = None 43 | 44 | if self.dropout_ratio != 0: 45 | self.dropout = nn.Dropout(p=self.dropout_ratio) 46 | else: 47 | self.dropout = None 48 | self.fc_cls = nn.Linear(self.in_channels, self.num_classes) 49 | 50 | def init_weights(self): 51 | """Initiate the parameters from scratch.""" 52 | normal_init(self.fc_cls, std=self.init_std) 53 | 54 | def forward(self, x): 55 | """Defines the computation performed at every call. 56 | 57 | Args: 58 | x (torch.Tensor): The input data. 59 | 60 | Returns: 61 | torch.Tensor: The classification scores for input samples. 62 | """ 63 | # [N * num_segs, in_channels, h, w] 64 | x = self.avg_pool(x) 65 | # [N, in_channels, 1, 1] 66 | x = x.view(x.size(0), -1) 67 | # [N, in_channels] 68 | if self.dropout is not None: 69 | x = self.dropout(x) 70 | # [N, in_channels] 71 | cls_score = self.fc_cls(x) 72 | # [N, num_classes] 73 | return cls_score 74 | -------------------------------------------------------------------------------- /mmaction/models/heads/i3d_head.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from mmcv.cnn import normal_init 3 | 4 | from ..registry import HEADS 5 | from .base import BaseHead 6 | 7 | 8 | @HEADS.register_module() 9 | class I3DHead(BaseHead): 10 | """Classification head for I3D. 11 | 12 | Args: 13 | num_classes (int): Number of classes to be classified. 14 | in_channels (int): Number of channels in input feature. 15 | loss_cls (dict): Config for building loss. 16 | Default: dict(type='CrossEntropyLoss') 17 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 18 | dropout_ratio (float): Probability of dropout layer. Default: 0.5. 19 | init_std (float): Std value for Initiation. Default: 0.01. 20 | kwargs (dict, optional): Any keyword argument to be used to initialize 21 | the head. 22 | """ 23 | 24 | def __init__(self, 25 | num_classes, 26 | in_channels, 27 | loss_cls=dict(type='CrossEntropyLoss'), 28 | spatial_type='avg', 29 | dropout_ratio=0.5, 30 | init_std=0.01, 31 | **kwargs): 32 | super().__init__(num_classes, in_channels, loss_cls, **kwargs) 33 | 34 | self.spatial_type = spatial_type 35 | self.dropout_ratio = dropout_ratio 36 | self.init_std = init_std 37 | if self.dropout_ratio != 0: 38 | self.dropout = nn.Dropout(p=self.dropout_ratio) 39 | else: 40 | self.dropout = None 41 | self.fc_cls = nn.Linear(self.in_channels, self.num_classes) 42 | 43 | if self.spatial_type == 'avg': 44 | # use `nn.AdaptiveAvgPool3d` to adaptively match the in_channels. 45 | self.avg_pool = nn.AdaptiveAvgPool3d((1, 1, 1)) 46 | else: 47 | self.avg_pool = None 48 | 49 | def init_weights(self): 50 | """Initiate the parameters from scratch.""" 51 | normal_init(self.fc_cls, std=self.init_std) 52 | 53 | def forward(self, x): 54 | """Defines the computation performed at every call. 55 | 56 | Args: 57 | x (torch.Tensor): The input data. 58 | 59 | Returns: 60 | torch.Tensor: The classification scores for input samples. 61 | """ 62 | # [N, in_channels, 4, 7, 7] 63 | if self.avg_pool is not None: 64 | x = self.avg_pool(x) 65 | # [N, in_channels, 1, 1, 1] 66 | if self.dropout is not None: 67 | x = self.dropout(x) 68 | # [N, in_channels, 1, 1, 1] 69 | x = x.view(x.shape[0], -1) 70 | # [N, in_channels] 71 | cls_score = self.fc_cls(x) 72 | # [N, num_classes] 73 | return cls_score 74 | -------------------------------------------------------------------------------- /mmaction/models/losses/ohem_hinge_loss.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | class OHEMHingeLoss(torch.autograd.Function): 5 | """This class is the core implementation for the completeness loss in 6 | paper. 7 | 8 | It compute class-wise hinge loss and performs online hard example mining 9 | (OHEM). 10 | """ 11 | 12 | @staticmethod 13 | def forward(ctx, pred, labels, is_positive, ohem_ratio, group_size): 14 | """Calculate OHEM hinge loss. 15 | 16 | Args: 17 | pred (torch.Tensor): Predicted completeness score. 18 | labels (torch.Tensor): Groundtruth class label. 19 | is_positive (int): Set to 1 when proposals are positive and 20 | set to -1 when proposals are incomplete. 21 | ohem_ratio (float): Ratio of hard examples. 22 | group_size (int): Number of proposals sampled per video. 23 | 24 | Returns: 25 | torch.Tensor: Returned class-wise hinge loss. 26 | """ 27 | num_samples = pred.size(0) 28 | if num_samples != len(labels): 29 | raise ValueError(f'Number of samples should be equal to that ' 30 | f'of labels, but got {num_samples} samples and ' 31 | f'{len(labels)} labels.') 32 | 33 | losses = torch.zeros(num_samples, device=pred.device) 34 | slopes = torch.zeros(num_samples, device=pred.device) 35 | for i in range(num_samples): 36 | losses[i] = max(0, 1 - is_positive * pred[i, labels[i] - 1]) 37 | slopes[i] = -is_positive if losses[i] != 0 else 0 38 | 39 | losses = losses.view(-1, group_size).contiguous() 40 | sorted_losses, indices = torch.sort(losses, dim=1, descending=True) 41 | keep_length = int(group_size * ohem_ratio) 42 | loss = torch.zeros(1, device=pred.device) 43 | for i in range(losses.size(0)): 44 | loss += sorted_losses[i, :keep_length].sum() 45 | ctx.loss_index = indices[:, :keep_length] 46 | ctx.labels = labels 47 | ctx.slopes = slopes 48 | ctx.shape = pred.size() 49 | ctx.group_size = group_size 50 | ctx.num_groups = losses.size(0) 51 | return loss 52 | 53 | @staticmethod 54 | def backward(ctx, grad_output): 55 | labels = ctx.labels 56 | slopes = ctx.slopes 57 | 58 | grad_in = torch.zeros(ctx.shape, device=ctx.slopes.device) 59 | for group in range(ctx.num_groups): 60 | for idx in ctx.loss_index[group]: 61 | loc = idx + group * ctx.group_size 62 | grad_in[loc, labels[loc] - 1] = ( 63 | slopes[loc] * grad_output.data[0]) 64 | return torch.autograd.Variable(grad_in), None, None, None, None 65 | -------------------------------------------------------------------------------- /mmaction/datasets/audio_dataset.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | 3 | import torch 4 | 5 | from .base import BaseDataset 6 | from .registry import DATASETS 7 | 8 | 9 | @DATASETS.register_module() 10 | class AudioDataset(BaseDataset): 11 | """Audio dataset for video recognition. Extracts the audio feature on-the- 12 | fly. Annotation file can be that of the rawframe dataset, or: 13 | 14 | .. code-block:: txt 15 | 16 | some/directory-1.wav 163 1 17 | some/directory-2.wav 122 1 18 | some/directory-3.wav 258 2 19 | some/directory-4.wav 234 2 20 | some/directory-5.wav 295 3 21 | some/directory-6.wav 121 3 22 | 23 | Args: 24 | ann_file (str): Path to the annotation file. 25 | pipeline (list[dict | callable]): A sequence of data transforms. 26 | suffix (str): The suffix of the audio file. Default: '.wav'. 27 | kwargs (dict): Other keyword args for `BaseDataset`. 28 | """ 29 | 30 | def __init__(self, ann_file, pipeline, suffix='.wav', **kwargs): 31 | self.suffix = suffix 32 | super().__init__(ann_file, pipeline, modality='Audio', **kwargs) 33 | 34 | def load_annotations(self): 35 | """Load annotation file to get video information.""" 36 | if self.ann_file.endswith('.json'): 37 | return self.load_json_annotations() 38 | video_infos = [] 39 | with open(self.ann_file, 'r') as fin: 40 | for line in fin: 41 | line_split = line.strip().split() 42 | video_info = {} 43 | idx = 0 44 | filename = line_split[idx] 45 | if self.data_prefix is not None: 46 | if not filename.endswith(self.suffix): 47 | filename = osp.join(self.data_prefix, 48 | filename + self.suffix) 49 | else: 50 | filename = osp.join(self.data_prefix, filename) 51 | video_info['audio_path'] = filename 52 | idx += 1 53 | # idx for total_frames 54 | video_info['total_frames'] = int(line_split[idx]) 55 | idx += 1 56 | # idx for label[s] 57 | label = [int(x) for x in line_split[idx:]] 58 | assert label, f'missing label in line: {line}' 59 | if self.multi_class: 60 | assert self.num_classes is not None 61 | onehot = torch.zeros(self.num_classes) 62 | onehot[label] = 1.0 63 | video_info['label'] = onehot 64 | else: 65 | assert len(label) == 1 66 | video_info['label'] = label[0] 67 | video_infos.append(video_info) 68 | 69 | return video_infos 70 | -------------------------------------------------------------------------------- /mmaction/models/heads/tpn_head.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | from ..registry import HEADS 4 | from .tsn_head import TSNHead 5 | 6 | 7 | @HEADS.register_module() 8 | class TPNHead(TSNHead): 9 | """Class head for TPN. 10 | 11 | Args: 12 | num_classes (int): Number of classes to be classified. 13 | in_channels (int): Number of channels in input feature. 14 | loss_cls (dict): Config for building loss. 15 | Default: dict(type='CrossEntropyLoss'). 16 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 17 | consensus (dict): Consensus config dict. 18 | dropout_ratio (float): Probability of dropout layer. Default: 0.4. 19 | init_std (float): Std value for Initiation. Default: 0.01. 20 | multi_class (bool): Determines whether it is a multi-class 21 | recognition task. Default: False. 22 | label_smooth_eps (float): Epsilon used in label smooth. 23 | Reference: https://arxiv.org/abs/1906.02629. Default: 0. 24 | """ 25 | 26 | def __init__(self, *args, **kwargs): 27 | super().__init__(*args, **kwargs) 28 | 29 | if self.spatial_type == 'avg': 30 | # use `nn.AdaptiveAvgPool3d` to adaptively match the in_channels. 31 | self.avg_pool3d = nn.AdaptiveAvgPool3d((1, 1, 1)) 32 | else: 33 | self.avg_pool3d = None 34 | 35 | self.avg_pool2d = None 36 | 37 | def forward(self, x, num_segs=None): 38 | """Defines the computation performed at every call. 39 | 40 | Args: 41 | x (torch.Tensor): The input data. 42 | num_segs (int | None): Number of segments into which a video 43 | is divided. Default: None. 44 | Returns: 45 | torch.Tensor: The classification scores for input samples. 46 | """ 47 | if self.avg_pool2d is None: 48 | kernel_size = (1, x.shape[-2], x.shape[-1]) 49 | self.avg_pool2d = nn.AvgPool3d(kernel_size, stride=1, padding=0) 50 | 51 | if num_segs is None: 52 | # [N, in_channels, 3, 7, 7] 53 | x = self.avg_pool3d(x) 54 | else: 55 | # [N * num_segs, in_channels, 7, 7] 56 | x = self.avg_pool2d(x) 57 | # [N * num_segs, in_channels, 1, 1] 58 | x = x.reshape((-1, num_segs) + x.shape[1:]) 59 | # [N, num_segs, in_channels, 1, 1] 60 | x = self.consensus(x) 61 | # [N, 1, in_channels, 1, 1] 62 | x = x.squeeze(1) 63 | # [N, in_channels, 1, 1] 64 | if self.dropout is not None: 65 | x = self.dropout(x) 66 | # [N, in_channels, 1, 1] 67 | x = x.view(x.size(0), -1) 68 | # [N, in_channels] 69 | cls_score = self.fc_cls(x) 70 | # [N, num_classes] 71 | return cls_score 72 | -------------------------------------------------------------------------------- /mmaction/datasets/audio_feature_dataset.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | 3 | import torch 4 | 5 | from .base import BaseDataset 6 | from .registry import DATASETS 7 | 8 | 9 | @DATASETS.register_module() 10 | class AudioFeatureDataset(BaseDataset): 11 | """Audio feature dataset for video recognition. Reads the features 12 | extracted off-line. Annotation file can be that of the rawframe dataset, 13 | or: 14 | 15 | .. code-block:: txt 16 | 17 | some/directory-1.npy 163 1 18 | some/directory-2.npy 122 1 19 | some/directory-3.npy 258 2 20 | some/directory-4.npy 234 2 21 | some/directory-5.npy 295 3 22 | some/directory-6.npy 121 3 23 | 24 | Args: 25 | ann_file (str): Path to the annotation file. 26 | pipeline (list[dict | callable]): A sequence of data transforms. 27 | suffix (str): The suffix of the audio feature file. Default: '.npy'. 28 | kwargs (dict): Other keyword args for `BaseDataset`. 29 | """ 30 | 31 | def __init__(self, ann_file, pipeline, suffix='.npy', **kwargs): 32 | self.suffix = suffix 33 | super().__init__(ann_file, pipeline, modality='Audio', **kwargs) 34 | 35 | def load_annotations(self): 36 | """Load annotation file to get video information.""" 37 | if self.ann_file.endswith('.json'): 38 | return self.load_json_annotations() 39 | video_infos = [] 40 | with open(self.ann_file, 'r') as fin: 41 | for line in fin: 42 | line_split = line.strip().split() 43 | video_info = {} 44 | idx = 0 45 | filename = line_split[idx] 46 | if self.data_prefix is not None: 47 | if not filename.endswith(self.suffix): 48 | filename = osp.join(self.data_prefix, 49 | filename) + self.suffix 50 | else: 51 | filename = osp.join(self.data_prefix, filename) 52 | video_info['audio_path'] = filename 53 | idx += 1 54 | # idx for total_frames 55 | video_info['total_frames'] = int(line_split[idx]) 56 | idx += 1 57 | # idx for label[s] 58 | label = [int(x) for x in line_split[idx:]] 59 | assert label, f'missing label in line: {line}' 60 | if self.multi_class: 61 | assert self.num_classes is not None 62 | onehot = torch.zeros(self.num_classes) 63 | onehot[label] = 1.0 64 | video_info['label'] = onehot 65 | else: 66 | assert len(label) == 1 67 | video_info['label'] = label[0] 68 | video_infos.append(video_info) 69 | 70 | return video_infos 71 | -------------------------------------------------------------------------------- /mmaction/models/heads/slowfast_head.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | from mmcv.cnn import normal_init 4 | 5 | from ..registry import HEADS 6 | from .base import BaseHead 7 | 8 | 9 | @HEADS.register_module() 10 | class SlowFastHead(BaseHead): 11 | """The classification head for SlowFast. 12 | 13 | Args: 14 | num_classes (int): Number of classes to be classified. 15 | in_channels (int): Number of channels in input feature. 16 | loss_cls (dict): Config for building loss. 17 | Default: dict(type='CrossEntropyLoss'). 18 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 19 | dropout_ratio (float): Probability of dropout layer. Default: 0.8. 20 | init_std (float): Std value for Initiation. Default: 0.01. 21 | kwargs (dict, optional): Any keyword argument to be used to initialize 22 | the head. 23 | """ 24 | 25 | def __init__(self, 26 | num_classes, 27 | in_channels, 28 | loss_cls=dict(type='CrossEntropyLoss'), 29 | spatial_type='avg', 30 | dropout_ratio=0.8, 31 | init_std=0.01, 32 | **kwargs): 33 | 34 | super().__init__(num_classes, in_channels, loss_cls, **kwargs) 35 | self.spatial_type = spatial_type 36 | self.dropout_ratio = dropout_ratio 37 | self.init_std = init_std 38 | 39 | if self.dropout_ratio != 0: 40 | self.dropout = nn.Dropout(p=self.dropout_ratio) 41 | else: 42 | self.dropout = None 43 | self.fc_cls = nn.Linear(in_channels, num_classes) 44 | 45 | if self.spatial_type == 'avg': 46 | self.avg_pool = nn.AdaptiveAvgPool3d((1, 1, 1)) 47 | else: 48 | self.avg_pool = None 49 | 50 | def init_weights(self): 51 | """Initiate the parameters from scratch.""" 52 | normal_init(self.fc_cls, std=self.init_std) 53 | 54 | def forward(self, x): 55 | """Defines the computation performed at every call. 56 | 57 | Args: 58 | x (torch.Tensor): The input data. 59 | 60 | Returns: 61 | torch.Tensor: The classification scores for input samples. 62 | """ 63 | # ([N, channel_fast, T, H, W], [(N, channel_slow, T, H, W)]) 64 | x_fast, x_slow = x 65 | # ([N, channel_fast, 1, 1, 1], [N, channel_slow, 1, 1, 1]) 66 | x_fast = self.avg_pool(x_fast) 67 | x_slow = self.avg_pool(x_slow) 68 | # [N, channel_fast + channel_slow, 1, 1, 1] 69 | x = torch.cat((x_slow, x_fast), dim=1) 70 | 71 | if self.dropout is not None: 72 | x = self.dropout(x) 73 | 74 | # [N x C] 75 | x = x.view(x.size(0), -1) 76 | # [N x num_classes] 77 | cls_score = self.fc_cls(x) 78 | 79 | return cls_score 80 | -------------------------------------------------------------------------------- /mmaction/models/recognizers/recognizer3d.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from ..registry import RECOGNIZERS 4 | from .base import BaseRecognizer 5 | 6 | 7 | @RECOGNIZERS.register_module() 8 | class Recognizer3D(BaseRecognizer): 9 | """3D recognizer model framework.""" 10 | 11 | def forward_train(self, imgs, labels, **kwargs): 12 | """Defines the computation performed at every call when training.""" 13 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 14 | losses = dict() 15 | 16 | x = self.extract_feat(imgs) 17 | if hasattr(self, 'neck'): 18 | x, loss_aux = self.neck(x, labels.squeeze()) 19 | losses.update(loss_aux) 20 | 21 | cls_score = self.cls_head(x) 22 | gt_labels = labels.squeeze() 23 | loss_cls = self.cls_head.loss(cls_score, gt_labels, **kwargs) 24 | losses.update(loss_cls) 25 | 26 | return losses 27 | 28 | def _do_test(self, imgs): 29 | """Defines the computation performed at every call when evaluation, 30 | testing and gradcam.""" 31 | num_segs = imgs.shape[1] 32 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 33 | 34 | if self.max_testing_views is not None: 35 | total_views = imgs.shape[0] 36 | assert num_segs == total_views, ( 37 | 'max_testing_views is only compatible ' 38 | 'with batch_size == 1') 39 | view_ptr = 0 40 | cls_scores = [] 41 | while view_ptr < total_views: 42 | batch_imgs = imgs[view_ptr:view_ptr + self.max_testing_views] 43 | x = self.extract_feat(batch_imgs) 44 | if hasattr(self, 'neck'): 45 | x, _ = self.neck(x) 46 | cls_score = self.cls_head(x) 47 | cls_scores.append(cls_score) 48 | view_ptr += self.max_testing_views 49 | cls_score = torch.cat(cls_scores) 50 | else: 51 | x = self.extract_feat(imgs) 52 | if hasattr(self, 'neck'): 53 | x, _ = self.neck(x) 54 | cls_score = self.cls_head(x) 55 | 56 | cls_score = self.average_clip(cls_score, num_segs) 57 | return cls_score 58 | 59 | def forward_test(self, imgs): 60 | """Defines the computation performed at every call when evaluation and 61 | testing.""" 62 | return self._do_test(imgs).cpu().numpy() 63 | 64 | def forward_dummy(self, imgs): 65 | """Used for computing network FLOPs. 66 | 67 | See ``tools/analysis/get_flops.py``. 68 | 69 | Args: 70 | imgs (torch.Tensor): Input images. 71 | 72 | Returns: 73 | Tensor: Class score. 74 | """ 75 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 76 | x = self.extract_feat(imgs) 77 | 78 | if hasattr(self, 'neck'): 79 | x, _ = self.neck(x) 80 | 81 | outs = (self.cls_head(x), ) 82 | return outs 83 | 84 | def forward_gradcam(self, imgs): 85 | """Defines the computation performed at every call when using gradcam 86 | utils.""" 87 | return self._do_test(imgs) 88 | -------------------------------------------------------------------------------- /mmaction/models/heads/x3d_head.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from mmcv.cnn import normal_init 3 | 4 | from ..registry import HEADS 5 | from .base import BaseHead 6 | 7 | 8 | @HEADS.register_module() 9 | class X3DHead(BaseHead): 10 | """Classification head for I3D. 11 | 12 | Args: 13 | num_classes (int): Number of classes to be classified. 14 | in_channels (int): Number of channels in input feature. 15 | loss_cls (dict): Config for building loss. 16 | Default: dict(type='CrossEntropyLoss') 17 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 18 | dropout_ratio (float): Probability of dropout layer. Default: 0.5. 19 | init_std (float): Std value for Initiation. Default: 0.01. 20 | fc1_bias (bool): If the first fc layer has bias. Default: False. 21 | """ 22 | 23 | def __init__(self, 24 | num_classes, 25 | in_channels, 26 | loss_cls=dict(type='CrossEntropyLoss'), 27 | spatial_type='avg', 28 | dropout_ratio=0.5, 29 | init_std=0.01, 30 | fc1_bias=False): 31 | super().__init__(num_classes, in_channels, loss_cls) 32 | 33 | self.spatial_type = spatial_type 34 | self.dropout_ratio = dropout_ratio 35 | self.init_std = init_std 36 | if self.dropout_ratio != 0: 37 | self.dropout = nn.Dropout(p=self.dropout_ratio) 38 | else: 39 | self.dropout = None 40 | self.in_channels = in_channels 41 | self.mid_channels = 2048 42 | self.num_classes = num_classes 43 | self.fc1_bias = fc1_bias 44 | 45 | self.fc1 = nn.Linear( 46 | self.in_channels, self.mid_channels, bias=self.fc1_bias) 47 | self.fc2 = nn.Linear(self.mid_channels, self.num_classes) 48 | 49 | self.relu = nn.ReLU() 50 | 51 | self.pool = None 52 | if self.spatial_type == 'avg': 53 | self.pool = nn.AdaptiveAvgPool3d((1, 1, 1)) 54 | elif self.spatial_type == 'max': 55 | self.pool = nn.AdaptiveMaxPool3d((1, 1, 1)) 56 | else: 57 | raise NotImplementedError 58 | 59 | def init_weights(self): 60 | """Initiate the parameters from scratch.""" 61 | normal_init(self.fc1, std=self.init_std) 62 | normal_init(self.fc2, std=self.init_std) 63 | 64 | def forward(self, x): 65 | """Defines the computation performed at every call. 66 | 67 | Args: 68 | x (torch.Tensor): The input data. 69 | 70 | Returns: 71 | torch.Tensor: The classification scores for input samples. 72 | """ 73 | # [N, in_channels, T, H, W] 74 | assert self.pool is not None 75 | x = self.pool(x) 76 | # [N, in_channels, 1, 1, 1] 77 | # [N, in_channels, 1, 1, 1] 78 | x = x.view(x.shape[0], -1) 79 | # [N, in_channels] 80 | x = self.fc1(x) 81 | # [N, 2048] 82 | x = self.relu(x) 83 | 84 | if self.dropout is not None: 85 | x = self.dropout(x) 86 | 87 | cls_score = self.fc2(x) 88 | # [N, num_classes] 89 | return cls_score 90 | -------------------------------------------------------------------------------- /mmaction/models/heads/roi_head.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from mmaction.core.bbox import bbox2result 4 | from mmaction.utils import import_module_error_class 5 | 6 | try: 7 | from mmdet.core.bbox import bbox2roi 8 | from mmdet.models import HEADS as MMDET_HEADS 9 | from mmdet.models.roi_heads import StandardRoIHead 10 | mmdet_imported = True 11 | except (ImportError, ModuleNotFoundError): 12 | mmdet_imported = False 13 | 14 | if mmdet_imported: 15 | 16 | @MMDET_HEADS.register_module() 17 | class AVARoIHead(StandardRoIHead): 18 | 19 | def _bbox_forward(self, x, rois): 20 | bbox_feat = self.bbox_roi_extractor(x, rois) 21 | if self.with_shared_head: 22 | bbox_feat = self.shared_head(bbox_feat) 23 | cls_score, bbox_pred = self.bbox_head(bbox_feat) 24 | 25 | bbox_results = dict( 26 | cls_score=cls_score, bbox_pred=bbox_pred, bbox_feats=bbox_feat) 27 | return bbox_results 28 | 29 | def simple_test(self, 30 | x, 31 | proposal_list, 32 | img_metas, 33 | proposals=None, 34 | rescale=False): 35 | assert self.with_bbox, 'Bbox head must be implemented.' 36 | 37 | if isinstance(x, tuple): 38 | x_shape = x[0].shape 39 | else: 40 | x_shape = x.shape 41 | 42 | assert x_shape[0] == 1, 'only accept 1 sample at test mode' 43 | assert x_shape[0] == len(img_metas) == len(proposal_list) 44 | 45 | det_bboxes, det_labels = self.simple_test_bboxes( 46 | x, img_metas, proposal_list, self.test_cfg, rescale=rescale) 47 | bbox_results = bbox2result( 48 | det_bboxes, 49 | det_labels, 50 | self.bbox_head.num_classes, 51 | thr=self.test_cfg.action_thr) 52 | return [bbox_results] 53 | 54 | def simple_test_bboxes(self, 55 | x, 56 | img_metas, 57 | proposals, 58 | rcnn_test_cfg, 59 | rescale=False): 60 | """Test only det bboxes without augmentation.""" 61 | rois = bbox2roi(proposals) 62 | bbox_results = self._bbox_forward(x, rois) 63 | cls_score = bbox_results['cls_score'] 64 | 65 | img_shape = img_metas[0]['img_shape'] 66 | crop_quadruple = np.array([0, 0, 1, 1]) 67 | flip = False 68 | 69 | if 'crop_quadruple' in img_metas[0]: 70 | crop_quadruple = img_metas[0]['crop_quadruple'] 71 | 72 | if 'flip' in img_metas[0]: 73 | flip = img_metas[0]['flip'] 74 | 75 | det_bboxes, det_labels = self.bbox_head.get_det_bboxes( 76 | rois, 77 | cls_score, 78 | img_shape, 79 | flip=flip, 80 | crop_quadruple=crop_quadruple, 81 | cfg=rcnn_test_cfg) 82 | 83 | return det_bboxes, det_labels 84 | else: 85 | # Just define an empty class, so that __init__ can import it. 86 | @import_module_error_class('mmdet') 87 | class AVARoIHead: 88 | pass 89 | -------------------------------------------------------------------------------- /mmaction/datasets/samplers/distributed_sampler.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from torch.utils.data import DistributedSampler as _DistributedSampler 3 | 4 | 5 | class DistributedSampler(_DistributedSampler): 6 | """DistributedSampler inheriting from 7 | ``torch.utils.data.DistributedSampler``. 8 | 9 | In pytorch of lower versions, there is no ``shuffle`` argument. This child 10 | class will port one to DistributedSampler. 11 | """ 12 | 13 | def __init__(self, 14 | dataset, 15 | num_replicas=None, 16 | rank=None, 17 | shuffle=True, 18 | seed=0): 19 | super().__init__( 20 | dataset, num_replicas=num_replicas, rank=rank, shuffle=shuffle) 21 | # for the compatibility from PyTorch 1.3+ 22 | self.seed = seed if seed is not None else 0 23 | 24 | def __iter__(self): 25 | # deterministically shuffle based on epoch 26 | if self.shuffle: 27 | g = torch.Generator() 28 | g.manual_seed(self.epoch + self.seed) 29 | indices = torch.randperm(len(self.dataset), generator=g).tolist() 30 | else: 31 | indices = torch.arange(len(self.dataset)).tolist() 32 | 33 | # add extra samples to make it evenly divisible 34 | indices += indices[:(self.total_size - len(indices))] 35 | assert len(indices) == self.total_size 36 | 37 | # subsample 38 | indices = indices[self.rank:self.total_size:self.num_replicas] 39 | assert len(indices) == self.num_samples 40 | return iter(indices) 41 | 42 | 43 | class DistributedPowerSampler(_DistributedSampler): 44 | """DistributedPowerSampler inheriting from 45 | ``torch.utils.data.DistributedSampler``. 46 | 47 | Samples are sampled with the probability that is proportional to the power 48 | of label frequency (freq ^ power). The sampler only applies to single class 49 | recognition dataset. 50 | 51 | The default value of power is 1, which is equivalent to bootstrap sampling 52 | from the entire dataset. 53 | """ 54 | 55 | def __init__(self, dataset, num_replicas=None, rank=None, power=1, seed=0): 56 | super().__init__(dataset, num_replicas=num_replicas, rank=rank) 57 | self.power = power 58 | self.seed = seed if seed is not None else 0 59 | 60 | def __iter__(self): 61 | # deterministically shuffle based on epoch 62 | g = torch.Generator() 63 | g.manual_seed(self.epoch + self.seed) 64 | video_infos_by_class = self.dataset.video_infos_by_class 65 | num_classes = self.dataset.num_classes 66 | # For simplicity, discontinuous labels are not permitted 67 | assert set(video_infos_by_class) == set(range(num_classes)) 68 | counts = [len(video_infos_by_class[i]) for i in range(num_classes)] 69 | counts = [cnt**self.power for cnt in counts] 70 | 71 | indices = torch.multinomial( 72 | torch.Tensor(counts), 73 | self.total_size, 74 | replacement=True, 75 | generator=g) 76 | indices = indices.data.numpy().tolist() 77 | assert len(indices) == self.total_size 78 | 79 | indices = indices[self.rank:self.total_size:self.num_replicas] 80 | assert len(indices) == self.num_samples 81 | 82 | return iter(indices) 83 | -------------------------------------------------------------------------------- /mmaction/datasets/audio_visual_dataset.py: -------------------------------------------------------------------------------- 1 | import os.path as osp 2 | 3 | from .rawframe_dataset import RawframeDataset 4 | from .registry import DATASETS 5 | 6 | 7 | @DATASETS.register_module() 8 | class AudioVisualDataset(RawframeDataset): 9 | """Dataset that reads both audio and visual data, supporting both rawframes 10 | and videos. The annotation file is same as that of the rawframe dataset, 11 | such as: 12 | 13 | .. code-block:: txt 14 | 15 | some/directory-1 163 1 16 | some/directory-2 122 1 17 | some/directory-3 258 2 18 | some/directory-4 234 2 19 | some/directory-5 295 3 20 | some/directory-6 121 3 21 | 22 | Args: 23 | ann_file (str): Path to the annotation file. 24 | pipeline (list[dict | callable]): A sequence of data transforms. 25 | audio_prefix (str): Directory of the audio files. 26 | kwargs (dict): Other keyword args for `RawframeDataset`. `video_prefix` 27 | is also allowed if pipeline is designed for videos. 28 | """ 29 | 30 | def __init__(self, ann_file, pipeline, audio_prefix, **kwargs): 31 | self.audio_prefix = audio_prefix 32 | self.video_prefix = kwargs.pop('video_prefix', None) 33 | self.data_prefix = kwargs.get('data_prefix', None) 34 | super().__init__(ann_file, pipeline, **kwargs) 35 | 36 | def load_annotations(self): 37 | video_infos = [] 38 | with open(self.ann_file, 'r') as fin: 39 | for line in fin: 40 | line_split = line.strip().split() 41 | video_info = {} 42 | idx = 0 43 | # idx for frame_dir 44 | frame_dir = line_split[idx] 45 | if self.audio_prefix is not None: 46 | audio_path = osp.join(self.audio_prefix, 47 | frame_dir + '.npy') 48 | video_info['audio_path'] = audio_path 49 | if self.video_prefix: 50 | video_path = osp.join(self.video_prefix, 51 | frame_dir + '.mp4') 52 | video_info['filename'] = video_path 53 | if self.data_prefix is not None: 54 | frame_dir = osp.join(self.data_prefix, frame_dir) 55 | video_info['frame_dir'] = frame_dir 56 | idx += 1 57 | if self.with_offset: 58 | # idx for offset and total_frames 59 | video_info['offset'] = int(line_split[idx]) 60 | video_info['total_frames'] = int(line_split[idx + 1]) 61 | idx += 2 62 | else: 63 | # idx for total_frames 64 | video_info['total_frames'] = int(line_split[idx]) 65 | idx += 1 66 | # idx for label[s] 67 | label = [int(x) for x in line_split[idx:]] 68 | assert len(label), f'missing label in line: {line}' 69 | if self.multi_class: 70 | assert self.num_classes is not None 71 | video_info['label'] = label 72 | else: 73 | assert len(label) == 1 74 | video_info['label'] = label[0] 75 | video_infos.append(video_info) 76 | return video_infos 77 | -------------------------------------------------------------------------------- /mmaction/models/heads/tsn_head.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from mmcv.cnn import normal_init 3 | 4 | from ..registry import HEADS 5 | from .base import AvgConsensus, BaseHead 6 | 7 | 8 | @HEADS.register_module() 9 | class TSNHead(BaseHead): 10 | """Class head for TSN. 11 | 12 | Args: 13 | num_classes (int): Number of classes to be classified. 14 | in_channels (int): Number of channels in input feature. 15 | loss_cls (dict): Config for building loss. 16 | Default: dict(type='CrossEntropyLoss'). 17 | spatial_type (str): Pooling type in spatial dimension. Default: 'avg'. 18 | consensus (dict): Consensus config dict. 19 | dropout_ratio (float): Probability of dropout layer. Default: 0.4. 20 | init_std (float): Std value for Initiation. Default: 0.01. 21 | kwargs (dict, optional): Any keyword argument to be used to initialize 22 | the head. 23 | """ 24 | 25 | def __init__(self, 26 | num_classes, 27 | in_channels, 28 | loss_cls=dict(type='CrossEntropyLoss'), 29 | spatial_type='avg', 30 | consensus=dict(type='AvgConsensus', dim=1), 31 | dropout_ratio=0.4, 32 | init_std=0.01, 33 | **kwargs): 34 | super().__init__(num_classes, in_channels, loss_cls=loss_cls, **kwargs) 35 | 36 | self.spatial_type = spatial_type 37 | self.dropout_ratio = dropout_ratio 38 | self.init_std = init_std 39 | 40 | consensus_ = consensus.copy() 41 | 42 | consensus_type = consensus_.pop('type') 43 | if consensus_type == 'AvgConsensus': 44 | self.consensus = AvgConsensus(**consensus_) 45 | else: 46 | self.consensus = None 47 | 48 | if self.spatial_type == 'avg': 49 | # use `nn.AdaptiveAvgPool2d` to adaptively match the in_channels. 50 | self.avg_pool = nn.AdaptiveAvgPool2d((1, 1)) 51 | else: 52 | self.avg_pool = None 53 | 54 | if self.dropout_ratio != 0: 55 | self.dropout = nn.Dropout(p=self.dropout_ratio) 56 | else: 57 | self.dropout = None 58 | self.fc_cls = nn.Linear(self.in_channels, self.num_classes) 59 | 60 | def init_weights(self): 61 | """Initiate the parameters from scratch.""" 62 | normal_init(self.fc_cls, std=self.init_std) 63 | 64 | def forward(self, x, num_segs): 65 | """Defines the computation performed at every call. 66 | 67 | Args: 68 | x (torch.Tensor): The input data. 69 | num_segs (int): Number of segments into which a video 70 | is divided. 71 | Returns: 72 | torch.Tensor: The classification scores for input samples. 73 | """ 74 | # [N * num_segs, in_channels, 7, 7] 75 | if self.avg_pool is not None: 76 | x = self.avg_pool(x) 77 | # [N * num_segs, in_channels, 1, 1] 78 | x = x.reshape((-1, num_segs) + x.shape[1:]) 79 | # [N, num_segs, in_channels, 1, 1] 80 | x = self.consensus(x) 81 | # [N, 1, in_channels, 1, 1] 82 | x = x.squeeze(1) 83 | # [N, in_channels, 1, 1] 84 | if self.dropout is not None: 85 | x = self.dropout(x) 86 | # [N, in_channels, 1, 1] 87 | x = x.view(x.size(0), -1) 88 | # [N, in_channels] 89 | cls_score = self.fc_cls(x) 90 | # [N, num_classes] 91 | return cls_score 92 | -------------------------------------------------------------------------------- /mmaction/models/common/conv_audio.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | from mmcv.cnn import CONV_LAYERS, ConvModule, constant_init, kaiming_init 4 | from torch.nn.modules.utils import _pair 5 | 6 | 7 | @CONV_LAYERS.register_module() 8 | class ConvAudio(nn.Module): 9 | """Conv2d module for AudioResNet backbone. 10 | 11 | `_. 12 | 13 | Args: 14 | in_channels (int): Same as nn.Conv2d. 15 | out_channels (int): Same as nn.Conv2d. 16 | kernel_size (int | tuple[int]): Same as nn.Conv2d. 17 | op (string): Operation to merge the output of freq 18 | and time feature map. Choices are 'sum' and 'concat'. 19 | Default: 'concat'. 20 | stride (int | tuple[int]): Same as nn.Conv2d. 21 | padding (int | tuple[int]): Same as nn.Conv2d. 22 | dilation (int | tuple[int]): Same as nn.Conv2d. 23 | groups (int): Same as nn.Conv2d. 24 | bias (bool | str): If specified as `auto`, it will be decided by the 25 | norm_cfg. Bias will be set as True if norm_cfg is None, otherwise 26 | False. 27 | """ 28 | 29 | def __init__(self, 30 | in_channels, 31 | out_channels, 32 | kernel_size, 33 | op='concat', 34 | stride=1, 35 | padding=0, 36 | dilation=1, 37 | groups=1, 38 | bias=False): 39 | super().__init__() 40 | 41 | kernel_size = _pair(kernel_size) 42 | stride = _pair(stride) 43 | padding = _pair(padding) 44 | 45 | self.in_channels = in_channels 46 | self.out_channels = out_channels 47 | self.kernel_size = kernel_size 48 | assert op in ['concat', 'sum'] 49 | self.op = op 50 | self.stride = stride 51 | self.padding = padding 52 | self.dilation = dilation 53 | self.groups = groups 54 | self.bias = bias 55 | self.output_padding = (0, 0) 56 | self.transposed = False 57 | 58 | self.conv_1 = ConvModule( 59 | in_channels, 60 | out_channels, 61 | kernel_size=(kernel_size[0], 1), 62 | stride=stride, 63 | padding=(kernel_size[0] // 2, 0), 64 | bias=bias, 65 | conv_cfg=dict(type='Conv'), 66 | norm_cfg=dict(type='BN'), 67 | act_cfg=dict(type='ReLU')) 68 | 69 | self.conv_2 = ConvModule( 70 | in_channels, 71 | out_channels, 72 | kernel_size=(1, kernel_size[1]), 73 | stride=stride, 74 | padding=(0, kernel_size[1] // 2), 75 | bias=bias, 76 | conv_cfg=dict(type='Conv'), 77 | norm_cfg=dict(type='BN'), 78 | act_cfg=dict(type='ReLU')) 79 | 80 | self.init_weights() 81 | 82 | def forward(self, x): 83 | """Defines the computation performed at every call. 84 | 85 | Args: 86 | x (torch.Tensor): The input data. 87 | 88 | Returns: 89 | torch.Tensor: The output of the module. 90 | """ 91 | x_1 = self.conv_1(x) 92 | x_2 = self.conv_2(x) 93 | if self.op == 'concat': 94 | out = torch.cat([x_1, x_2], 1) 95 | else: 96 | out = x_1 + x_2 97 | return out 98 | 99 | def init_weights(self): 100 | """Initiate the parameters from scratch.""" 101 | kaiming_init(self.conv_1.conv) 102 | kaiming_init(self.conv_2.conv) 103 | constant_init(self.conv_1.bn, 1, bias=0) 104 | constant_init(self.conv_2.bn, 1, bias=0) 105 | -------------------------------------------------------------------------------- /mmaction/models/builder.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | import torch.nn as nn 4 | from mmcv.utils import Registry, build_from_cfg 5 | 6 | from mmaction.utils import import_module_error_func 7 | from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS 8 | 9 | try: 10 | from mmdet.models.builder import DETECTORS, build_detector 11 | except (ImportError, ModuleNotFoundError): 12 | # Define an empty registry and building func, so that can import 13 | DETECTORS = Registry('detector') 14 | 15 | @import_module_error_func('mmdet') 16 | def build_detector(cfg, train_cfg, test_cfg): 17 | pass 18 | 19 | 20 | def build(cfg, registry, default_args=None): 21 | """Build a module. 22 | 23 | Args: 24 | cfg (dict, list[dict]): The config of modules, it is either a dict 25 | or a list of configs. 26 | registry (:obj:`Registry`): A registry the module belongs to. 27 | default_args (dict, optional): Default arguments to build the module. 28 | Defaults to None. 29 | 30 | Returns: 31 | nn.Module: A built nn module. 32 | """ 33 | 34 | if isinstance(cfg, list): 35 | modules = [ 36 | build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg 37 | ] 38 | return nn.Sequential(*modules) 39 | 40 | return build_from_cfg(cfg, registry, default_args) 41 | 42 | 43 | def build_backbone(cfg): 44 | """Build backbone.""" 45 | return build(cfg, BACKBONES) 46 | 47 | 48 | def build_head(cfg): 49 | """Build head.""" 50 | return build(cfg, HEADS) 51 | 52 | 53 | def build_recognizer(cfg, train_cfg=None, test_cfg=None): 54 | """Build recognizer.""" 55 | if train_cfg is not None or test_cfg is not None: 56 | warnings.warn( 57 | 'train_cfg and test_cfg is deprecated, ' 58 | 'please specify them in model. Details see this ' 59 | 'PR: https://github.com/open-mmlab/mmaction2/pull/629', 60 | UserWarning) 61 | assert cfg.get('train_cfg') is None or train_cfg is None, \ 62 | 'train_cfg specified in both outer field and model field ' 63 | assert cfg.get('test_cfg') is None or test_cfg is None, \ 64 | 'test_cfg specified in both outer field and model field ' 65 | return build(cfg, RECOGNIZERS, 66 | dict(train_cfg=train_cfg, test_cfg=test_cfg)) 67 | 68 | 69 | def build_loss(cfg): 70 | """Build loss.""" 71 | return build(cfg, LOSSES) 72 | 73 | 74 | def build_localizer(cfg): 75 | """Build localizer.""" 76 | return build(cfg, LOCALIZERS) 77 | 78 | 79 | def build_model(cfg, train_cfg=None, test_cfg=None): 80 | """Build model.""" 81 | args = cfg.copy() 82 | obj_type = args.pop('type') 83 | if obj_type in LOCALIZERS: 84 | return build_localizer(cfg) 85 | if obj_type in RECOGNIZERS: 86 | return build_recognizer(cfg, train_cfg, test_cfg) 87 | if obj_type in DETECTORS: 88 | if train_cfg is not None or test_cfg is not None: 89 | warnings.warn( 90 | 'train_cfg and test_cfg is deprecated, ' 91 | 'please specify them in model. Details see this ' 92 | 'PR: https://github.com/open-mmlab/mmaction2/pull/629', 93 | UserWarning) 94 | return build_detector(cfg, train_cfg, test_cfg) 95 | model_in_mmdet = ['FastRCNN'] 96 | if obj_type in model_in_mmdet: 97 | raise ImportError( 98 | 'Please install mmdet for spatial temporal detection tasks.') 99 | raise ValueError(f'{obj_type} is not registered in ' 100 | 'LOCALIZERS, RECOGNIZERS or DETECTORS') 101 | 102 | 103 | def build_neck(cfg): 104 | """Build neck.""" 105 | return build(cfg, NECKS) 106 | -------------------------------------------------------------------------------- /mmaction/localization/proposal_utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def temporal_iou(proposal_min, proposal_max, gt_min, gt_max): 5 | """Compute IoU score between a groundtruth bbox and the proposals. 6 | 7 | Args: 8 | proposal_min (list[float]): List of temporal anchor min. 9 | proposal_max (list[float]): List of temporal anchor max. 10 | gt_min (float): Groundtruth temporal box min. 11 | gt_max (float): Groundtruth temporal box max. 12 | 13 | Returns: 14 | list[float]: List of iou scores. 15 | """ 16 | len_anchors = proposal_max - proposal_min 17 | int_tmin = np.maximum(proposal_min, gt_min) 18 | int_tmax = np.minimum(proposal_max, gt_max) 19 | inter_len = np.maximum(int_tmax - int_tmin, 0.) 20 | union_len = len_anchors - inter_len + gt_max - gt_min 21 | jaccard = np.divide(inter_len, union_len) 22 | return jaccard 23 | 24 | 25 | def temporal_iop(proposal_min, proposal_max, gt_min, gt_max): 26 | """Compute IoP score between a groundtruth bbox and the proposals. 27 | 28 | Compute the IoP which is defined as the overlap ratio with 29 | groundtruth proportional to the duration of this proposal. 30 | 31 | Args: 32 | proposal_min (list[float]): List of temporal anchor min. 33 | proposal_max (list[float]): List of temporal anchor max. 34 | gt_min (float): Groundtruth temporal box min. 35 | gt_max (float): Groundtruth temporal box max. 36 | 37 | Returns: 38 | list[float]: List of intersection over anchor scores. 39 | """ 40 | len_anchors = np.array(proposal_max - proposal_min) 41 | int_tmin = np.maximum(proposal_min, gt_min) 42 | int_tmax = np.minimum(proposal_max, gt_max) 43 | inter_len = np.maximum(int_tmax - int_tmin, 0.) 44 | scores = np.divide(inter_len, len_anchors) 45 | return scores 46 | 47 | 48 | def soft_nms(proposals, alpha, low_threshold, high_threshold, top_k): 49 | """Soft NMS for temporal proposals. 50 | 51 | Args: 52 | proposals (np.ndarray): Proposals generated by network. 53 | alpha (float): Alpha value of Gaussian decaying function. 54 | low_threshold (float): Low threshold for soft nms. 55 | high_threshold (float): High threshold for soft nms. 56 | top_k (int): Top k values to be considered. 57 | 58 | Returns: 59 | np.ndarray: The updated proposals. 60 | """ 61 | proposals = proposals[proposals[:, -1].argsort()[::-1]] 62 | tstart = list(proposals[:, 0]) 63 | tend = list(proposals[:, 1]) 64 | tscore = list(proposals[:, -1]) 65 | rstart = [] 66 | rend = [] 67 | rscore = [] 68 | 69 | while len(tscore) > 0 and len(rscore) <= top_k: 70 | max_index = np.argmax(tscore) 71 | max_width = tend[max_index] - tstart[max_index] 72 | iou_list = temporal_iou(tstart[max_index], tend[max_index], 73 | np.array(tstart), np.array(tend)) 74 | iou_exp_list = np.exp(-np.square(iou_list) / alpha) 75 | 76 | for idx, _ in enumerate(tscore): 77 | if idx != max_index: 78 | current_iou = iou_list[idx] 79 | if current_iou > low_threshold + (high_threshold - 80 | low_threshold) * max_width: 81 | tscore[idx] = tscore[idx] * iou_exp_list[idx] 82 | 83 | rstart.append(tstart[max_index]) 84 | rend.append(tend[max_index]) 85 | rscore.append(tscore[max_index]) 86 | tstart.pop(max_index) 87 | tend.pop(max_index) 88 | tscore.pop(max_index) 89 | 90 | rstart = np.array(rstart).reshape(-1, 1) 91 | rend = np.array(rend).reshape(-1, 1) 92 | rscore = np.array(rscore).reshape(-1, 1) 93 | new_proposals = np.concatenate((rstart, rend, rscore), axis=1) 94 | return new_proposals 95 | -------------------------------------------------------------------------------- /mmaction/core/evaluation/ava_evaluation/np_box_ops.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Operations for [N, 4] numpy arrays representing bounding boxes. 16 | 17 | Example box operations that are supported: 18 | * Areas: compute bounding box areas 19 | * IOU: pairwise intersection-over-union scores 20 | """ 21 | 22 | import numpy as np 23 | 24 | 25 | def area(boxes): 26 | """Computes area of boxes. 27 | 28 | Args: 29 | boxes: Numpy array with shape [N, 4] holding N boxes 30 | 31 | Returns: 32 | a numpy array with shape [N*1] representing box areas 33 | """ 34 | return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) 35 | 36 | 37 | def intersection(boxes1, boxes2): 38 | """Compute pairwise intersection areas between boxes. 39 | 40 | Args: 41 | boxes1: a numpy array with shape [N, 4] holding N boxes 42 | boxes2: a numpy array with shape [M, 4] holding M boxes 43 | 44 | Returns: 45 | a numpy array with shape [N*M] representing pairwise intersection area 46 | """ 47 | [y_min1, x_min1, y_max1, x_max1] = np.split(boxes1, 4, axis=1) 48 | [y_min2, x_min2, y_max2, x_max2] = np.split(boxes2, 4, axis=1) 49 | 50 | all_pairs_min_ymax = np.minimum(y_max1, np.transpose(y_max2)) 51 | all_pairs_max_ymin = np.maximum(y_min1, np.transpose(y_min2)) 52 | intersect_heights = np.maximum( 53 | np.zeros(all_pairs_max_ymin.shape), 54 | all_pairs_min_ymax - all_pairs_max_ymin) 55 | all_pairs_min_xmax = np.minimum(x_max1, np.transpose(x_max2)) 56 | all_pairs_max_xmin = np.maximum(x_min1, np.transpose(x_min2)) 57 | intersect_widths = np.maximum( 58 | np.zeros(all_pairs_max_xmin.shape), 59 | all_pairs_min_xmax - all_pairs_max_xmin) 60 | return intersect_heights * intersect_widths 61 | 62 | 63 | def iou(boxes1, boxes2): 64 | """Computes pairwise intersection-over-union between box collections. 65 | 66 | Args: 67 | boxes1: a numpy array with shape [N, 4] holding N boxes. 68 | boxes2: a numpy array with shape [M, 4] holding N boxes. 69 | 70 | Returns: 71 | a numpy array with shape [N, M] representing pairwise iou scores. 72 | """ 73 | intersect = intersection(boxes1, boxes2) 74 | area1 = area(boxes1) 75 | area2 = area(boxes2) 76 | union = ( 77 | np.expand_dims(area1, axis=1) + np.expand_dims(area2, axis=0) - 78 | intersect) 79 | return intersect / union 80 | 81 | 82 | def ioa(boxes1, boxes2): 83 | """Computes pairwise intersection-over-area between box collections. 84 | 85 | Intersection-over-area (ioa) between two boxes box1 and box2 is defined as 86 | their intersection area over box2's area. Note that ioa is not symmetric, 87 | that is, IOA(box1, box2) != IOA(box2, box1). 88 | 89 | Args: 90 | boxes1: a numpy array with shape [N, 4] holding N boxes. 91 | boxes2: a numpy array with shape [M, 4] holding N boxes. 92 | 93 | Returns: 94 | a numpy array with shape [N, M] representing pairwise ioa scores. 95 | """ 96 | intersect = intersection(boxes1, boxes2) 97 | areas = np.expand_dims(area(boxes2), axis=0) 98 | return intersect / areas 99 | -------------------------------------------------------------------------------- /mmaction/models/heads/base.py: -------------------------------------------------------------------------------- 1 | from abc import ABCMeta, abstractmethod 2 | 3 | import torch 4 | import torch.nn as nn 5 | 6 | from ...core import top_k_accuracy 7 | from ..builder import build_loss 8 | 9 | 10 | class AvgConsensus(nn.Module): 11 | """Average consensus module. 12 | 13 | Args: 14 | dim (int): Decide which dim consensus function to apply. 15 | Default: 1. 16 | """ 17 | 18 | def __init__(self, dim=1): 19 | super().__init__() 20 | self.dim = dim 21 | 22 | def forward(self, x): 23 | """Defines the computation performed at every call.""" 24 | return x.mean(dim=self.dim, keepdim=True) 25 | 26 | 27 | class BaseHead(nn.Module, metaclass=ABCMeta): 28 | """Base class for head. 29 | 30 | All Head should subclass it. 31 | All subclass should overwrite: 32 | - Methods:``init_weights``, initializing weights in some modules. 33 | - Methods:``forward``, supporting to forward both for training and testing. 34 | 35 | Args: 36 | num_classes (int): Number of classes to be classified. 37 | in_channels (int): Number of channels in input feature. 38 | loss_cls (dict): Config for building loss. 39 | Default: dict(type='CrossEntropyLoss', loss_weight=1.0). 40 | multi_class (bool): Determines whether it is a multi-class 41 | recognition task. Default: False. 42 | label_smooth_eps (float): Epsilon used in label smooth. 43 | Reference: arxiv.org/abs/1906.02629. Default: 0. 44 | """ 45 | 46 | def __init__(self, 47 | num_classes, 48 | in_channels, 49 | loss_cls=dict(type='CrossEntropyLoss', loss_weight=1.0), 50 | multi_class=False, 51 | label_smooth_eps=0.0): 52 | super().__init__() 53 | self.num_classes = num_classes 54 | self.in_channels = in_channels 55 | self.loss_cls = build_loss(loss_cls) 56 | self.multi_class = multi_class 57 | self.label_smooth_eps = label_smooth_eps 58 | 59 | @abstractmethod 60 | def init_weights(self): 61 | """Initiate the parameters either from existing checkpoint or from 62 | scratch.""" 63 | 64 | @abstractmethod 65 | def forward(self, x): 66 | """Defines the computation performed at every call.""" 67 | 68 | def loss(self, cls_score, labels, **kwargs): 69 | """Calculate the loss given output ``cls_score``, target ``labels``. 70 | 71 | Args: 72 | cls_score (torch.Tensor): The output of the model. 73 | labels (torch.Tensor): The target output of the model. 74 | 75 | Returns: 76 | dict: A dict containing field 'loss_cls'(mandatory) 77 | and 'top1_acc', 'top5_acc'(optional). 78 | """ 79 | losses = dict() 80 | if labels.shape == torch.Size([]): 81 | labels = labels.unsqueeze(0) 82 | 83 | if not self.multi_class: 84 | top_k_acc = top_k_accuracy(cls_score.detach().cpu().numpy(), 85 | labels.detach().cpu().numpy(), (1, 5)) 86 | losses['top1_acc'] = torch.tensor( 87 | top_k_acc[0], device=cls_score.device) 88 | losses['top5_acc'] = torch.tensor( 89 | top_k_acc[1], device=cls_score.device) 90 | 91 | elif self.label_smooth_eps != 0: 92 | labels = ((1 - self.label_smooth_eps) * labels + 93 | self.label_smooth_eps / self.num_classes) 94 | 95 | loss_cls = self.loss_cls(cls_score, labels, **kwargs) 96 | # loss_cls may be dictionary or single tensor 97 | if isinstance(loss_cls, dict): 98 | losses.update(loss_cls) 99 | else: 100 | losses['loss_cls'] = loss_cls 101 | 102 | return losses 103 | -------------------------------------------------------------------------------- /mmaction/models/common/conv2plus1d.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | from mmcv.cnn import CONV_LAYERS, build_norm_layer, constant_init, kaiming_init 3 | from torch.nn.modules.utils import _triple 4 | 5 | 6 | @CONV_LAYERS.register_module() 7 | class Conv2plus1d(nn.Module): 8 | """(2+1)d Conv module for R(2+1)d backbone. 9 | 10 | https://arxiv.org/pdf/1711.11248.pdf. 11 | 12 | Args: 13 | in_channels (int): Same as nn.Conv3d. 14 | out_channels (int): Same as nn.Conv3d. 15 | kernel_size (int | tuple[int]): Same as nn.Conv3d. 16 | stride (int | tuple[int]): Same as nn.Conv3d. 17 | padding (int | tuple[int]): Same as nn.Conv3d. 18 | dilation (int | tuple[int]): Same as nn.Conv3d. 19 | groups (int): Same as nn.Conv3d. 20 | bias (bool | str): If specified as `auto`, it will be decided by the 21 | norm_cfg. Bias will be set as True if norm_cfg is None, otherwise 22 | False. 23 | """ 24 | 25 | def __init__(self, 26 | in_channels, 27 | out_channels, 28 | kernel_size, 29 | stride=1, 30 | padding=0, 31 | dilation=1, 32 | groups=1, 33 | bias=True, 34 | norm_cfg=dict(type='BN3d')): 35 | super().__init__() 36 | 37 | kernel_size = _triple(kernel_size) 38 | stride = _triple(stride) 39 | padding = _triple(padding) 40 | assert len(kernel_size) == len(stride) == len(padding) == 3 41 | 42 | self.in_channels = in_channels 43 | self.out_channels = out_channels 44 | self.kernel_size = kernel_size 45 | self.stride = stride 46 | self.padding = padding 47 | self.dilation = dilation 48 | self.groups = groups 49 | self.bias = bias 50 | self.norm_cfg = norm_cfg 51 | self.output_padding = (0, 0, 0) 52 | self.transposed = False 53 | 54 | # The middle-plane is calculated according to: 55 | # M_i = \floor{\frac{t * d^2 N_i-1 * N_i} 56 | # {d^2 * N_i-1 + t * N_i}} 57 | # where d, t are spatial and temporal kernel, and 58 | # N_i, N_i-1 are planes 59 | # and inplanes. https://arxiv.org/pdf/1711.11248.pdf 60 | mid_channels = 3 * ( 61 | in_channels * out_channels * kernel_size[1] * kernel_size[2]) 62 | mid_channels /= ( 63 | in_channels * kernel_size[1] * kernel_size[2] + 3 * out_channels) 64 | mid_channels = int(mid_channels) 65 | 66 | self.conv_s = nn.Conv3d( 67 | in_channels, 68 | mid_channels, 69 | kernel_size=(1, kernel_size[1], kernel_size[2]), 70 | stride=(1, stride[1], stride[2]), 71 | padding=(0, padding[1], padding[2]), 72 | bias=bias) 73 | _, self.bn_s = build_norm_layer(self.norm_cfg, mid_channels) 74 | self.relu = nn.ReLU(inplace=True) 75 | self.conv_t = nn.Conv3d( 76 | mid_channels, 77 | out_channels, 78 | kernel_size=(kernel_size[0], 1, 1), 79 | stride=(stride[0], 1, 1), 80 | padding=(padding[0], 0, 0), 81 | bias=bias) 82 | 83 | self.init_weights() 84 | 85 | def forward(self, x): 86 | """Defines the computation performed at every call. 87 | 88 | Args: 89 | x (torch.Tensor): The input data. 90 | 91 | Returns: 92 | torch.Tensor: The output of the module. 93 | """ 94 | x = self.conv_s(x) 95 | x = self.bn_s(x) 96 | x = self.relu(x) 97 | x = self.conv_t(x) 98 | return x 99 | 100 | def init_weights(self): 101 | """Initiate the parameters from scratch.""" 102 | kaiming_init(self.conv_s) 103 | kaiming_init(self.conv_t) 104 | constant_init(self.bn_s, 1, bias=0) 105 | -------------------------------------------------------------------------------- /mmaction/core/evaluation/recall.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import torch 3 | 4 | from mmaction.utils import import_module_error_func 5 | 6 | try: 7 | from mmdet.core import bbox_overlaps 8 | except (ImportError, ModuleNotFoundError): 9 | 10 | @import_module_error_func('mmdet') 11 | def bbox_overlaps(*args, **kwargs): 12 | pass 13 | 14 | 15 | def _recalls(all_ious, proposal_nums, thrs): 16 | 17 | img_num = all_ious.shape[0] 18 | total_gt_num = sum([ious.shape[0] for ious in all_ious]) 19 | 20 | ious_ = np.zeros((proposal_nums.size, total_gt_num), dtype=np.float32) 21 | for k, proposal_num in enumerate(proposal_nums): 22 | tmp_ious = np.zeros(0) 23 | for i in range(img_num): 24 | ious = all_ious[i][:, :proposal_num].copy() 25 | gt_ious = np.zeros(ious.shape[0]) 26 | if ious.size == 0: 27 | tmp_ious = np.hstack((tmp_ious, gt_ious)) 28 | continue 29 | for j in range(ious.shape[0]): 30 | gt_max_overlaps = ious.argmax(axis=1) 31 | max_ious = ious[np.arange(0, ious.shape[0]), gt_max_overlaps] 32 | gt_idx = max_ious.argmax() 33 | gt_ious[j] = max_ious[gt_idx] 34 | box_idx = gt_max_overlaps[gt_idx] 35 | ious[gt_idx, :] = -1 36 | ious[:, box_idx] = -1 37 | tmp_ious = np.hstack((tmp_ious, gt_ious)) 38 | ious_[k, :] = tmp_ious 39 | 40 | ious_ = np.fliplr(np.sort(ious_, axis=1)) 41 | recalls = np.zeros((proposal_nums.size, thrs.size)) 42 | for i, thr in enumerate(thrs): 43 | recalls[:, i] = (ious_ >= thr).sum(axis=1) / float(total_gt_num) 44 | 45 | return recalls 46 | 47 | 48 | def set_recall_param(proposal_nums, iou_thrs): 49 | """Check proposal_nums and iou_thrs and set correct format.""" 50 | if isinstance(proposal_nums, list): 51 | proposal_nums_ = np.array(proposal_nums) 52 | elif isinstance(proposal_nums, int): 53 | proposal_nums_ = np.array([proposal_nums]) 54 | else: 55 | proposal_nums_ = proposal_nums 56 | 57 | if iou_thrs is None: 58 | _iou_thrs = np.array([0.5]) 59 | elif isinstance(iou_thrs, list): 60 | _iou_thrs = np.array(iou_thrs) 61 | elif isinstance(iou_thrs, float): 62 | _iou_thrs = np.array([iou_thrs]) 63 | else: 64 | _iou_thrs = iou_thrs 65 | 66 | return proposal_nums_, _iou_thrs 67 | 68 | 69 | def eval_recalls(gts, proposals, proposal_nums=None, iou_thrs=None): 70 | """Calculate recalls. 71 | 72 | Args: 73 | gts(list or ndarray): a list of arrays of shape (n, 4) 74 | proposals(list or ndarray): a list of arrays of shape (k, 4) or (k, 5) 75 | proposal_nums(int or list of int or ndarray): top N proposals 76 | thrs(float or list or ndarray): iou thresholds 77 | Returns: 78 | ndarray: recalls of different ious and proposal nums 79 | """ 80 | 81 | img_num = len(gts) 82 | assert img_num == len(proposals) 83 | 84 | proposal_nums, iou_thrs = set_recall_param(proposal_nums, iou_thrs) 85 | 86 | all_ious = [] 87 | for i in range(img_num): 88 | if proposals[i].ndim == 2 and proposals[i].shape[1] == 5: 89 | scores = proposals[i][:, 4] 90 | sort_idx = np.argsort(scores)[::-1] 91 | img_proposal = proposals[i][sort_idx, :] 92 | else: 93 | img_proposal = proposals[i] 94 | 95 | prop_num = min(img_proposal.shape[0], proposal_nums[-1]) 96 | if gts[i] is None or gts[i].shape[0] == 0: 97 | ious = np.zeros((0, img_proposal.shape[0]), dtype=np.float32) 98 | else: 99 | ious = bbox_overlaps( 100 | torch.tensor(gts[i]), 101 | torch.tensor(img_proposal[:prop_num, :4])) 102 | ious = ious.data.numpy() 103 | all_ious.append(ious) 104 | all_ious = np.array(all_ious) 105 | recalls = _recalls(all_ious, proposal_nums, iou_thrs) 106 | return recalls 107 | -------------------------------------------------------------------------------- /mmaction/models/recognizers/audio_recognizer.py: -------------------------------------------------------------------------------- 1 | from ..registry import RECOGNIZERS 2 | from .base import BaseRecognizer 3 | 4 | 5 | @RECOGNIZERS.register_module() 6 | class AudioRecognizer(BaseRecognizer): 7 | """Audio recognizer model framework.""" 8 | 9 | def forward(self, audios, label=None, return_loss=True): 10 | """Define the computation performed at every call.""" 11 | if return_loss: 12 | if label is None: 13 | raise ValueError('Label should not be None.') 14 | return self.forward_train(audios, label) 15 | 16 | return self.forward_test(audios) 17 | 18 | def forward_train(self, audios, labels): 19 | """Defines the computation performed at every call when training.""" 20 | audios = audios.reshape((-1, ) + audios.shape[2:]) 21 | x = self.extract_feat(audios) 22 | cls_score = self.cls_head(x) 23 | gt_labels = labels.squeeze() 24 | loss = self.cls_head.loss(cls_score, gt_labels) 25 | 26 | return loss 27 | 28 | def forward_test(self, audios): 29 | """Defines the computation performed at every call when evaluation and 30 | testing.""" 31 | num_segs = audios.shape[1] 32 | audios = audios.reshape((-1, ) + audios.shape[2:]) 33 | x = self.extract_feat(audios) 34 | cls_score = self.cls_head(x) 35 | cls_score = self.average_clip(cls_score, num_segs) 36 | 37 | return cls_score.cpu().numpy() 38 | 39 | def forward_gradcam(self, audios): 40 | raise NotImplementedError 41 | 42 | def train_step(self, data_batch, optimizer, **kwargs): 43 | """The iteration step during training. 44 | 45 | This method defines an iteration step during training, except for the 46 | back propagation and optimizer updating, which are done in an optimizer 47 | hook. Note that in some complicated cases or models, the whole process 48 | including back propagation and optimizer updating is also defined in 49 | this method, such as GAN. 50 | 51 | Args: 52 | data_batch (dict): The output of dataloader. 53 | optimizer (:obj:`torch.optim.Optimizer` | dict): The optimizer of 54 | runner is passed to ``train_step()``. This argument is unused 55 | and reserved. 56 | 57 | Returns: 58 | dict: It should contain at least 3 keys: ``loss``, ``log_vars``, 59 | ``num_samples``. 60 | ``loss`` is a tensor for back propagation, which can be a 61 | weighted sum of multiple losses. 62 | ``log_vars`` contains all the variables to be sent to the 63 | logger. 64 | ``num_samples`` indicates the batch size (when the model is 65 | DDP, it means the batch size on each GPU), which is used for 66 | averaging the logs. 67 | """ 68 | audios = data_batch['audios'] 69 | label = data_batch['label'] 70 | 71 | losses = self(audios, label) 72 | 73 | loss, log_vars = self._parse_losses(losses) 74 | 75 | outputs = dict( 76 | loss=loss, 77 | log_vars=log_vars, 78 | num_samples=len(next(iter(data_batch.values())))) 79 | 80 | return outputs 81 | 82 | def val_step(self, data_batch, optimizer, **kwargs): 83 | """The iteration step during validation. 84 | 85 | This method shares the same signature as :func:`train_step`, but used 86 | during val epochs. Note that the evaluation after training epochs is 87 | not implemented with this method, but an evaluation hook. 88 | """ 89 | audios = data_batch['audios'] 90 | label = data_batch['label'] 91 | 92 | losses = self(audios, label) 93 | 94 | loss, log_vars = self._parse_losses(losses) 95 | 96 | outputs = dict( 97 | loss=loss, 98 | log_vars=log_vars, 99 | num_samples=len(next(iter(data_batch.values())))) 100 | 101 | return outputs 102 | -------------------------------------------------------------------------------- /mmaction/models/recognizers/recognizer2d.py: -------------------------------------------------------------------------------- 1 | from ..registry import RECOGNIZERS 2 | from .base import BaseRecognizer 3 | 4 | 5 | @RECOGNIZERS.register_module() 6 | class Recognizer2D(BaseRecognizer): 7 | """2D recognizer model framework.""" 8 | 9 | def forward_train(self, imgs, labels, **kwargs): 10 | """Defines the computation performed at every call when training.""" 11 | batches = imgs.shape[0] 12 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 13 | num_segs = imgs.shape[0] // batches 14 | 15 | losses = dict() 16 | 17 | x = self.extract_feat(imgs) 18 | if hasattr(self, 'neck'): 19 | x = [ 20 | each.reshape((-1, num_segs) + 21 | each.shape[1:]).transpose(1, 2).contiguous() 22 | for each in x 23 | ] 24 | x, _ = self.neck(x, labels.squeeze()) 25 | x = x.squeeze(2) 26 | num_segs = 1 27 | 28 | cls_score = self.cls_head(x, num_segs) 29 | gt_labels = labels.squeeze() 30 | loss_cls = self.cls_head.loss(cls_score, gt_labels, **kwargs) 31 | losses.update(loss_cls) 32 | 33 | return losses 34 | 35 | def _do_test(self, imgs): 36 | """Defines the computation performed at every call when evaluation, 37 | testing and gradcam.""" 38 | batches = imgs.shape[0] 39 | 40 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 41 | num_segs = imgs.shape[0] // batches 42 | 43 | losses = dict() 44 | 45 | x = self.extract_feat(imgs) 46 | if hasattr(self, 'neck'): 47 | x = [ 48 | each.reshape((-1, num_segs) + 49 | each.shape[1:]).transpose(1, 2).contiguous() 50 | for each in x 51 | ] 52 | x, loss_aux = self.neck(x) 53 | x = x.squeeze(2) 54 | losses.update(loss_aux) 55 | num_segs = 1 56 | 57 | # When using `TSNHead` or `TPNHead`, shape is [batch_size, num_classes] 58 | # When using `TSMHead`, shape is [batch_size * num_crops, num_classes] 59 | # `num_crops` is calculated by: 60 | # 1) `twice_sample` in `SampleFrames` 61 | # 2) `num_sample_positions` in `DenseSampleFrames` 62 | # 3) `ThreeCrop/TenCrop/MultiGroupCrop` in `test_pipeline` 63 | # 4) `num_clips` in `SampleFrames` or its subclass if `clip_len != 1` 64 | cls_score = self.cls_head(x, num_segs) 65 | 66 | assert cls_score.size()[0] % batches == 0 67 | # calculate num_crops automatically 68 | cls_score = self.average_clip(cls_score, 69 | cls_score.size()[0] // batches) 70 | 71 | return cls_score 72 | 73 | def forward_test(self, imgs): 74 | """Defines the computation performed at every call when evaluation and 75 | testing.""" 76 | return self._do_test(imgs).cpu().numpy() 77 | 78 | def forward_dummy(self, imgs): 79 | """Used for computing network FLOPs. 80 | 81 | See ``tools/analysis/get_flops.py``. 82 | 83 | Args: 84 | imgs (torch.Tensor): Input images. 85 | 86 | Returns: 87 | Tensor: Class score. 88 | """ 89 | batches = imgs.shape[0] 90 | imgs = imgs.reshape((-1, ) + imgs.shape[2:]) 91 | num_segs = imgs.shape[0] // batches 92 | 93 | x = self.extract_feat(imgs) 94 | if hasattr(self, 'neck'): 95 | x = [ 96 | each.reshape((-1, num_segs) + 97 | each.shape[1:]).transpose(1, 2).contiguous() 98 | for each in x 99 | ] 100 | x, _ = self.neck(x) 101 | x = x.squeeze(2) 102 | num_segs = 1 103 | 104 | outs = (self.cls_head(x, num_segs), ) 105 | return outs 106 | 107 | def forward_gradcam(self, imgs): 108 | """Defines the computation performed at every call when using gradcam 109 | utils.""" 110 | return self._do_test(imgs) 111 | -------------------------------------------------------------------------------- /mmaction/models/backbones/tanet.py: -------------------------------------------------------------------------------- 1 | from copy import deepcopy 2 | 3 | import torch.nn as nn 4 | from torch.utils import checkpoint as cp 5 | 6 | from ..common import TAM 7 | from ..registry import BACKBONES 8 | from .resnet import Bottleneck, ResNet 9 | 10 | 11 | class TABlock(nn.Module): 12 | """Temporal Adaptive Block (TA-Block) for TANet. 13 | 14 | This block is proposed in `TAM: TEMPORAL ADAPTIVE MODULE FOR VIDEO 15 | RECOGNITION `_ 16 | 17 | The temporal adaptive module (TAM) is embedded into ResNet-Block 18 | after the first Conv2D, which turns the vanilla ResNet-Block 19 | into TA-Block. 20 | 21 | Args: 22 | block (nn.Module): Residual blocks to be substituted. 23 | num_segments (int): Number of frame segments. 24 | tam_cfg (dict): Config for temporal adaptive module (TAM). 25 | Default: dict(). 26 | """ 27 | 28 | def __init__(self, block, num_segments, tam_cfg=dict()): 29 | super().__init__() 30 | self.tam_cfg = deepcopy(tam_cfg) 31 | self.block = block 32 | self.num_segments = num_segments 33 | self.tam = TAM( 34 | in_channels=block.conv1.out_channels, 35 | num_segments=num_segments, 36 | **self.tam_cfg) 37 | 38 | if not isinstance(self.block, Bottleneck): 39 | raise NotImplementedError('TA-Blocks have not been fully ' 40 | 'implemented except the pattern based ' 41 | 'on Bottleneck block.') 42 | 43 | def forward(self, x): 44 | if isinstance(self.block, Bottleneck): 45 | 46 | def _inner_forward(x): 47 | """Forward wrapper for utilizing checkpoint.""" 48 | identity = x 49 | 50 | out = self.block.conv1(x) 51 | out = self.tam(out) 52 | out = self.block.conv2(out) 53 | out = self.block.conv3(out) 54 | 55 | if self.block.downsample is not None: 56 | identity = self.block.downsample(x) 57 | 58 | out = out + identity 59 | 60 | return out 61 | 62 | if self.block.with_cp and x.requires_grad: 63 | out = cp.checkpoint(_inner_forward, x) 64 | else: 65 | out = _inner_forward(x) 66 | 67 | out = self.block.relu(out) 68 | 69 | return out 70 | 71 | 72 | @BACKBONES.register_module() 73 | class TANet(ResNet): 74 | """Temporal Adaptive Network (TANet) backbone. 75 | 76 | This backbone is proposed in `TAM: TEMPORAL ADAPTIVE MODULE FOR VIDEO 77 | RECOGNITION `_ 78 | 79 | Embedding the temporal adaptive module (TAM) into ResNet to 80 | instantiate TANet. 81 | 82 | Args: 83 | depth (int): Depth of resnet, from {18, 34, 50, 101, 152}. 84 | num_segments (int): Number of frame segments. 85 | tam_cfg (dict | None): Config for temporal adaptive module (TAM). 86 | Default: dict(). 87 | **kwargs (keyword arguments, optional): Arguments for ResNet except 88 | ```depth```. 89 | """ 90 | 91 | def __init__(self, depth, num_segments, tam_cfg=dict(), **kwargs): 92 | super().__init__(depth, **kwargs) 93 | assert num_segments >= 3 94 | self.num_segments = num_segments 95 | self.tam_cfg = deepcopy(tam_cfg) 96 | 97 | def init_weights(self): 98 | super().init_weights() 99 | self.make_tam_modeling() 100 | 101 | def make_tam_modeling(self): 102 | """Replace ResNet-Block with TA-Block.""" 103 | 104 | def make_tam_block(stage, num_segments, tam_cfg=dict()): 105 | blocks = list(stage.children()) 106 | for i, block in enumerate(blocks): 107 | blocks[i] = TABlock(block, num_segments, deepcopy(tam_cfg)) 108 | return nn.Sequential(*blocks) 109 | 110 | for i in range(self.num_stages): 111 | layer_name = f'layer{i + 1}' 112 | res_layer = getattr(self, layer_name) 113 | setattr(self, layer_name, 114 | make_tam_block(res_layer, self.num_segments, self.tam_cfg)) 115 | -------------------------------------------------------------------------------- /mmaction/models/roi_extractors/single_straight3d.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | from mmaction.utils import import_module_error_class 5 | 6 | try: 7 | from mmcv.ops import RoIAlign, RoIPool 8 | except (ImportError, ModuleNotFoundError): 9 | 10 | @import_module_error_class('mmcv-full') 11 | class RoIAlign(nn.Module): 12 | pass 13 | 14 | @import_module_error_class('mmcv-full') 15 | class RoIPool(nn.Module): 16 | pass 17 | 18 | 19 | try: 20 | from mmdet.models import ROI_EXTRACTORS 21 | mmdet_imported = True 22 | except (ImportError, ModuleNotFoundError): 23 | mmdet_imported = False 24 | 25 | 26 | class SingleRoIExtractor3D(nn.Module): 27 | """Extract RoI features from a single level feature map. 28 | 29 | Args: 30 | roi_layer_type (str): Specify the RoI layer type. Default: 'RoIAlign'. 31 | featmap_stride (int): Strides of input feature maps. Default: 16. 32 | output_size (int | tuple): Size or (Height, Width). Default: 16. 33 | sampling_ratio (int): number of inputs samples to take for each 34 | output sample. 0 to take samples densely for current models. 35 | Default: 0. 36 | pool_mode (str, 'avg' or 'max'): pooling mode in each bin. 37 | Default: 'avg'. 38 | aligned (bool): if False, use the legacy implementation in 39 | MMDetection. If True, align the results more perfectly. 40 | Default: True. 41 | with_temporal_pool (bool): if True, avgpool the temporal dim. 42 | Default: True. 43 | with_global (bool): if True, concatenate the RoI feature with global 44 | feature. Default: False. 45 | 46 | Note that sampling_ratio, pool_mode, aligned only apply when roi_layer_type 47 | is set as RoIAlign. 48 | """ 49 | 50 | def __init__(self, 51 | roi_layer_type='RoIAlign', 52 | featmap_stride=16, 53 | output_size=16, 54 | sampling_ratio=0, 55 | pool_mode='avg', 56 | aligned=True, 57 | with_temporal_pool=True, 58 | with_global=False): 59 | super().__init__() 60 | self.roi_layer_type = roi_layer_type 61 | assert self.roi_layer_type in ['RoIPool', 'RoIAlign'] 62 | self.featmap_stride = featmap_stride 63 | self.spatial_scale = 1. / self.featmap_stride 64 | 65 | self.output_size = output_size 66 | self.sampling_ratio = sampling_ratio 67 | self.pool_mode = pool_mode 68 | self.aligned = aligned 69 | 70 | self.with_temporal_pool = with_temporal_pool 71 | self.with_global = with_global 72 | 73 | if self.roi_layer_type == 'RoIPool': 74 | self.roi_layer = RoIPool(self.output_size, self.spatial_scale) 75 | else: 76 | self.roi_layer = RoIAlign( 77 | self.output_size, 78 | self.spatial_scale, 79 | sampling_ratio=self.sampling_ratio, 80 | pool_mode=self.pool_mode, 81 | aligned=self.aligned) 82 | self.global_pool = nn.AdaptiveAvgPool2d(self.output_size) 83 | 84 | def init_weights(self): 85 | pass 86 | 87 | # The shape of feat is N, C, T, H, W 88 | def forward(self, feat, rois): 89 | if not isinstance(feat, tuple): 90 | feat = (feat, ) 91 | if len(feat) >= 2: 92 | assert self.with_temporal_pool 93 | if self.with_temporal_pool: 94 | feat = [torch.mean(x, 2, keepdim=True) for x in feat] 95 | feat = torch.cat(feat, axis=1) 96 | 97 | roi_feats = [] 98 | for t in range(feat.size(2)): 99 | frame_feat = feat[:, :, t].contiguous() 100 | roi_feat = self.roi_layer(frame_feat, rois) 101 | if self.with_global: 102 | global_feat = self.global_pool(frame_feat.contiguous()) 103 | inds = rois[:, 0].type(torch.int64) 104 | global_feat = global_feat[inds] 105 | roi_feat = torch.cat([roi_feat, global_feat], dim=1) 106 | roi_feat = roi_feat.contiguous() 107 | roi_feats.append(roi_feat) 108 | 109 | return torch.stack(roi_feats, dim=2) 110 | 111 | 112 | if mmdet_imported: 113 | ROI_EXTRACTORS.register_module()(SingleRoIExtractor3D) 114 | --------------------------------------------------------------------------------