refactor: move weights to models/ + per-mode README; update paths, deploy, docs
ci / smoke (push) Canceled after 0s
ci / smoke (push) Canceled after 0s
This commit is contained in:
1 parent
6e4af50646
commit
262f7d064e
10 files changed
+157
-55
No files matched your search
+24
-2
@@ -1,13 +1,25 @@
|
||||
import paramiko
|
||||
import os
|
||||
|
||||
# Production loads .engine weights from models/ (see models/README.md).
|
||||
# .pt/.onnx stay local-only (dev/export) — not synced to save bandwidth.
|
||||
MODEL_ENGINES = [
|
||||
"v4-best.engine",
|
||||
"yolo11n-bbox-100ep-sack+box-20260909-best.engine",
|
||||
"best.engine",
|
||||
"truck-detector.engine",
|
||||
"model_karung_truk.engine",
|
||||
]
|
||||
|
||||
files_to_sync = [
|
||||
("templates/operator.html", "/home/jetson/karung/templates/operator.html"),
|
||||
("templates/monitoring.html", "/home/jetson/karung/templates/monitoring.html"),
|
||||
("templates/base.html", "/home/jetson/karung/templates/base.html"),
|
||||
("counter_dashboard.py", "/home/jetson/karung/counter_dashboard.py"),
|
||||
("predict.py", "/home/jetson/karung/predict.py"),
|
||||
(".env", "/home/jetson/karung/.env")
|
||||
(".env", "/home/jetson/karung/.env"),
|
||||
] + [
|
||||
(f"models/{f}", f"/home/jetson/karung/models/{f}") for f in MODEL_ENGINES
|
||||
]
|
||||
|
||||
def run():
|
||||
@@ -16,9 +28,19 @@ def run():
|
||||
client.connect('192.168.192.96', username='jetson', password='jetson', timeout=10)
|
||||
|
||||
sftp = client.open_sftp()
|
||||
|
||||
|
||||
# Ensure remote models/ dir exists (sftp.put fails otherwise)
|
||||
try:
|
||||
sftp.stat("/home/jetson/karung/models")
|
||||
except FileNotFoundError:
|
||||
print("Creating remote /home/jetson/karung/models/ ...")
|
||||
sftp.mkdir("/home/jetson/karung/models")
|
||||
|
||||
print("Uploading updated files to Jetson...")
|
||||
for local_f, remote_f in files_to_sync:
|
||||
if not os.path.exists(local_f):
|
||||
print(f"SKIP (missing local file): {local_f}")
|
||||
continue
|
||||
print(f"Uploading {local_f} -> {remote_f}")
|
||||
sftp.put(local_f, remote_f)
|
||||
|
||||
|
||||
Reference in new issue
Block a user