Skip to content

Commit

Permalink
[Fix] Fix some known bugs. (#1200)
Browse files Browse the repository at this point in the history
* fix bug in ceph config generation

* fix download error in io_utils

* trigger CI
  • Loading branch information
LeoXing1996 committed Oct 10, 2022
1 parent 5a080ff commit 0fdd4a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions .dev_scripts/create_ceph_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def convert_data_config(data_cfg):
dataset: dict = data_cfg['dataset']

dataset_type: str = dataset['type']
if 'mmcls' in dataset_type:
if dataset_type in ['ImageNet', 'CIFAR10']:
repo_name = 'classification'
else:
repo_name = 'editing'
Expand Down Expand Up @@ -112,8 +112,6 @@ def convert_data_config(data_cfg):
bg_dir_path = bg_dir_path.replace(dataroot_prefix,
ceph_dataroot_prefix)
bg_dir_path = bg_dir_path.replace(repo_name, 'detection')
bg_dir_path = bg_dir_path.replace('openmmlab:',
'sproject:')
pipeline['bg_dir'] = bg_dir_path
elif type_ == 'CompositeFg':
fg_dir_path = pipeline['fg_dirs']
Expand Down Expand Up @@ -188,9 +186,10 @@ def update_ceph_config(filename, args, dry_run=False):

# 2. change visualizer
if hasattr(config, 'vis_backends'):
for vis_cfg in config['vis_backends']:
if vis_cfg['type'] == 'GenVisBackend':
vis_cfg['ceph_path'] = work_dir
# TODO: support upload to ceph
# for vis_cfg in config['vis_backends']:
# if vis_cfg['type'] == 'GenVisBackend':
# vis_cfg['ceph_path'] = work_dir

# add pavi config
if args.add_pavi:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils/test_io_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved.

from mmedit.utils import download_from_url
from mmedit.utils.io_utils import download_from_url


def test_download_from_url():
Expand Down

0 comments on commit 0fdd4a8

Please sign in to comment.