Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import requests
|
|
| 8 |
import numpy as np
|
| 9 |
from gradio.components import Image
|
| 10 |
from PIL import Image, ExifTags
|
|
|
|
| 11 |
|
| 12 |
from id_ocr.engine.header import *
|
| 13 |
from id_live.engine.header import *
|
|
@@ -91,6 +92,7 @@ def activate_id_ocr_sdk():
|
|
| 91 |
|
| 92 |
def activate_id_live_sdk():
|
| 93 |
print("id live sdk activation start")
|
|
|
|
| 94 |
id_live_key = os.environ.get("ID_LIVE_LICENSE_KEY")
|
| 95 |
print(id_live_key)
|
| 96 |
id_live_dict_path = os.path.join(root_path, "id_live/engine/model")
|
|
@@ -471,6 +473,7 @@ def launch_demo():
|
|
| 471 |
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|
| 472 |
|
| 473 |
if __name__ == '__main__':
|
|
|
|
| 474 |
g_id_ocr_activation_result = activate_id_ocr_sdk()
|
| 475 |
g_id_live_activation_result = activate_id_live_sdk()
|
| 476 |
launch_demo()
|
|
|
|
| 8 |
import numpy as np
|
| 9 |
from gradio.components import Image
|
| 10 |
from PIL import Image, ExifTags
|
| 11 |
+
import logging
|
| 12 |
|
| 13 |
from id_ocr.engine.header import *
|
| 14 |
from id_live.engine.header import *
|
|
|
|
| 92 |
|
| 93 |
def activate_id_live_sdk():
|
| 94 |
print("id live sdk activation start")
|
| 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")
|
|
|
|
| 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()
|