Unverified Commit 7f9b186e authored by xiliu8006's avatar xiliu8006 Committed by GitHub
Browse files

[Enhance]Unittest reconstruction (#303)

* Adjust the directory structure of tests

* Adopted the new directory via _get_config_directory

* Adopted the new directory via _get_config_directory

* Adopted the new directory via _get_config_directory

* modified the wrong code comments
parent 1b39a483
...@@ -20,12 +20,12 @@ def _setup_seed(seed): ...@@ -20,12 +20,12 @@ def _setup_seed(seed):
def _get_config_directory(): def _get_config_directory():
"""Find the predefined detector config directory.""" """Find the predefined detector config directory."""
try: try:
# Assume we are running in the source mmdetection repo # Assume we are running in the source mmdetection3d repo
repo_dpath = dirname(dirname(__file__)) repo_dpath = dirname(dirname(dirname(__file__)))
except NameError: except NameError:
# For IPython development when this __file__ is not defined # For IPython development when this __file__ is not defined
import mmdet import mmdet3d
repo_dpath = dirname(dirname(mmdet.__file__)) repo_dpath = dirname(dirname(mmdet3d.__file__))
config_dpath = join(repo_dpath, 'configs') config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath): if not exists(config_dpath):
raise Exception('Cannot find config path') raise Exception('Cannot find config path')
......
...@@ -13,12 +13,12 @@ from os.path import dirname, exists, join ...@@ -13,12 +13,12 @@ from os.path import dirname, exists, join
def _get_config_directory(): def _get_config_directory():
"""Find the predefined detector config directory.""" """Find the predefined detector config directory."""
try: try:
# Assume we are running in the source mmdetection repo # Assume we are running in the source mmdetection3d repo
repo_dpath = dirname(dirname(__file__)) repo_dpath = dirname(dirname(dirname(__file__)))
except NameError: except NameError:
# For IPython development when this __file__ is not defined # For IPython development when this __file__ is not defined
import mmdet import mmdet3d
repo_dpath = dirname(dirname(mmdet.__file__)) repo_dpath = dirname(dirname(mmdet3d.__file__))
config_dpath = join(repo_dpath, 'configs') config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath): if not exists(config_dpath):
raise Exception('Cannot find config path') raise Exception('Cannot find config path')
......
...@@ -22,12 +22,12 @@ def _setup_seed(seed): ...@@ -22,12 +22,12 @@ def _setup_seed(seed):
def _get_config_directory(): def _get_config_directory():
"""Find the predefined detector config directory.""" """Find the predefined detector config directory."""
try: try:
# Assume we are running in the source mmdetection repo # Assume we are running in the source mmdetection3d repo
repo_dpath = dirname(dirname(__file__)) repo_dpath = dirname(dirname(dirname(dirname(__file__))))
except NameError: except NameError:
# For IPython development when this __file__ is not defined # For IPython development when this __file__ is not defined
import mmdet import mmdet3d
repo_dpath = dirname(dirname(mmdet.__file__)) repo_dpath = dirname(dirname(mmdet3d.__file__))
config_dpath = join(repo_dpath, 'configs') config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath): if not exists(config_dpath):
raise Exception('Cannot find config path') raise Exception('Cannot find config path')
......
...@@ -11,12 +11,12 @@ from mmdet3d.models import build_detector ...@@ -11,12 +11,12 @@ from mmdet3d.models import build_detector
def _get_config_directory(): def _get_config_directory():
"""Find the predefined detector config directory.""" """Find the predefined detector config directory."""
try: try:
# Assume we are running in the source mmdetection repo # Assume we are running in the source mmdetection3d repo
repo_dpath = dirname(dirname(__file__)) repo_dpath = dirname(dirname(dirname(__file__)))
except NameError: except NameError:
# For IPython development when this __file__ is not defined # For IPython development when this __file__ is not defined
import mmdet import mmdet3d
repo_dpath = dirname(dirname(mmdet.__file__)) repo_dpath = dirname(dirname(mmdet3d.__file__))
config_dpath = join(repo_dpath, 'configs') config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath): if not exists(config_dpath):
raise Exception('Cannot find config path') raise Exception('Cannot find config path')
......
...@@ -4,12 +4,12 @@ from os.path import dirname, exists, join, relpath ...@@ -4,12 +4,12 @@ from os.path import dirname, exists, join, relpath
def _get_config_directory(): def _get_config_directory():
"""Find the predefined detector config directory.""" """Find the predefined detector config directory."""
try: try:
# Assume we are running in the source mmdetection repo # Assume we are running in the source mmdetection3d repo
repo_dpath = dirname(dirname(__file__)) repo_dpath = dirname(dirname(dirname(__file__)))
except NameError: except NameError:
# For IPython development when this __file__ is not defined # For IPython development when this __file__ is not defined
import mmdet import mmdet3d
repo_dpath = dirname(dirname(mmdet.__file__)) repo_dpath = dirname(dirname(mmdet3d.__file__))
config_dpath = join(repo_dpath, 'configs') config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath): if not exists(config_dpath):
raise Exception('Cannot find config path') raise Exception('Cannot find config path')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment