Add deprecation message for deploy tool (#1321)

* Add deprecation message for deploy tool

* deploy test
This commit is contained in:
Miao Zheng 2022-02-25 11:22:03 +08:00 committed by EricWu
parent 54dea9ff70
commit f2ecbe64be
3 changed files with 38 additions and 0 deletions

View File

@ -324,3 +324,15 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()
# Following strings of text style are from colorama package
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
red_text, blue_text = '\x1b[31m', '\x1b[34m'
white_background = '\x1b[107m'
msg = white_background + bright_style + red_text
msg += 'DeprecationWarning: This tool will be deprecated in future. '
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
msg += reset_style
warnings.warn(msg)

View File

@ -2,6 +2,7 @@
import argparse import argparse
import os import os
import os.path as osp import os.path as osp
import warnings
from typing import Iterable, Optional, Union from typing import Iterable, Optional, Union
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@ -274,3 +275,15 @@ if __name__ == '__main__':
dataset=args.dataset, dataset=args.dataset,
workspace_size=args.workspace_size, workspace_size=args.workspace_size,
verbose=args.verbose) verbose=args.verbose)
# Following strings of text style are from colorama package
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
red_text, blue_text = '\x1b[31m', '\x1b[34m'
white_background = '\x1b[107m'
msg = white_background + bright_style + red_text
msg += 'DeprecationWarning: This tool will be deprecated in future. '
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
msg += reset_style
warnings.warn(msg)

View File

@ -1,5 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import argparse import argparse
import warnings
from functools import partial from functools import partial
import mmcv import mmcv
@ -390,3 +391,15 @@ if __name__ == '__main__':
output_file=args.output_file, output_file=args.output_file,
verify=args.verify, verify=args.verify,
dynamic_export=args.dynamic_export) dynamic_export=args.dynamic_export)
# Following strings of text style are from colorama package
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
red_text, blue_text = '\x1b[31m', '\x1b[34m'
white_background = '\x1b[107m'
msg = white_background + bright_style + red_text
msg += 'DeprecationWarning: This tool will be deprecated in future. '
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
msg += reset_style
warnings.warn(msg)