Refactor HVideoTool to support project-based workflow: introduced project management features, updated UI for project handling, and enhanced documentation in README and CLAUDE.md. The tool now organizes images and settings into projects, improving usability and detection caching.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"""Command-line entry point: ``python -m hvideotool``.
|
||||
|
||||
Runs with no arguments — open a folder of images in-app. CLI flags are optional
|
||||
overrides; choices persist to ~/HVideoTool/settings.json.
|
||||
Runs with no arguments — reopens the last project (if any). An optional path opens
|
||||
that project. CLI flags are optional overrides for the new-project defaults; they
|
||||
persist to ~/HVideoTool/settings.json.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -19,20 +20,20 @@ def main() -> int:
|
||||
prog="hvideotool",
|
||||
description="Инспектор детекции уже наложенной цензуры на картинках.",
|
||||
)
|
||||
parser.add_argument("folder", nargs="?", help="папка с картинками для немедленного открытия")
|
||||
parser.add_argument("target", nargs="?", help="путь к проекту для открытия (папка или project.json)")
|
||||
parser.add_argument("--detector", choices=["classic", "yolo", "combined"], default=None)
|
||||
parser.add_argument("--model", dest="model_path", default=None, help="путь к весам (YOLO)")
|
||||
args = parser.parse_args()
|
||||
|
||||
config = AppConfig()
|
||||
settings_store.apply(config) # persisted choices first
|
||||
settings_store.apply(config) # persisted defaults first
|
||||
|
||||
if args.detector:
|
||||
config.detector = args.detector
|
||||
if args.model_path:
|
||||
config.model_path = args.model_path
|
||||
|
||||
return run(config, folder=args.folder)
|
||||
return run(config, target=args.target)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user