mirror of https://github.com/open-mmlab/mmcv.git
Replace `re` with `regex` (#457)
* replace `re` with `regex` * add regex in requirements * use regex on windows and re on linux * update requirements.txtpull/459/head
parent
66864d4abc
commit
9de04d2284
|
@ -1,8 +1,13 @@
|
|||
import inspect
|
||||
import re
|
||||
import platform
|
||||
|
||||
from .registry import PLUGIN_LAYERS
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
import regex as re
|
||||
else:
|
||||
import re
|
||||
|
||||
|
||||
def infer_abbr(class_type):
|
||||
"""Infer abbreviation from the class name.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import ast
|
||||
import os.path as osp
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -15,6 +14,11 @@ from yapf.yapflib.yapf_api import FormatCode
|
|||
|
||||
from .path import check_file_exist
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
import regex as re
|
||||
else:
|
||||
import re
|
||||
|
||||
BASE_KEY = '_base_'
|
||||
DELETE_KEY = '_delete_'
|
||||
RESERVED_KEYS = ['filename', 'text', 'pretty_text']
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
addict
|
||||
numpy
|
||||
pyyaml
|
||||
regex;sys_platform=='win32'
|
||||
yapf
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import logging
|
||||
import re
|
||||
import platform
|
||||
import tempfile
|
||||
from unittest.mock import patch
|
||||
|
||||
|
@ -7,6 +7,11 @@ import pytest
|
|||
|
||||
from mmcv import get_logger, print_log
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
import regex as re
|
||||
else:
|
||||
import re
|
||||
|
||||
|
||||
@patch('torch.distributed.get_rank', lambda: 0)
|
||||
@patch('torch.distributed.is_initialized', lambda: True)
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
import os
|
||||
import re
|
||||
import platform
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
import torch.nn as nn
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
import regex as re
|
||||
else:
|
||||
import re
|
||||
|
||||
|
||||
class TestSyncBN(object):
|
||||
|
||||
|
|
Loading…
Reference in New Issue