Files
appRobotRender/run/run_pipeline.bat
2026-05-31 10:22:19 +02:00

78 lines
2.0 KiB
Batchfile

@echo off
setlocal EnableDelayedExpansion
REM 3_pipeline_multiview.bat
REM Multi-camera ArUco detection and pose estimation pipeline
REM Parametr e.g.
REM run_pipeline.bat ../data/simulation/Scene4
set IMAGES=%~1
set ROBOT_JSON=..\data\robot\robot.json
set BASE_OUT_DIR=C:\Users\kech\SynologyDrive\2026-AppServer-AppRobot\appRobotRendering\data\evaluations
set SCENE_NAME=%~nx1
set OUT_DIR=%BASE_OUT_DIR%\%SCENE_NAME%
echo.
echo [STEP 1] Detect ArUco markers from all cameras in the folder %IMAGES%
for %%F in ("%IMAGES%\*.png" "%IMAGES%\*.PNG" "%IMAGES%\*.jpg" "%IMAGES%\*.jpeg" "%IMAGES%\*.JPG" "%IMAGES%\*.JPEG") do (
REM Dateiname ohne Pfad und ohne .png
set "NAME=%%~nF"
echo Bearbeite: !NAME!
REM Split bei "_" → nehme 2. Teil (die ID)
for /f "tokens=2 delims=_" %%A in ("%%~nF") do (
set "CAMID=%%A"
REM Takes files and detected arucos output to render_c_aruco_detection.json
python3 ../pipeline/1_detect_aruco_observations.py ^
-i "%%F" ^
-npz "%IMAGES%\render_a.npz" ^
-outDir %OUT_DIR% ^
-robot %ROBOT_JSON% ^
-cameraId !CAMID!
)
)
echo.
echo [STEP 2] Estimate camera poses from detections
for %%F in ("%OUT_DIR%\*_aruco_detection.json") do (
echo Bearbeite: %%F
python3 ../pipeline/2_estimate_camera_from_observations.py ^
-i "%%F" ^
-robot %ROBOT_JSON% ^
-outDir %OUT_DIR%
)
echo.
echo [STEP 3] Triangulate marker positions from multi-view observations
REM Alle detection files sammeln
for %%F in ("%OUT_DIR%\*_aruco_detection.json") do (
set DET_ARGS=!DET_ARGS! -det "%%F"
)
REM Alle pose files sammeln
for %%F in ("%OUT_DIR%\*_camera_pose.json") do (
set POSE_ARGS=!POSE_ARGS! -pose "%%F"
)
REM Debug-Ausgabe
echo DET_ARGS: !DET_ARGS!
echo POSE_ARGS: !POSE_ARGS!
REM EINMAL Python aufrufen
python3 "..\pipeline\3_multiview_bundle_adjustment_v4.py" ^
-robot "%ROBOT_JSON%" ^
-lambdaWeight 100.0 ^
!DET_ARGS! ^
!POSE_ARGS!