Update app.py
Browse files
app.py
CHANGED
@@ -95,8 +95,10 @@ def activate_id_live_sdk():
|
|
95 |
sys.stdout.flush()
|
96 |
id_live_key = os.environ.get("ID_LIVE_LICENSE_KEY")
|
97 |
print(id_live_key)
|
|
|
98 |
id_live_dict_path = os.path.join(root_path, "id_live/engine/model")
|
99 |
print(id_live_dict_path)
|
|
|
100 |
ret = -1
|
101 |
if id_live_key is None:
|
102 |
print_warning("ID LIVE license key not found!")
|
@@ -105,9 +107,11 @@ def activate_id_live_sdk():
|
|
105 |
ret = id_live_header.set_activation(id_live_key.encode('utf-8'))
|
106 |
|
107 |
print(f"activation result {ret}")
|
|
|
108 |
if ret == 0:
|
109 |
ret = id_live_header.init_sdk(id_live_dict_path.encode('utf-8'))
|
110 |
print(f"init result {ret}")
|
|
|
111 |
|
112 |
if ret == 0:
|
113 |
print_log("Successfully init ID LIVE SDK!")
|
@@ -473,7 +477,6 @@ def launch_demo():
|
|
473 |
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
474 |
|
475 |
if __name__ == '__main__':
|
476 |
-
logging.info("This is an info log")
|
477 |
g_id_ocr_activation_result = activate_id_ocr_sdk()
|
478 |
g_id_live_activation_result = activate_id_live_sdk()
|
479 |
launch_demo()
|
|
|
95 |
sys.stdout.flush()
|
96 |
id_live_key = os.environ.get("ID_LIVE_LICENSE_KEY")
|
97 |
print(id_live_key)
|
98 |
+
sys.stdout.flush()
|
99 |
id_live_dict_path = os.path.join(root_path, "id_live/engine/model")
|
100 |
print(id_live_dict_path)
|
101 |
+
sys.stdout.flush()
|
102 |
ret = -1
|
103 |
if id_live_key is None:
|
104 |
print_warning("ID LIVE license key not found!")
|
|
|
107 |
ret = id_live_header.set_activation(id_live_key.encode('utf-8'))
|
108 |
|
109 |
print(f"activation result {ret}")
|
110 |
+
sys.stdout.flush()
|
111 |
if ret == 0:
|
112 |
ret = id_live_header.init_sdk(id_live_dict_path.encode('utf-8'))
|
113 |
print(f"init result {ret}")
|
114 |
+
sys.stdout.flush()
|
115 |
|
116 |
if ret == 0:
|
117 |
print_log("Successfully init ID LIVE SDK!")
|
|
|
477 |
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
478 |
|
479 |
if __name__ == '__main__':
|
|
|
480 |
g_id_ocr_activation_result = activate_id_ocr_sdk()
|
481 |
g_id_live_activation_result = activate_id_live_sdk()
|
482 |
launch_demo()
|