1
Python and Java API / pairs in Metashape.Tasks.MatchPhotos doesn't work
« on: December 04, 2024, 06:44:16 PM »
Hi
I am trying to use custom pairs for imagr matching, and use the latest 2.1.3 version.
It works if simply run script with the following code,
However, when I try to utilize network processing, it only works if pairs is not assigned.
Paris are as same as locol processing.
I do monitor the processing output, and found that only keypoints of first photo are detected.
can you help to debug it ?
2024-12-04 23:34:04 Using device: NVIDIA GeForce RTX 4070 Ti SUPER, 66 compute units, free memory: 15079/16375 MB, compute capability 8.9
2024-12-04 23:34:04 driver/runtime CUDA: 12050/10010
2024-12-04 23:34:04 max work group size 1024
2024-12-04 23:34:04 max work item sizes [1024, 1024, 64]
2024-12-04 23:34:04 [GPU] photo 0: 3000 points
2024-12-04 23:34:04 points detected in 0.532 sec
2024-12-04 23:34:04 processing finished in 0.682 sec
I am trying to use custom pairs for imagr matching, and use the latest 2.1.3 version.
It works if simply run script with the following code,
Code: [Select]
doc = Metashape.app.document
chunk = doc.chunk
cameras = [camera for camera in chunk.cameras if camera.reference.location is not None]
pairs = []
for i, cam1 in enumerate(cameras):
for j, cam2 in enumerate(cameras):
if i >= j:
continue
pairs.append((cam1, cam2))
chunk.matchPhotos(pairs=pairs, keypoint_limit=3000, tiepoint_limit=3000, generic_preselection=False, reference_preselection=False)
However, when I try to utilize network processing, it only works if pairs is not assigned.
Paris are as same as locol processing.
I do monitor the processing output, and found that only keypoints of first photo are detected.
can you help to debug it ?
2024-12-04 23:34:04 Using device: NVIDIA GeForce RTX 4070 Ti SUPER, 66 compute units, free memory: 15079/16375 MB, compute capability 8.9
2024-12-04 23:34:04 driver/runtime CUDA: 12050/10010
2024-12-04 23:34:04 max work group size 1024
2024-12-04 23:34:04 max work item sizes [1024, 1024, 64]
2024-12-04 23:34:04 [GPU] photo 0: 3000 points
2024-12-04 23:34:04 points detected in 0.532 sec
2024-12-04 23:34:04 processing finished in 0.682 sec
Code: [Select]
pairs = custom_pairs(chunk)
match_photos_task = Metashape.Tasks.MatchPhotos()
match_photos_task.keypoint_limit = 3000
match_photos_task.tiepoint_limit = 3000
match_photos_task.downscale = 1
match_photos_task.generic_preselection = False
match_photos_task.reference_preselection = False
match_photos_task.pairs = pairs
match_photos_task.filter_mask = True
match_photos_task.mask_tiepoints = False
match_photos_task.filter_stationary_points = False
match_photos_task.guided_matching = False
match_photos_task.reset_matches = True
network_task = match_photos_task.toNetworkTask(chunk)
tasks.append(network_task)
project_path = doc.path
batch_id = network_client.createBatch(project_path, tasks)
network_client.setBatchPaused(batch_id, False)