ci: cache detection/model

This commit is contained in:
Fam Zheng 2024-12-21 11:12:35 +00:00
parent 30526ade16
commit 023670a2ed
3 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ cache:
- opencv/src - opencv/src
- opencv/contrib - opencv/contrib
- emtest/target - emtest/target
- detection/model
test: test:
stage: test-and-build stage: test-and-build

View File

@ -245,4 +245,5 @@ def parse_args():
if __name__ == '__main__': if __name__ == '__main__':
args = parse_args() args = parse_args()
print("starting detection server on %s:%d" % (args.host, args.port))
app.run(host=args.host, port=args.port, debug=True) app.run(host=args.host, port=args.port, debug=True)

View File

@ -7,7 +7,9 @@ def get_model(name):
if os.path.exists(fn): if os.path.exists(fn):
return fn return fn
with open(fn + ".tmp", 'wb') as tf: with open(fn + ".tmp", 'wb') as tf:
print(f"Downloading {name}...")
tf.write(oss_get(name, "emblem-models")) tf.write(oss_get(name, "emblem-models"))
print(f"Downloaded {name}")
os.rename(fn + ".tmp", fn) os.rename(fn + ".tmp", fn)
return fn return fn