Forum

Author Topic: Run in background via python api  (Read 2151 times)

mixa

  • Newbie
  • *
  • Posts: 6
    • View Profile
Run in background via python api
« on: October 23, 2024, 09:04:44 AM »
Hi,
I want to send processing in jobs queue with python script, but don't understand how.

Code: [Select]
def align_cameras():
    chunk = Metashape.app.document.chunk

    KEYPOINTS = 20000
    TIEPOINTS = 2000
    chunk.matchPhotos(
        reference_preselection_mode=Metashape.ReferencePreselectionSource,
        filter_mask=False,
        mask_tiepoints=True,
        filter_stationary_points=True,
        keypoint_limit=KEYPOINTS,
        keypoint_limit_3d=100000,
        keypoint_limit_per_mpx=1000,
        tiepoint_limit=TIEPOINTS,
        keep_keypoints=False,
    )
    chunk.alignCameras(
        min_image=3,
        adaptive_fitting=False,
        reset_alignment=True,
        subdivide_task=True,
    )