prepare: add index module, update pipeline, tests, Dockerfile, and run.sh
This commit is contained in:
@ -195,6 +195,16 @@ def main():
|
||||
action="store_true",
|
||||
help="Mode debug : affiche les détails internes (fichier:ligne)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--rebuild-index",
|
||||
action="store_true",
|
||||
help="Régénérer uniquement la carte globale HTML des tuiles déjà traitées (sans retraiter)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-index",
|
||||
action="store_true",
|
||||
help="Ne pas générer la carte globale à la fin du traitement"
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@ -233,6 +243,16 @@ def main():
|
||||
log_gpu_status()
|
||||
|
||||
try:
|
||||
# Mode --rebuild-index : régénère uniquement la carte globale, sans retraiter
|
||||
if args.rebuild_index:
|
||||
from .index import build_index
|
||||
index_path = build_index(args.output, args.format)
|
||||
if index_path:
|
||||
logger.info(f"Carte globale générée : {index_path}")
|
||||
else:
|
||||
logger.warning("Aucune tuile traitée trouvée — carte globale non générée")
|
||||
return
|
||||
|
||||
quality = 100 if args.lossless else args.quality
|
||||
# Parse --only and --skip: accept comma-separated values
|
||||
only_viz = None
|
||||
@ -255,6 +275,7 @@ def main():
|
||||
skip_viz=skip_viz,
|
||||
output_format=args.format,
|
||||
gpu_ids=gpu_ids,
|
||||
no_index=args.no_index,
|
||||
)
|
||||
|
||||
# If --file is specified, process only matching files
|
||||
@ -308,6 +329,16 @@ def main():
|
||||
logger.info(" ✓ Fichiers temporaires supprimés")
|
||||
except Exception as e:
|
||||
logger.warning(f" Note: Impossible de supprimer les fichiers temporaires: {e}")
|
||||
|
||||
# Génère la carte globale après traitement --file
|
||||
if not args.no_index:
|
||||
try:
|
||||
from .index import build_index
|
||||
index_path = build_index(pipeline.output_dir, pipeline.output_format)
|
||||
if index_path:
|
||||
logger.info(f"Carte globale générée : {index_path}")
|
||||
except Exception as e:
|
||||
logger.warning(f"Index global non généré: {e}")
|
||||
else:
|
||||
pipeline.process_all()
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user