[Enhance] Add deprecation message for deploy tools. (#697)

* add derepcation message for deploy tools

* add space

* Update tools/deployment/onnx2tensorrt.py

Co-authored-by: Ma Zerun <mzr1996@163.com>

* remove colorama package

* use plaintext to avoid import mmcv

Co-authored-by: Ma Zerun <mzr1996@163.com>
pull/713/head
RunningLeon 2022-02-23 22:24:44 +08:00 committed by GitHub
parent 7fcaedcbfb
commit 9ee41577d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import argparse
import os
import os.path as osp
import warnings
import numpy as np
@ -140,3 +141,15 @@ if __name__ == '__main__':
fp16_mode=args.fp16,
verify=args.verify,
workspace_size=args.workspace_size)
# 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.
import argparse
import warnings
from functools import partial
import mmcv
@ -231,3 +232,15 @@ if __name__ == '__main__':
output_file=args.output_file,
do_simplify=args.simplify,
verify=args.verify)
# 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

@ -114,3 +114,15 @@ def main():
if __name__ == '__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)