fix: resolve model weight paths against DATA_DIR (REQ-187)

- config.py: resolve_data_path (legacy abs + rel) + rel_data_path
- all file-opening reads wrapped: preview, autolabel, training, model
  download, live count, projects.get; training_start_point hack replaced
- new writes store paths relative to data/
- legacy stale rows (/home/asus/reTraining/...) resolve without migration
- requirements: REQ-187 added; REQ-188 (per-class max box) + REQ-186
  copy-line amendment drafted for the next task
This commit is contained in:
asus committed 2026-10-02 16:59:25 +07:00
1 parent 8f41c6c85a
commit dee58e4ae5
10 files changed
+93 -32

No files matched your search

+22 -6
View File
@@ -139,12 +139,21 @@ changes.
again. The preview and the batch job still use the same thresholds and per-class overrides.
- **REQ-186** — The auto-annotate parameters table has a **copy button** that puts every
selected class's effective settings on the clipboard as short text, one class per line:
`class <name> conf <v> iou <v> minbox <v> container <true|false>`. Effective means the
per-class override where one is set, otherwise the global slider value; `container` is
the class's current checkbox state. The button sits in the shared per-class table, so it
exists in both the per-batch auto-annotate modal and the mass (batches tab) modal, and
the copied text is a plain baseline for later tuning — no structure beyond the line
format. Copying needs no network round-trip and never changes any setting.
`class <name> conf <v> iou <v> minbox <v> maxbox <v> container <true|false>`. Effective
means the per-class override where one is set, otherwise the global slider value;
`container` is the class's current checkbox state. The button sits in the shared
per-class table, so it exists in both the per-batch auto-annotate modal and the mass
(batches tab) modal, and the copied text is a plain baseline for later tuning — no
structure beyond the line format. Copying needs no network round-trip and never changes
any setting. (Amended by REQ-188: `maxbox` added to the line.)
- **REQ-188** — Auto-annotation accepts a per-class **maximum box fraction**
(`max_box_frac`, default `1.0` = off) beside the existing minimum override of REQ-181:
a detection whose area exceeds that fraction of the frame is dropped for that class.
It applies everywhere the minimum box fraction applies today (preview, batch job,
review assist filter), surfaces as `MaxBox` in the params table, and is included in the
REQ-186 copy line. Size bounds are ordinary per-class tuning: the `container` flag
(REQ-184) stays purely the NMS containment carve-out and gains no size semantics.
## E. Review & correction
@@ -415,3 +424,10 @@ changes.
- **REQ-074** — The system writes nothing of its own into the user's video archive folder:
no outputs, moves, renames or deletions; only user-initiated uploads and folder creation
(REQ-178) append to it.
- **REQ-187** — Model weight paths stored in the database (`model_versions.weights_path`,
`model_versions.parent_model_path`, `projects.base_model_path`) are **relative to the
data directory** when the file lives inside it, and every read resolves them against
`DATA_DIR` first. Legacy absolute paths from an older install keep resolving (the data
folder has moved once already and everything in it must survive the next move), which
strengthens the never-hardcoded rule of REQ-072. Training, preview, the batch job, model
download and live counting all reach the same weights through this one resolution.