Enhance HVideoTool's detection and restoration capabilities: introduced per-model overlay threshold settings and cross-model non-maximum suppression (NMS) to improve detection accuracy. Updated configuration management to support these features, and refined the UI for better user experience. Documentation in CLAUDE.md has been updated to reflect these changes.
This commit is contained in:
@@ -37,6 +37,14 @@ def apply(config: AppConfig) -> None:
|
||||
config.detector_models = [str(m) for m in data["detector_models"]]
|
||||
if "threshold" in data:
|
||||
config.default_threshold = float(data["threshold"])
|
||||
if isinstance(data.get("model_thresholds"), dict):
|
||||
config.model_thresholds = {
|
||||
str(k): float(v) for k, v in data["model_thresholds"].items()
|
||||
}
|
||||
if "cross_model_nms" in data:
|
||||
config.cross_model_nms = bool(data["cross_model_nms"])
|
||||
if "nms_iou" in data:
|
||||
config.nms_iou = float(data["nms_iou"])
|
||||
if data.get("restorer"):
|
||||
config.restorer = data["restorer"]
|
||||
for key in ("dm_dir", "dm_model", "dm_gpu"):
|
||||
@@ -53,6 +61,9 @@ def save(config: AppConfig) -> None:
|
||||
detector=config.detector,
|
||||
detector_models=list(config.detector_models),
|
||||
threshold=config.default_threshold,
|
||||
model_thresholds=dict(config.model_thresholds),
|
||||
cross_model_nms=config.cross_model_nms,
|
||||
nms_iou=config.nms_iou,
|
||||
restorer=config.restorer,
|
||||
dm_dir=config.dm_dir,
|
||||
dm_model=config.dm_model,
|
||||
|
||||
Reference in New Issue
Block a user