From 4d4430f74a3e9db61e2d0d8696a455b2f13e6a9c Mon Sep 17 00:00:00 2001 From: bkhuang Date: Mon, 22 Feb 2021 13:37:11 +0800 Subject: [PATCH 1/3] update --- README.md | 2 ++ docs/install.md | 8 +++++++- mmaction/models/builder.py | 4 ++++ requirements/optional.txt | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31a5821422..9c8eb4cbc0 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ The master branch works with **PyTorch 1.3+**. - For temporal action localization, we implement BSN, BMN, SSN. + - For spatial temporal detection, we implement SlowOnly, SlowFast. + - **Well tested and documented** We provide detailed documentation and API reference, as well as unittests. diff --git a/docs/install.md b/docs/install.md index 1eebf2cc4a..3343df68e3 100644 --- a/docs/install.md +++ b/docs/install.md @@ -113,7 +113,7 @@ pip install mmcv-full **Important:** You need to run `pip uninstall mmcv` first if you have mmcv installed. If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`. -d. Clone the MMAction2 repository +d. Clone the MMAction2 repository. ```shell git clone https://github.com/open-mmlab/mmaction2.git @@ -133,6 +133,12 @@ If you build MMAction2 on macOS, replace the last command with CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' pip install -e . ``` +f. Install mmdetection for spatial temporal detection tasks. + +This part is **optional** if you're not going to do spatial temporal detection. + +See [here](https://github.com/open-mmlab/mmdetection#installation) to install mmdetection. + Note: 1. The git commit id will be written to the version number with step d, e.g. 0.6.0+2e7045c. The version will also be saved in trained models. diff --git a/mmaction/models/builder.py b/mmaction/models/builder.py index c18fab8b64..ba2f2b82c1 100644 --- a/mmaction/models/builder.py +++ b/mmaction/models/builder.py @@ -74,6 +74,10 @@ def build_model(cfg, train_cfg=None, test_cfg=None): return build_recognizer(cfg, train_cfg, test_cfg) if obj_type in DETECTORS: return build_detector(cfg, train_cfg, test_cfg) + class_in_mmdet = ['FastRCNN', 'MaxIoUAssignerAVA', 'RandomSampler'] + if obj_type in class_in_mmdet: + raise ImportError( + 'Please install mmdet for spatial temporal detection tasks.') raise ValueError(f'{obj_type} is not registered in ' 'LOCALIZERS, RECOGNIZERS or DETECTORS') diff --git a/requirements/optional.txt b/requirements/optional.txt index 65529d53b8..6885f0b0ae 100644 --- a/requirements/optional.txt +++ b/requirements/optional.txt @@ -2,6 +2,7 @@ av decord >= 0.4.1 imgaug librosa +mmdet <= 2.9.0 moviepy onnx onnxruntime From ebb2607ccc25c94a2a6977e68514a87fa10b2315 Mon Sep 17 00:00:00 2001 From: bkhuang Date: Mon, 22 Feb 2021 13:43:33 +0800 Subject: [PATCH 2/3] remove mmdet bound --- requirements/optional.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/optional.txt b/requirements/optional.txt index 6885f0b0ae..65529d53b8 100644 --- a/requirements/optional.txt +++ b/requirements/optional.txt @@ -2,7 +2,6 @@ av decord >= 0.4.1 imgaug librosa -mmdet <= 2.9.0 moviepy onnx onnxruntime From 0591a7ff0d16603dcae366705a115cbe1fd12942 Mon Sep 17 00:00:00 2001 From: bkhuang Date: Mon, 22 Feb 2021 14:25:34 +0800 Subject: [PATCH 3/3] fix bugs --- mmaction/models/builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmaction/models/builder.py b/mmaction/models/builder.py index ba2f2b82c1..634c462bbe 100644 --- a/mmaction/models/builder.py +++ b/mmaction/models/builder.py @@ -74,8 +74,8 @@ def build_model(cfg, train_cfg=None, test_cfg=None): return build_recognizer(cfg, train_cfg, test_cfg) if obj_type in DETECTORS: return build_detector(cfg, train_cfg, test_cfg) - class_in_mmdet = ['FastRCNN', 'MaxIoUAssignerAVA', 'RandomSampler'] - if obj_type in class_in_mmdet: + model_in_mmdet = ['FastRCNN'] + if obj_type in model_in_mmdet: raise ImportError( 'Please install mmdet for spatial temporal detection tasks.') raise ValueError(f'{obj_type} is not registered in '