Commit Graph

26 Commits (5b5b47fc87feb5cbd80197fd8d2c81da7a44de1a)

Author SHA1 Message Date
Zaida Zhou 5b5b47fc87
[Feature] Loading objects from different backends and dumping objects to different backends (#1330)
* [Feature] Choose storage backend by the prefix of filepath

* refactor FileClient and add unittest

* support loading from different backends

* polish docstring

* fix unittet

* rename attribute str_like_obj to is_str_like_obj

* add infer_client method

* add check_exist method

* rename var client to file_client

* polish docstring

* add join_paths method

* remove join_paths and add _format_path

* enhance unittest

* refactor unittest

* singleton pattern

* fix test_clientio.py

* deprecate CephBackend

* enhance docstring

* refactor unittest for petrel

* refactor unittest for disk backend

* update io.md

* add concat_paths method

* improve docstring

* improve docstring

* add isdir and copyfile for file backend

* delete copyfile and add get_local_path

* remove isdir method of petrel

* fix typo

* add comment and polish docstring

* polish docstring

* rename _path_mapping to _map_path

* polish docstring and fix typo

* refactor get_local_path

* add list_dir_or_file for FileClient

* add list_dir_or_file for PetrelBackend

* fix windows ci

* Add return docstring

* polish docstring

* fix typo

* fix typo

* deprecate the conversion from Path to str

* add docs for loading checkpoints with FileClient

* refactor map_path

* add _ensure_methods to ensure methods have been implemented

* fix list_dir_or_file

* rename _ensure_method_implemented to has_method
2021-10-23 20:51:44 +08:00
Ezra-Yu e8489a7b4b
Add case case_sensitive in scandir (#1389)
* add case_insensitive

* rename v

* case_insensitive to case_sensitive

* Update docstring
2021-10-20 14:34:34 +08:00
Shilong Zhang fa22d9db4e
Fix potiential bug in `deprecated_api_warning` (#1395)
* assert both dep and new args exist at same time

* add unintest

* Update tests/test_utils/test_misc.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update tests/test_utils/test_misc.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* polish warning

* polish warning

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-10-13 20:53:11 +08:00
Wenwei Zhang 979a355d2a
[Feature] Add windows CI (#1023)
* add windows CI

* clean versions

* only allow pt1.7 on windows

* fix windows install issue

* add win cpu

* fix win command

* clean unnecessary command

* resolve turbojpeg & tempfile on win

* replace os.readlink with os.path.realpath

* fix windows ci

* close file before removing it

* fix windows ci

* fix symlink on windows

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* modify according to comment

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-08-24 10:07:31 +08:00
Yining Li 4d9b43debd
Support deprecation info in Config (#1275)
* Support deprecation checking in Config

* add unittest for config deprecation

* support reference link in deprecation info

* add doc

* Update config.md
2021-08-23 10:36:37 +08:00
Jerry Jiarui XU c47c9196d0
[Docs] Add header for files (#1181)
* [Docs] Add header for files

* change to OpenMMLab

* add headers for .cpp, .cu, .h, .cuh

* replace Open-MMLab with OpenMMLab
2021-08-08 22:10:55 +08:00
Haodong Duan ef48a47389
[Improvement] Improve digit_version & use it for version_checking (#1185)
* improve digit_version & use it for version_checking

* more testing for digit_version

* setuptools >= 50 is needed

* fix CI

* add debuging log

* >= to ==

* fix lint

* remove

* add failure case

* replace

* fix

* consider TORCH_VERSION == 'parrots'

* add unittest

* digit_version do not deal with the case if 'parrots' in version name.
2021-07-23 21:03:33 +08:00
Ma Zerun 6659c38dd5
[Feature] Add `is_tracing` to wrap `torch.jit.is_tracing` in different versions. (#1187)
* Add `is_tracing` to wrap `torch.jit.is_tracing` in different versions.

* Remame `is_tracing` to `is_jit_tracing`

* Ignore `is_jit_tracing` tests in CI.
2021-07-13 14:42:50 +08:00
achaiah 21845db455
[Fix]: fix missing check of directory in scandir (#1110)
* Missing check for dir in the 'else' clause

Fixing issue when recursively scanning directories with filenames starting with '.'  Without this fix, the `if not entry.name.startswith('.') and entry.is_file()` logic falls through to the `else` clause which in the current code base will error out as it encounters '.' files (e.g. .DS_Store)

* Updated code per comments

* fixing indentation

* fix indenterror and add comment

* remove .DS_Store and add .file

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-06-29 21:31:00 +08:00
Ma Zerun 1b15f02220
support print hooks before running. (#1123)
* support print using hooks before running.

* Support to print hook trigger stages.

* Print stage-wise hook infos. And make `stages` as class attribute of
`Hook`

* Add util function `is_method_overriden` and use it in
`Hook.get_trigger_stages`.

* Add unit tests.

* Move `is_method_overriden` to `mmcv/utils/misc.py`

* Improve hook info text.

* Add base_class argument type assertion, and fix some typos.

* Remove `get_trigger_stages` to `get_triggered_stages`

* Use f-string.
2021-06-25 20:49:24 +08:00
lizz d9effbd1d0
Support variables in base files for configs (#1083)
* Support variables in base files for configs

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

* Test json and yaml as well

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

* Add test for recusive base

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

* Test misleading values

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

* Improve comments

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

* Add doc

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

* Improve doc

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

* More tests

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

* Harder test case

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

* use BASE_KEY instead of base

Signed-off-by: lizz <lizz@sensetime.com>
2021-06-25 14:30:58 +08:00
Junjun2016 f7caa80f9c
[Enhancement] Add to_ntuple (#1125)
* add to_ntuple

* add unit test
2021-06-23 10:19:28 +08:00
lizz f61295d944
Add test util for checking stand-alone python scripts (#1007)
* Add test util for checking stand-alone scripts

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

* Restrict to python scripts

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

* fix

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

* tiny

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

* Allow no capture

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

* Simplify interface

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

* Technical notes

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

* tiny

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

* Update hello.py

* Update test_testing.py

* Update test_testing.py
2021-05-10 22:15:35 +08:00
Rui Xu 0be0410443
[Bug] fix raise error bug in registering multiple names (#949)
* fix raise error bug in registering multiple names

* fix bug in checking the type of name

* fix lint

* fix unit test for registry

* fix bug in unit test
2021-04-25 21:47:50 +08:00
Jerry Jiarui XU 375605fba8
add model registry (#760)
* add model registry

* fixed infer scoep

* fixed build func

* add docstring

* add md

* support multi level

* clean comments

* add docs

* fixed parent

* add more doc

* add value error, add docstring

* fixed docs

* change to local/global search

* resolve comments

* fixed test

* update some docstring

* update docs (minior)

* update docs

* update docs
2021-04-10 21:33:34 +08:00
Haian Huang(深度眸) 58a8483352
Fix the iter error when the number of GPUs is different during resume (#844)
* Fix the iter error when the number of GPUs is different during resume

* Add fromstring and unit test

* Remove is_pretty_text

* Fix comment

* Add log info

* Add py format check

* Remove SyntaxError check
2021-02-25 16:40:06 +08:00
Wang Xinjiang 3d229dbaf2
Add more error info in build_from_cfg (#834)
* Add more Error info in building from config

* Add more Error info in building from config

* change error info
2021-02-18 13:07:42 +08:00
congee 905c9b43b8
Add common testing function of MM repos (#743)
* add testing function

add unittest for check_dict

add unittest for the function in testing

* polish docstring of testing.py

rename some function

* remove  in is_all_zeros

* modify the comment of check_dict

* modify the testing.py according to feedback

* add test about numpy for function dict_contains_subset

* applying unified style
2021-01-08 13:18:08 +08:00
Rui Xu 276883f120
[Feature] Allow register multi-name for a module simultaneously (#775)
* allow register multi-name for a module simultaneously

* add assertion for name type

* use isintance intead of is_str

* fix bug in unit test

* fix unit test
2021-01-07 22:27:20 +08:00
Kai Chen c1acedcc3b
Remove pytest from the runtime dependencies (#763)
* update the CI to avoid extra dependencies

* remove the dependency of pytest

* fix typo

* remove skip_no_parrots from __init__
2020-12-28 13:23:48 +08:00
Wang Xinjiang 96ebfa652b
Allow to replace nested tuple and list via options (#731)
* Allow to replace nested tuple and list via options

* Add comments

* Fix single nested items

* Simplify the code

* Simplify the code

* Simplify the code

* Simplify the code

* Update docstring

* Update docstring

* Support quotation mark

* modify docstring
2020-12-20 21:28:48 +08:00
lml131 9befc39811
Lml/jit decorator (#673)
* add jit decorator

* add parrots_jit.py

* modify test_parrots_jit.py

* modify for lint

* fix isort

* skip test_parrots_jit.py when build without pytorch

* try ci

* rm log

* fix double quote

* modify for comments and use partial_shape instead of full_shape

* fix for lint

* small modify for parrots 0.9.0rc0

* def skip no elena directly
2020-12-15 18:20:37 +08:00
Wang Xinjiang c9f96855b0
Allow list index keys in Config.merge_from_dict (#696)
* Allow list keys in Config merge from dict

* Reformat

* Set allow_list_keys default as True in merge_from_dict

* Fix docstring

* fix a small typo
2020-12-08 17:17:27 +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
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
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