From 96a36e65e59b0fc7a3a109211e21f29637161a8f Mon Sep 17 00:00:00 2001 From: ZeYi Lin <944270057@qq.com> Date: Sat, 7 Sep 2024 02:03:22 +0800 Subject: [PATCH] feat: app add root_path --- app.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 06a5794f..b2ed4abf 100644 --- a/app.py +++ b/app.py @@ -284,6 +284,12 @@ def idphoto_inference( argparser.add_argument( "--host", type=str, default="127.0.0.1", help="The host of the server" ) + argparser.add_argument( + "--root_path", + type=str, + default=None, + help="The root path of the server, default is None (='/'), e.g. '/myapp'", + ) args = argparser.parse_args() @@ -631,4 +637,10 @@ def change_image_kb(image_kb_option): ], ) - demo.launch(server_name=args.host, server_port=args.port) + demo.launch( + server_name=args.host, + server_port=args.port, + show_api=False, + favicon_path=os.path.join(root_dir, "assets/hivision_logo.png"), + root_path=args.root_path, + )