Skip to content

Commit c0442f1

Browse files
authored
Add deprecation message for deploy tool (open-mmlab#1321)
* Add deprecation message for deploy tool * deploy test
1 parent e5cd755 commit c0442f1

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

tools/deploy_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,15 @@ def main():
324324

325325
if __name__ == '__main__':
326326
main()
327+
328+
# Following strings of text style are from colorama package
329+
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
330+
red_text, blue_text = '\x1b[31m', '\x1b[34m'
331+
white_background = '\x1b[107m'
332+
333+
msg = white_background + bright_style + red_text
334+
msg += 'DeprecationWarning: This tool will be deprecated in future. '
335+
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
336+
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
337+
msg += reset_style
338+
warnings.warn(msg)

tools/onnx2tensorrt.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import argparse
33
import os
44
import os.path as osp
5+
import warnings
56
from typing import Iterable, Optional, Union
67

78
import matplotlib.pyplot as plt
@@ -274,3 +275,15 @@ def parse_args():
274275
dataset=args.dataset,
275276
workspace_size=args.workspace_size,
276277
verbose=args.verbose)
278+
279+
# Following strings of text style are from colorama package
280+
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
281+
red_text, blue_text = '\x1b[31m', '\x1b[34m'
282+
white_background = '\x1b[107m'
283+
284+
msg = white_background + bright_style + red_text
285+
msg += 'DeprecationWarning: This tool will be deprecated in future. '
286+
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
287+
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
288+
msg += reset_style
289+
warnings.warn(msg)

tools/pytorch2onnx.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
import argparse
3+
import warnings
34
from functools import partial
45

56
import mmcv
@@ -390,3 +391,15 @@ def parse_args():
390391
output_file=args.output_file,
391392
verify=args.verify,
392393
dynamic_export=args.dynamic_export)
394+
395+
# Following strings of text style are from colorama package
396+
bright_style, reset_style = '\x1b[1m', '\x1b[0m'
397+
red_text, blue_text = '\x1b[31m', '\x1b[34m'
398+
white_background = '\x1b[107m'
399+
400+
msg = white_background + bright_style + red_text
401+
msg += 'DeprecationWarning: This tool will be deprecated in future. '
402+
msg += blue_text + 'Welcome to use the unified model deployment toolbox '
403+
msg += 'MMDeploy: https://github.com/open-mmlab/mmdeploy'
404+
msg += reset_style
405+
warnings.warn(msg)

0 commit comments

Comments
 (0)