From 023670a2edd415ada47ee560dce5c9ac6afa856a Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Sat, 21 Dec 2024 11:12:35 +0000 Subject: [PATCH] ci: cache detection/model --- .gitlab-ci.yml | 1 + detection/app.py | 1 + detection/utils.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4cd1c9..3df1378 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ cache: - opencv/src - opencv/contrib - emtest/target + - detection/model test: stage: test-and-build diff --git a/detection/app.py b/detection/app.py index 71e243c..5bcc5c2 100755 --- a/detection/app.py +++ b/detection/app.py @@ -245,4 +245,5 @@ def parse_args(): if __name__ == '__main__': args = parse_args() + print("starting detection server on %s:%d" % (args.host, args.port)) app.run(host=args.host, port=args.port, debug=True) diff --git a/detection/utils.py b/detection/utils.py index 1292e40..12ae3e8 100644 --- a/detection/utils.py +++ b/detection/utils.py @@ -7,7 +7,9 @@ def get_model(name): if os.path.exists(fn): return fn with open(fn + ".tmp", 'wb') as tf: + print(f"Downloading {name}...") tf.write(oss_get(name, "emblem-models")) + print(f"Downloaded {name}") os.rename(fn + ".tmp", fn) return fn