Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix some known bugs. #1200

Merged
merged 3 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions mmedit/utils/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

import click
import mmcv
import mmengine
import requests
import torch.distributed as dist
from mmengine.dist import get_dist_info
Expand Down Expand Up @@ -67,7 +67,7 @@ def download_from_url(url,
if rank == 0:
# mkdir
_dir = os.path.dirname(dest_path)
mmcv.mkdir_or_exist(_dir)
mmengine.mkdir_or_exist(_dir)

if hash_prefix is not None:
sha256 = hashlib.sha256()
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