Commit Graph

372 Commits (f2c50930e48dfe01e59a69de7f7136a797162b25)

Author SHA1 Message Date
Wenwei Zhang dfa36dfe3b
Merge pull request #652 from dreamerlin/3d
[Feature] Add 3D support in wrapper
2020-11-20 16:33:54 +08:00
yamengxi ec43b671ab
[Enhance]enhance hsigmoid (#657)
* enhance hsigmoid

* delete int
2020-11-19 21:26:26 +08:00
dreamerlin e70dca8f86 add conv3d 2020-11-18 21:24:20 +08:00
dreamerlin 144e7567a7 use pytest.mark.parametrize 2020-11-18 15:35:21 +08:00
dreamerlin 86d9f4684a add MaxPool3d 2020-11-15 19:07:46 +08:00
dreamerlin 8ccea20234 add ConvTranspose3d 2020-11-15 18:56:02 +08:00
q.yao c390e327fa
add onnx support to roi_align and roi_pool (#593)
* add onnx support to roi_align and roi_pool

* add test on roi_align and roi_pool

* fix conflict with master
2020-11-14 19:56:35 +08:00
yamengxi c6c230df1b
[Feature] Add CLAHE method (#647)
* add CLAHE

* add CLAHE

* restore

* Add docstring

* modify docstring

* modify CLAHE to clahe

* fix syntax error

* simplify assert

* simplify assert

* add assert test

* fix unittest bug

* fix syntax bug

* fix assert bug
2020-11-11 22:34:14 +08:00
yamengxi d9ef9dabe2
[Feature] Add LUT transform (#646)
* add lut_transform

* restore

* fix test bug

* add test

* Fix syntax bug

* Delete test id

* modfiy docstrinng

* simplify assert
2020-11-11 17:32:41 +08:00
Jerry Jiarui XU bb06f354d5
[Feature] Add hook msg for checkpoint hook (#635)
* [Feature] Add hook msg for ckpt_hook

* [Feature] Add hook msg for ckpt_hook

* add test
2020-11-06 19:56:50 +08:00
Kuro Latency bcf85026c3
Update lr_updater.py (#574)
* Update lr_updater.py

since epoch/iteration in  runner starts with 0, we shouldn't leave the latter iteration to former (12th epoch for example, with first period equal to 12) period.

* Update lr_updater.py

* Update test_hooks.py
2020-11-05 22:20:37 +08:00
Kai Chen 03214fd446
Support pytorch 1.7 and update the CI (#631)
* support pytorch 1.7 and update the CI

* fix CI

* fix onnxruntime version in macos
2020-10-31 17:58:15 +08:00
Ruohui Wang 761f725b70
Misc updates regarding Windows and unittests (#586)
* SKIP bbox test without CUDA

* use full filepath for creating latest.pth
2020-10-28 16:23:19 +08:00
David de la Iglesia Castro 2e6c8ec803
Refactor logger hooks (#605)
* Refactor tags for consistency

* Fix missing runner

* Fix missing runner

* Fix missing runner

* Fix missing runner

* Fix momentum runner hook inner iter

* Fix tests

* pre-commit run
2020-10-28 12:43:50 +08:00
robin Han 23b2bdbf52
add unittest for onnx convert (#608)
* add unittest for onnx convert

* build onnx and onnxruntime in CI

* skip onnx op unit test while using CUDA

* fix offset==0 case in NMS

* remove tmp file used in test

* delete tmp file before assert so that we can remove the tmp file anyway
2020-10-26 11:33:35 +08:00
Jintao Lin a260a96a0f
import_modules_from_strings when loading cfg from file (#606)
* import_modules_from_strings when loading cfg from file

* add unittest to tell whether the feature is enabled as expected

* minor

* set an environment variable instead of writing a file

* use 'shutil' instead of 'os.system'
2020-10-15 22:29:24 +08:00
Wenwei Zhang 005c408748
Fix wrappers version comparison (#602)
* add version check in wrappers

* fix assersion

* use digital version for version comparison

* fix unit tests

* reformat

* fall back to compare the first two version

* fix unittest

* fix unittest

* fix unit test

* clean unnecessary change
2020-10-06 12:44:56 +08:00
GT9505 acee61d7c5
register deconv in CONV_LAYERS (#582)
* register deconv in CONV_LAYERS

* use ConvTranspose2d implemented in MMCV

* remove repetitive register_module

* update

* add unittest for deconv
2020-09-27 17:51:00 +08:00
Wenwei Zhang ed2887bb72
Support to specify LR of DCN's conv_offset (#344)
* Support to specify LR of DCN's conv_offset

* Resolve comments & add unit test

* Resolve formats

* Fix CI for DCN

* Mock DCN when cpu only

* Use mock for cpu testing

* Fix docstring and support ModulatedDCN

* set offset_lr_mult as dcn's arguments, link CU-49u01p

* fix lr bug

* fall back to set LR in constructor

* resolve comments
2020-09-25 20:51:58 +08:00
David de la Iglesia Castro 6b52e9b55f
Add runner builder (#570)
* Add build_runner

* Parametrize test_runner

* Add imports to runner __init__

* Refactor max_iters and max_epochs from run to init

* Add assertion error messages

* Add test_builder

* Make change retro-compatible

* Raise ValueError if max_epochs and max_iters
2020-09-25 10:25:29 +08:00
David de la Iglesia Castro 779f47bab9
Allow type to be default arg (#558)
* Add test case for type defined using default_args

* Refactor build_from_cfg

* Update exception of missing type

* pre-commit

* Fix default_args is None

* pre-commit

* Bring back test

* Update exception raising
2020-09-16 19:16:49 +08:00
Qiaofei Li a0cc5a8450
Supports brightness and contrast augmentations (#546)
* add brightness and contrast augmentation

* remove unnecessary

* reformat

* relax the precision constrain for adjust_brightness aug

* fix percision assertion error in unit test

* remove toy

* rename alpha as factor

* use np.testing.assert_allclose in place of np.less_equal
2020-09-14 12:14:43 +08:00
Wenwei Zhang c937d3953d
Mv wrappers into bricks and use wrappers in registry (#550)
* Mv wrappers into bricks and use wrappers in registry

* resolve import issues

* fix import issues

* set nn op forward to torch 1.6.1

* fix CI bug and add warning

* Fix CI by using patch mock

* mv warnings inside deprecated module's initialization
2020-09-12 21:59:17 +08:00
Xiaojie Li 49e32c2688
Implementation of 2D convolution in tensorflow with `padding` as "same" (#529)
* update impad

* fix docstring

* add shape for impad

* fix unit test

* remove old version & fix doc

* fix linting

* fix doc

* add linear decay learning rate scheduler

* fix impad

* fix setup.cfg

* fix linting

* add yapf

* add swish

* fix lr_updater

* fix lr_updater.py

* update swish

* add swish

* fix inplace

* fix typo

* update

* add same padding

* fix docstring

* add unittest

* fix register

* change name

Co-authored-by: lixiaojie <lixiaojie@sensetime.com>
2020-09-09 23:57:48 +08:00
Qiaofei Li a59a35bcce
Supports Equalize Augmentation. (#543)
* add equalize augmentation in mmcv

* delete unnecessary

* reformat

* remove clip in implementing equalize, and add uint test with case step=0

* remove clip in implementing equalize, and add uint test with case step=0

* add comments for unit test

* rename function name as imequalize
2020-09-08 14:44:14 +08:00
Qiaofei Li 95417a5d24
Supports Color augmentation. (#542)
* add Color augmentation

* reformat

* reformat

* reformat docstring

* reformat docstring

* add more unit test

* add more unit test

* add clip value and uint test for image with type float

* rename function name
2020-09-08 13:09:06 +08:00
Jintao Lin fec7cd61d6
Support reading video from url (#531)
* add url support for VideoReader

* add a comment

* add unittest

* use a connectable url for ci
2020-09-07 00:52:33 +08:00
Qiaofei Li 9769024fbd
Add Translate augmentation. (#538)
* add imtranslate

* add imtranslate

* update comments

* reformat
2020-09-04 20:30:42 +08:00
Qiaofei Li 06556c8459
Add shear augmentation (#526)
* Add shear augmentation

* Update geometric.py

* Update geometric.py
2020-09-02 10:57:36 +08:00
Xiaojie Li c3d8eb34ff
add Swish activation (#522)
* update impad

* fix docstring

* add shape for impad

* fix unit test

* remove old version & fix doc

* fix linting

* fix doc

* add linear decay learning rate scheduler

* fix impad

* fix setup.cfg

* fix linting

* add yapf

* add swish

* fix lr_updater

* fix lr_updater.py

* update swish

* add swish

* fix inplace

* fix typo

Co-authored-by: lixiaojie <lixiaojie@sensetime.com>
2020-08-27 00:39:17 +08:00
Kai Chen 66a38c86f8
Move unit tests to specific folders (#520)
* move unit tests to specific folders

* fix path error

* remove some assertions

* fix ignore path
2020-08-25 20:11:56 +08:00
Kai Chen 89e1716afe
Bump version to v1.1.1 (#518)
* bump version to 1.1.1

* add more version utils

* move parse_version_info to version.py
2020-08-24 16:30:45 +08:00
Wang Xinjiang 09b7d6c7dd
Import modules from a string list (#514)
* Custom imports

* Resolve comments

* Add unittest

* Add unittest

* Rename custom_imports to import_modules_from_strings

* Move import_modules_from_strings ito misc.py and allow failed imports

* small change

* small change

* change mmcv.runner to os.path
2020-08-24 13:45:34 +08:00
Kai Chen 270e470ee1
[feature] Add collect_env() to collect environment info (#517)
* [feature] Add collect_env() to collect environment info

* fix unit tests

* fix the case when ops are not compiled

* fix docstring
2020-08-24 13:41:54 +08:00
Wenwei Zhang f4a5446e15
Support to split batched_nms when box number is too large (#516)
* Support to split batched_nms when box number is too large

* mv data from gpu to cpu

* Set split_thr through nms_cfg

* clean code

* Update motivation in docstring

* fix typos
2020-08-24 00:32:39 +08:00
Jerry Jiarui XU 83d9a9c89b
[Feature] Add diagonal flip (#515) 2020-08-22 14:29:27 +08:00
Kevin 95a9728c42
Support pickle.loads (#499) (#500) 2020-08-21 13:06:00 +08:00
Cao Yuhang 7b18b97791
fix saconv (#489)
* fix saconv

* add parrots condition

* add unittest

* fix torch version
2020-08-16 01:45:01 +08:00
Wang Xinjiang eacaf475f7
fix some pavi logger hooks (#481)
* fix some pavi logger hooks

* fix unittest

* fix small bugs

* small change

* fix unittest

* Add EpochBasedRunner conditions

* Add session text

* fix small bug

* fetch runner mode from log buffer

* Add max_iter to pavi session text

* change yaml.dump to yamp.dump(yaml.load(mmcv.dump))

* Directly use by_epoch

* fix unittest

* add comments

* Use runner.epoch + 1 in pavi log

* fix runner.epoch issue for runner.mode=='val'

* fix runner.epoch issue for runner.mode=='val'

* Use abspath instead of realpath

* Add meta dump unittest

* small change

* Add comments
2020-08-16 01:20:08 +08:00
Jintao Lin c8e85b28e4
Add `tin_shift` function (#492)
* add tin shift

* add unittest

* add docstring

* add docstring

* parrots for tin_shift

* fix lint

* fix lint

Co-authored-by: jiaomenglei <jiaomenglei@sensetime.com>
2020-08-15 22:29:07 +08:00
Yuanhao Zhu 51c65c97ec
fix syncbn parameter order mismatch and parrots bug (#488) 2020-08-13 19:27:05 +08:00
Kai Chen cac22f8cf5
Add pytorch 1.6 to CI (#476)
* add pytorch 1.6 to CI

* fix typo

* fix ci error

Co-authored-by: Cao Yuhang <yhcao6@gmail.com>
2020-08-09 21:56:15 +08:00
Jerry Jiarui XU 56e71a718b
Add Depthwise Seperable ConvModule (#477) 2020-08-09 17:29:02 +08:00
Jintao Lin 9de04d2284
Replace `re` with `regex` (#457)
* replace `re` with `regex`

* add regex in requirements

* use regex on windows and re on linux

* update requirements.txt
2020-08-03 11:45:50 +08:00
shilong 1830347f8b
Ema (#421)
* add ema hook

* add ema hook resume

* add ema hook test

* fix typo

* fix according to comment

* delete logger

* fix according to comment

* fix unitest

* fix typo

* fix according to comment

* change to resume_from

* typo

* fix isort
2020-07-30 22:06:19 +08:00
Wang Xinjiang d4da3daa7e
Syncbuf (#447)
* More robust sync buffer hook

* More robust sync buffer hook

* Reformat
2020-07-25 12:51:46 +08:00
Wang Xinjiang 66604e83de
Add syncbuffer hook (#443)
* reformat

* reformat

* Add register hook from cfg

* docstring

* change according to comments
2020-07-24 14:15:44 +08:00
Jiamin 55fadb4c4e
Add runner.meta to checkpoint in save_checkpoint() (#438)
* fix: error when runner.meta is None

* tests: add unittest for epoch-based save_checkpoint
2020-07-20 11:40:04 +08:00
Yawei Li 7730a79fcd
fix typo of annealing (#433) 2020-07-17 23:48:22 +08:00
Jintao Lin 6ece0e5d19
Add pairwise function for 'gaussian' and 'concatenation' mode in NonLocal. (#424)
* add pairwise function for 'gaussian' and 'concatenation' mode

* rename test function

* decrease the complexity of nonlocal unittest

* fix typo and make unittest more complete

* add unittest when zero_init is False

* minor fix

* pack theta and phi

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-07-17 23:44:50 +08:00
Jerry Jiarui XU 9e3ff5f94c
Support pillow resize (#426)
* Support pillow resize

* add more types
2020-07-17 19:25:47 +08:00
Jerry Jiarui XU 4a044c6466
Support FP16 (#428)
* Support FP16

* update ci
2020-07-17 11:14:07 +08:00
Jerry Jiarui XU 7cfc839ea5
Add MMSyncBN in registry (#420)
* Add MMSyncBN in registery

* skip mmsyncbn test
2020-07-15 19:23:09 +08:00
Harry 5704613e28
Remove all module wrapper's module when saving checkpoint (#399)
* fix: remove all module wrapper when saving checkpoint

* refactor: move position of if

* docs: add docstring

* refactor: add _save_to_state_dict from official torch

* docs: modify docstring of _save_to_state_dict

* docs: modify docstring

* feat: add unittest

* feat: add DataParallel to unittest

* fix: a bug when model has batchnorm

* docs: update docstring
2020-07-08 23:20:22 +08:00
Joanna 27cc439d01
Update config to support predefined variables (#348)
* update config with predefined variables

* rm redun

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add test for config

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* support all types

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* newline at the end

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* update

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* extract code into a function and add docs

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix and add tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add unit tests and fix

* fix

* fix minor

* fix test
2020-07-08 20:53:54 +08:00
Cao Yuhang 926ac07bb8
Move fuse conv bn to mmcv (#382)
* move fuse conv bn to mmcv

* update doc

* update test conv bn

* rename

* fix doc and variable name

* change func name
2020-07-08 19:03:15 +08:00
Cao Yuhang d5cbf7eed1
Migrate op (#392)
* migrate op

* migrate unittest

* update build no torch

* add back use_torch_vision for roi align

* fix type and unit test

* ignore test logging when no torch

* fix no torch ci test

* skip test registry

* remove coverage report when no torch

* fix mac ci order

* install latest pillow when no torch

* mv convws to brisk
2020-07-08 17:29:15 +08:00
Kai Chen 63b7aa31b6
Fix docstring formats (#383)
* update doc formats

* update docstring
2020-07-04 00:55:25 +08:00
Jerry Jiarui XU 42f03d84de
Refactor plugins: move from ops to cnn (#380)
* Refator plugins: move from ops to cnn

* minior update

* minior update
2020-07-03 01:37:58 +08:00
Xiaojie Li 82211b407e
Added new features to `impad` (#377)
* update impad

* fix docstring

* add shape for impad

* fix unit test

* remove old version & fix doc

* fix linting

* fix doc

Co-authored-by: lixiaojie <lixiaojie@sensetime.com>
2020-07-02 19:34:46 +08:00
Jerry Jiarui XU 9c51928b7c
Add tensor2imgs in misc (#374)
* add tensor2imgs in misc

* rename

* fixed import

* raise error
2020-07-02 00:14:50 +08:00
Jintao Lin 1ebd7ea6fb
add unittest for set_random_seed (#376) 2020-07-02 00:13:04 +08:00
Jerry Jiarui XU 0970ae94c2
Add cpu ops (#370)
* update actiion

* remove 1.3 cuda

* reorder

* add no torch

* fixed version

* make py3.8 on pt1.5

* make py3.8 on pt1.5

* remove torch 1.3

* disable py3.8

* pip

* merge master with cuda compile fix

* add cpu roi align

* fixed test

* fixed no torch

* add CUDA_ARGS

* use one line

* gencode=61

* seperate jobs

* update lint

* use parametrize test

* formart and rename

* unit test for all
2020-06-30 12:09:48 +08:00
louzana 2c6fc5fd9b
fix bug of building ConvModule with HSigmoid using inplace=True and a… (#369)
* fix bug of building ConvModule with HSigmoid using inplace=True and add corresponding unittest

* fix linting
2020-06-28 23:27:14 +08:00
zhuyuanhao c0f5492ee9
add ext ops, support parrots (#310)
* add ext ops, support parrots

* fix lint

* fix lint

* update op from mmdetection

* support non-pytorch env

* fix import bug

* test not import mmcv.op

* rename mmcv.op to mmcv.ops

* fix compile warning

* 1. fix syncbn warning in pytorch 1.5
2. support only cpu compile
3. add point_sample from mmdet

* fix text bug

* update docstrings

* fix line endings

* minor updates

* remove non_local from ops

* bug fix for nonlocal2d

* rename ops_ext to _ext and _ext to _flow_warp_ext

* update the doc

* try clang-format github action

* fix github action

* add ops to api.rst

* fix cpp format

* fix clang format issues

* remove .clang-format

Co-authored-by: Kai Chen <chenkaidev@gmail.com>
2020-06-28 23:15:47 +08:00
Jintao Lin 9bc0b96d02
Add utils to calculate model complexity and adjust folder structure for mmcv/cnn/utils . (#366)
* Add utils to calculate model complexity info

* remove _InstanceNorm in unittest

* add docstring and increase unittest coverage

* fix deconv_flops_counter_hook to accept different data shape

* test when model is not a common instance

* put flops_counter.py and weight_init.py into mmcv/cnn/utils folder

* fix import name

* reformat some docstrings

* update the scripts with latest one and remove redundant codes

* directly represent a model without string and eval()

* reformat code
2020-06-26 21:38:29 +08:00
Harry 69048ff056
Specifying distributed training port in os.environ when training with slurm (#362)
* feat: support for os.environ port for slurm training

* fix: port data type

* feat: add flawed unittest

* feat: add flawed unittest

* docs: add comments

* fix: unittest

* fix: unittest
2020-06-20 00:49:44 +08:00
louzana fef7b2fea4
add hswish and hsigmoid (#358)
* add hswish and hsigmoid

* fix linting

* fix linting

* delete useless staticmethod in cnn/bricks/hsigmoid.py

* forward(x) ==> forward(seld, x)

* add unittests for hsigmoid and hswish

* use torch.equal instead of numpy.equal
2020-06-19 21:35:17 +08:00
Harry 4808988117
Fix potential bug in DefaultOptimizerConstructor (#355)
* fix: fix custom_keys whenweight_decay is not specified

* docs: small fix

* feat: add type check

* refactor: move if outside for
2020-06-18 22:07:16 +08:00
Jintao Lin dcc20f3a4b
Add `_NonLocalNd` module (#331)
* add non_local module

* rewrite non local module comments

* perfect docstring and adjust init function

* not to init norm layer

* Correct initialize when there is a norm

* set normal method for both embedded_gaussian and dot_product
2020-06-18 20:56:48 +08:00
Kai Chen 6bb244f255
add train_step() and val_step() for MMDP (#354) 2020-06-18 20:55:53 +08:00
Harry c74d729d92
Add custom_group to DefaultOptimizerConstrutor (#347)
* feat: add custom_group to DefaultOptimConstrutor

* refactor: move custom_groups validate to _validate_cfg

* docs: add doc to explain custom_groups

* feat: add unittest for non_exist_key

* refactor: one param per group

* fix: small fix

* fix: name

* docs: docstring

* refactor: change to mult for only lr and wd custom

* docs: docstring

* docs: more explaination

* feat: sort custom key

* docs: add docstring

* refactor: use reverse arg of sorted

* docs: fix comment

* docs: fix comment

* refactor: small modi

* refactor: small modi

* refactor: small modi
2020-06-17 23:39:50 +08:00
Kai Chen 657f03ad08
replace DeprecationWarning with UserWarning (#353) 2020-06-17 20:52:48 +08:00
Harry 799421003d
Add module wrapper registry (#352)
* feat: modify parallel to module wrapper

* fix: unittest

* fix: add registry file

* feat: add module wrapper unittest
2020-06-17 20:12:54 +08:00
Jerry Jiarui XU c6784f4acf
add backend arg (#350)
* add backend arg

* add test

* update doc, add test

* update test

* update doc
2020-06-17 19:42:31 +08:00
Wang Xinjiang 630b747cb1
added pillow backend in loading (#333)
* added pillow backend in loading

* reformat

* remove auto fill for RGBA

* change according to comments

* change according to comments

* reformat
2020-06-17 10:25:48 +08:00
Harry f28a7c7ed7
Add CosineRestartLrUpdaterHook (#319)
* feat: add CosineRestartLrUpdaterHook

* style: rename period to periods

* fix: bug in period 0

* feat: rename eta_min to min_lr and add min_lr_ratio

* docs: fix docstring of restart lr updater

* refactor: use annealing_cos

* docs: add docstring to annealing_cos

* feat: cosine restart lr update hook

* refactor: modify code order for unittest
2020-06-15 23:01:26 +08:00
lizz 9f04477f93
Harmless changes (#340)
* harmless changes

Signed-off-by: lizz <lizz@sensetime.com>

* Update conv_module.py

* No bracket for simple class

Signed-off-by: lizz <lizz@sensetime.com>
2020-06-15 11:29:01 +08:00
lizz b87e774f66
Remove more unused things (#338)
* Remove more unused things

Signed-off-by: lizz <lizz@sensetime.com>

* panic

Signed-off-by: lizz <lizz@sensetime.com>
2020-06-13 20:19:30 +08:00
Jintao Lin 5a98f7e421
enalbe memcached support in PetrelBackend (#341) 2020-06-13 18:32:48 +08:00
Harry 67a26da917
Add IterBasedRunner (#314)
* feat: add IterBasedRunner

* fix: unittest

* feat: more unittest

* fix: expose dataloader len

* minor updates of BaseRunner

* refactor: remove CosineRestartLrUpdaterHook

* style: add docstring

* refactor: update IterTextLoggerHook: fstring and exp_name

* fix: epoch_runner unittest

* refactor: remove IterBasedTextLogger

* fix: old IterTextLoggerHook issue

* refactor: remove __len__ of IterLoader

* feat: add IterBasedRunner to init

* feat: add __len__ to IterLoader

* fix some docstrings

* refactor: use is_parallel_module

* fix: import issue

* fix: runner unittest missing logger

* fix checkpoints

* feat: add by_epoch default value to IterBaseRunner regitering loggger_hook

* refactor: remove setting by_epoch in log_config

* minor refactoring

* docs: add docstring

* fix: remove unused doc

* update the log info for saving checkpoints

Co-authored-by: Kai Chen <chenkaidev@gmail.com>
2020-06-11 13:35:34 +08:00
Jerry Jiarui XU 61f9e91c9f
Add syntax check in .py config (#330)
* Add syntax check in .py config

* rename validate
2020-06-10 23:07:59 +08:00
Jerry Jiarui XU 2aa7712cb7
add more act w.o. inplace opt (#329) 2020-06-10 15:42:09 +08:00
Kai Chen 821b3ad622
Fix the BC issue of ddp (#325)
* fix the BC issue of ddp

* minor fix for the docstring
2020-06-08 22:34:19 +08:00
Jerry Jiarui XU a3ae781789
add reserved key in config (#315) 2020-06-04 14:55:28 +08:00
Kai Chen 35ba152821
Add a BaseRunner and rename Runner to EpochBasedRunner (#290)
* add a BaseRunner and rename Runner to EpochBasedRunner

* fix the train/val step

* bug fix

* update unit tests

* fix unit tests

* raise an error if both batch_processor and train_step are set

* add a unit test
2020-06-02 22:23:21 +08:00
Harry 6f21d8b560
Add optimizer constructor from mmdetection (#313)
* feat: add optimizer constructor

* refactor: version
2020-06-02 19:57:24 +08:00
Harry efecf7d1fe
fix building ConvModule with Tanh activation (#309)
* fix: tanh has not inplace

* feat: add ConvModule with Tanh
2020-06-01 21:26:51 +08:00
Kai Chen 213156cebb
Allow registering new backends with decorators (#307)
* allow registering new backends with decorators

* add a docstring

* minor update to the docstring
2020-05-31 21:56:03 +08:00
Wenwei Zhang 8ceb404ea6
Use mapping rather than dict for special keys (#304)
* Support path as a key in dict of config

* reformat test case

* update pre-commit version and fix format

* fix bug

* clean code

* reformat

* fix missing parts
2020-05-30 13:03:33 +08:00
Jerry Jiarui XU d6411b7fff
BC of model zoo: add deprecate urls (#301)
* add deprecate urls

* add deprecate urls

* warning test

* rename to deprecated.json
2020-05-27 22:09:06 +08:00
Jerry Jiarui XU 37d8facfad Support default/external json for open-mmlab models (#230)
* support default/external json for open-mmlab models

* add local

* add more test

* add docs

* add docs

* update docs

* refactor

* add json in MANIFEST

* fixed json typo
2020-05-27 17:12:43 +08:00
Jerry Jiarui XU 0946feabe3
add PetrelBackend (#294)
* add PetrelBackend

* update docs

* add path_maps for Ceph

* rename to path_mapping

* fixed import
2020-05-23 01:31:11 +08:00
Kai Chen 3bf3e8ef24
Revert "add PetrelBackend (#291)" (#293)
This reverts commit 7f80a2c6b9.
2020-05-23 01:07:43 +08:00
Jerry Jiarui XU 7f80a2c6b9
add PetrelBackend (#291)
* add PetrelBackend

* update docs

* add path_maps for Ceph

* rename to path_mapping
2020-05-22 12:31:34 +08:00
Jintao Lin 25d07e3d54
Support conv layers' own `init_weights` method (#278)
* Support conv layers' own `init_weights` method

* Add related unittest about ConvModule init_weight

* make the comments more specific
2020-05-13 22:58:16 +08:00
Wenwei Zhang c35c228cbb
Support to pass args to cnn bricks (#277) 2020-05-12 10:41:11 +08:00
Jerry Jiarui XU d5936d02e3
Make Config.dump() output in original file (#275)
* add dump() from for different file type

* remove exception
2020-05-11 21:48:56 +08:00
Kai Chen d4fac3a6dd
Use parrots wrapper (#272)
* use parrots wrapper for norms

* add unittests for is_norm()

* add a test case
2020-05-08 11:24:35 +08:00
Kai Chen 6aa5131559
move test_weight_init to tests/test_cnn (#270) 2020-05-05 21:03:12 +08:00
Wenwei Zhang 19e4a06cbc
Fix CosineAnealingLr register bug (#265)
* Fall back to CosineLr

* Fix consineanealing with unittest

* Cover momentum hook

* Add comments to explain
2020-05-04 00:38:55 +08:00
Xintao 65fbc75689
Add colorspace functions: rgb2ycbcr, bgr2ycbcr, ycbcr2rgb and ycbcr2bgr (#259)
* update

* add functions

* update tests

* resolve comments

* resolve comments

* resolve comments

* update docstr
2020-05-03 23:32:48 +08:00
Jerry Jiarui XU 1d54ee217e
remove deprecate register_module (#262) 2020-05-02 00:35:30 +08:00
Jerry Jiarui XU a5b5193767
Fixed config import in config file (#261)
* fixed config import in code

* fixed isort
2020-05-01 21:55:07 +08:00
Kai Chen 45111e193d
Add building bricks of cnn (#247)
* add building bricks of cnn

* add unit tests

* use registry for building bricks

* minor updates

* add scale layer

* add test for scale

* add doc string

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-05-01 00:32:25 +08:00
Jerry Jiarui XU 45a39dc6a8
make config merge a into b non-inplace (#254) 2020-04-29 15:09:27 +08:00
Kai Chen f7de63fdd0
Support specifying names for registry.register_module() (#251)
* support specifying names for registry.register_module()

* minor fix

* add more unittests
2020-04-27 22:47:49 +08:00
Kai Chen a338d43d78
Refactor unittests (#241)
* refactor unittests

* split test_video.py to two files
2020-04-26 22:54:27 +08:00
Cao Yuhang b7e8d7d7fb
Use f-string (#245)
* use f-string

* delete python3.5 sup

* minor fix

* fix supported python version

* fix format

* fix yapf

* remove redundant space

* fix typo
2020-04-26 00:21:54 +08:00
Jerry Jiarui XU 1e8a212187
Add DictAction and docs for config (#243)
* fixed merge_from_dict, add DictAction

* add config docs

* fixed format type

* change to easy example

* update docs

* update docs
2020-04-25 20:56:08 +08:00
Kai Chen e333d8222b
Add FileClient to access file from different backends (#237)
* add file client

* install missing requirements

* use .format() instead of f-string
2020-04-23 19:54:29 +08:00
Kai Chen a0618d1051
Refactoring mmcv.images (#239)
* refactoring mmcv.images

* update docstring and minor fix

* some renames
2020-04-23 00:34:51 +08:00
Kai Chen af02ac9f01
Use tmp dir as work_dir of runner (#236)
* use tmp dir as work_dir of runner

* only run codecov for python 3.7

* remove useless comments
2020-04-22 23:33:54 +08:00
Wenwei Zhang ba059611d1
Momentum scheduler (#167)
* track progress of iter&enum

* restore

* add momentum scheduler

* fix small bug

* cyclic scheduler"

* fix bug

* fix second phase's bug

* reformat

* feature (cosine lr): use relative ratio for more flexible scheduler

* Fix (runner): fix bugs in runner

* Refactor (hook): refactor cosing/cyclic LR/momentum hook with unittest

* Clean unnecessary files and reformat

* Fix memory key error when GPU is not avaliable

* Resolve comments

* Do not print momentum in text log

* Change hook register order

* Refactor max_iter

* Fix max_iter bugs in runner

* Enforce target_ratio to be either tuple or float
2020-04-20 01:23:53 +08:00
David de la Iglesia Castro d5f190d12d
Add MlflowLoggerHook (#221)
* Add MLflowLoggerHook

* Add MLflowLoggerHook to __all__

* Update name

* Fix tracking.MlflowClient setup

* Fix log_metric

* Fix mlflow_pytorch import

* Handle active_run

* Fix self.mlflow reference

* Simplify using high level API

* Fix set_experiment

* Add only_if_torch_available decorator and test_mlflow_hook

* Add missing import in hooks

* Fix torch available check

* Patch mlflow.pytorch in test

* Parametrize log_model

* Fix log_model parametrize

* Add docstring

* Move wand patch

* Fix flake8

* Add regression test for non numeric metric

* Only log numbers

* Rename experiment_name-> exp_name

* Remove pytest skip
2020-04-14 23:54:55 +08:00
Joanna 2ea0d51816
add contains to registry (#223)
* add contains to registry

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add contains to registry

* 'fix'

* 'minor'

* move

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

Co-authored-by: lixuanyi <lixuanyi@sensetime.com>
2020-04-06 12:49:13 +08:00
Jerry Jiarui XU e87a04e3c7
add pretty_text (#220)
* add pretty_text

* add test cases

* add argument indent

* change pretty_text to property

* fixed format end
2020-04-03 21:18:34 +08:00
Kai Chen cd873f9c2f
Fix a potential bug of removing temp dir (#218)
* fix a potential bug of removing temp dir

* bump version to v0.4.2
2020-03-28 22:00:19 +08:00
Xintao 1bc80610ee
support recursive scanndir (#215)
* recursive scanndir

* support python3.5

* update and add tests

* resolve comments

* remove is_str
2020-03-19 22:50:37 +08:00
Jerry Jiarui XU fa84b26422
add bias_init_with_prob (#213)
* add bia_init_with_prob

* add test_weight_init
2020-03-17 20:48:46 +08:00
Kai Chen 12e5913bb9
Remove supports for python 2.7 and bump version to 0.4.0 (#211)
* remove supports for python 2.7

* fix the unit test for python 3.5

* add python 3.8 in CI

* try ubuntu 18.04 as the environment
2020-03-16 15:15:35 +08:00
Jerry Jiarui XU 6738cd3085
add base for config (#194)
* add base for config

* fixed format

* rm terminal width

* support multiple & recursive base

* add test case

* fix format

* add test construct

* minor fix

* add more test, rewrite merge from opt

* avoid depulicate keys

* delete imported config as module

* rename merge_from_dict
2020-03-15 20:29:17 +08:00
Rui Xu 7dac84d08c
support pathlib in imageio (#208)
* support pathlib in imageio

* support pathlib in imageio

* add Path type for the annotation.

Co-authored-by: xurui4 <xurui4@sensetime.com>
2020-03-14 23:16:44 +08:00
lizz c294d2713b
Support dot in config.py file (#207)
Signed-off-by: lizz <lizz@sensetime.com>
2020-03-12 23:20:50 +08:00
Jiangmiao Pang fd066152d0
Update PaviLoggerHook (#202)
* add is_scalar in PaviLoggerHook and add unittest

* add docstrings
2020-03-02 18:48:51 +08:00
Kai Chen 3fa5851891
Update pre-commit hook config (#200)
* update pre-commit hook config

* update the contributing guide
2020-03-01 15:51:40 +08:00
Kai Chen c2c9fced2b
Add logging utils (#196)
* add logging utils

* install torch (cpu only) for CI

* fix unittests for runner

* remove python 2.7 from testing list

* add a corner case
2020-02-24 22:31:36 +08:00
Kai Chen 34197c5c89
Add registry and build_from_cfg (#195)
* add registry and build_from_cfg

* add some corner cases

* add some corner cases

* fix the unittest for python 3.5

* minor fix
2020-02-24 22:21:01 +08:00
Joanna 0bf1e80c6e
add fast imresize (#193)
* size hint

Signed-off-by: lizz <lizz@sensetime.com>

* add fast resize

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* Update tests/test_image.py

* change format

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add docstring

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

Co-authored-by: lizz <innerlee@users.noreply.github.com>
2020-02-24 21:50:33 +08:00
Joanna 9332a1dd29
add inplace normalization (#192)
* add inplace normalization

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add dtype check

* modify inplace norm

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix line
2020-02-19 22:49:15 +08:00
Joanna 5ee538d4ac
add inplace imflip (#191)
* add implace flip

* add tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* modify tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add inplace tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add comments

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
2020-02-19 16:02:48 +08:00
Joanna 4eca2c5964
Image decoding optimization (#187)
* change image decoding method from cv2 to TurboJPEG

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add tests

* travis

Signed-off-by: lizz <lizz@sensetime.com>

* fix

Signed-off-by: lizz <lizz@sensetime.com>

* more doc

Signed-off-by: lizz <lizz@sensetime.com>

* change per request

Signed-off-by: lizz <lizz@sensetime.com>

* more doc

Signed-off-by: lizz <lizz@sensetime.com>

* baby-sitting

Signed-off-by: lizz <lizz@sensetime.com>

Co-authored-by: lizz <innerlee@users.noreply.github.com>
2020-02-18 20:41:03 +08:00
lizz a0506ec560
Use cv2 to normalize img (#176)
* Use cv2 to normalize img

* multipy faster than divide

* also do imdenormalize

* support more channels

* even faster

Signed-off-by: lizz <lizz@sensetime.com>

* add test

Signed-off-by: lizz <lizz@sensetime.com>

* even even faster

Signed-off-by: lizz <lizz@sensetime.com>

* fffaster

Signed-off-by: lizz <lizz@sensetime.com>

* okay

Signed-off-by: lizz <lizz@sensetime.com>

* guard against implace modification

Signed-off-by: lizz <lizz@sensetime.com>

* fix imdenormalize

Signed-off-by: lizz <lizz@sensetime.com>

* tidy

Signed-off-by: lizz <lizz@sensetime.com>

* clean

Signed-off-by: lizz <lizz@sensetime.com>

* Update test_image.py

* Update test_image.py

* Update test_image.py

* Update test_image.py

* Update test_image.py

* Update test_image.py
2020-02-15 23:59:54 +08:00
lizz 712651aab6
Adaptive progress bar length (#174)
* Adaptive progress bar length

Signed-off-by: lizz <lizz@sensetime.com>

* it works

Signed-off-by: lizz <lizz@sensetime.com>

* format

* pass test

* :lipstick

* test

* Update test_progressbar.py

* 2.7

* sort import

Signed-off-by: lizz <lizz@sensetime.com>

* try this

Signed-off-by: lizz <lizz@sensetime.com>
2020-02-02 18:18:17 +08:00
Kai Chen 43ca0e57a9
fix the shape assertion in impad (#172) 2020-01-11 17:53:35 +08:00
Kai Chen 10fa1eeaf4
Add copyright header (#171)
* add copyright header

* change # to // for cpp files
2020-01-10 13:34:42 +08:00
Wenwei Zhang da7bb063d3 Load state dict (#164)
* use load_from_state_dict to load ckpt

* reformat

* reformat

* reformat import

* pass flake8

* isort skip
2020-01-04 14:55:01 +08:00
Kai Chen 0eef3757e8
fix the code style of yapf 0.29 (#150)
* fix the code style of yapf 0.29

* fix flake8
2019-12-02 13:14:33 +08:00
Vladimir Iglovikov 56971278db Added Weight and Biases logger. (#143)
* Added wandb logger

* bugfix

* fixes

* fix

* flake8 fixes

* yapf fixes

* Refactor hook, add test

* flake8 fixes

* yapf fixes

* fix in test

* mock package => travis
2019-12-02 12:32:50 +08:00
Kai Chen 8829ff0dfd
Add rgb2gray and gray2rgb (#139)
* add rgb2gray and gray2rgb

* update version

* minor fix for the docstring
2019-10-06 22:46:06 +08:00
Dhananjai Sharma d361ef21b0 Added solarize and posterize image transformations (#132)
* Added solarize and posterize image transformations

* Added solarize and posterize transformations. Modified __init__.py

* Updated mmcv/image/__init__.py

* Updated the docstrings for solarize and posterize

* add unit tests

* fix a test case
2019-10-06 22:12:17 +08:00
lizz 25b422ab6f Let progress goes to stderr (#115)
* let progress goes to stderr

Signed-off-by: lizz <lizz@sensetime.com>

* Add argument file=sys.stdout

Signed-off-by: lizz <lizz@sensetime.com>

* For the sake of the stupid pytest

Signed-off-by: lizz <lizz@sensetime.com>

* line width < 120 is anti-humane

Signed-off-by: lizz <lizz@sensetime.com>

* flake8

Signed-off-by: lizz <lizz@sensetime.com>

* Lets try

Signed-off-by: lizz <lizz@sensetime.com>
2019-08-21 19:31:58 +08:00
ZwwWayne d5865e0cbd Track iter progress (#112)
* track progress of iter&enum

* reformat

* reformat with yapf

* add unitest

* add doc, and deprecate track_enum_progress

* update docs & comments
2019-08-20 15:05:17 +08:00
Kai Chen eae81c1e86
Add yapf and isort to travis (#96)
* add yapf and isort to travis

* minor formatting

* remove blank lines

* skip unit tests for progressbar when python2

* update travis to ubuntu 16.04

* use a newer version ffmpeg

* add -y to add-apt-repository
2019-07-30 23:15:56 +08:00
Evgeny Nizhibitsky 395efbf2e9 Make latest checkpoint symlink relative (#75)
* Make latest symlink relative. Add tests

* Skip test_save_checkpoint in the absense of torch

* Fix pep8 in test_runner

* Import runner only if torch import has succeeded
2019-06-15 19:56:27 +08:00
nbei 9097957434 C++ implementation for Flow Warp Module (#71)
* flow_warp_c

* flow_warp_c

* beautify format

* beautify format

* beautify format

* beautify format

* add Cython

* modify

* fix details

* fix details

* fix type
2019-05-28 20:03:08 +08:00
Gu Wang d4b91b8376 test bgr2hls 2019-05-07 12:04:01 +08:00
Yue Zhao 944da49fcb add iminvert (#58)
* add iminvert

* fix for flake8

* minor improvement

* add test for iminvert

* fix for flake8

* fix for flake8

* revise __init__

* revise __init__
2019-04-20 00:27:59 -07:00
Kai Chen d426585999
Support str type for loggers (#39)
* fix the time estimation when resuming from a checkpoint

* fix the time estimation when resuming from a checkpoint

* support str type for loggers

* fix yaml dump tests
2019-03-25 21:59:02 -07:00
Kai Chen 47fc7a69ed fix unit test 2018-10-07 19:31:47 +08:00
Kai Chen b98980b77b add some unit tests 2018-10-07 17:45:41 +08:00
Kai Chen 852e980eac ignore a flake8 error 2018-10-04 20:36:29 +08:00
Kai Chen 6e8d925e45 add a class decorator to register file handlers 2018-10-04 19:48:59 +08:00
Kai Chen 51b73ac173 refactoring and remove some public apis 2018-10-04 17:15:14 +08:00
Kai Chen 34eca27216 add register_handler and refactor BaseFileHandler 2018-10-04 16:58:11 +08:00
Kai Chen ddef9a5606 fix flake8 errors 2018-10-01 22:13:52 +08:00
xiongyu 6249f829c6 add negative indexing support 2018-09-27 13:38:36 +08:00
xiongyu c75ff25940 add more tests for video_reader slice 2018-09-27 13:21:59 +08:00
xiongyu c16fab7eca minor change: value error to index error 2018-09-26 22:16:11 +08:00
xiongyu 2ab73c85ee add slice support and unit test 2018-09-26 22:00:30 +08:00
xiongyu 7bea02c0fa update video reader test code 2018-09-21 21:55:37 +08:00
Kai Chen 75ee2531a0 rename *Processor to *Handler and fix bug for python 2 2018-09-21 14:00:56 +08:00
Kai Chen 31e684fcfe bug fix: raise exceptions for missing config keys 2018-09-20 14:15:12 +08:00
Kai Chen 685e8f991b fix unit test for imflip 2018-09-02 21:31:07 +08:00
Kai Chen 1f76784717 add some methods 2018-09-02 21:20:02 +08:00
Kai Chen 978ecfda84 refactoring for optflow 2018-08-28 01:38:53 +08:00
Kai Chen 4adf7006b0 add config class 2018-08-27 20:25:52 +08:00
Kai Chen f872672f58 renaming and reorganizing for subpackage 2018-08-27 17:37:13 +08:00
Kai Chen eadd1e0f4f re-organize io module as a subpackage 2018-08-27 15:29:12 +08:00
Kai Chen 5f2e58c5f2 add optical flow module 2018-08-27 03:10:39 +08:00
Kai Chen 43ebfd9a62 move some unit tests 2018-08-27 02:38:05 +08:00
Kai Chen cbcb90dc21 port from cvbase and do some refactoring 2018-08-27 02:12:31 +08:00