Hello All,
I'm having a difficult time getting network processing to run with headless python. I can get it to work for a single command (e.g., MatchPhotos).
path = "\\1a_u6\\Metashape_Project.psx"
### match photos
task = Metashape.Tasks.MatchPhotos()
task.downscale = Metashape.Accuracy.MediumAccuracy
task.keypoint_limit = 50000
task.tiepoint_limit = 0
task.preselection_generic = True
task.preselection_reference = True
task.network_distribute = True
n_task = Metashape.NetworkTask()
n_task.name = task.name
n_task.params = task.encode()
n_task.frames.append((chunk.key, 0))
client = Metashape.NetworkClient()
client.connect('10.1.2.234')
batch_id = client.createBatch(path, [n_task])
client.resumeBatch(batch_id)
doc.save()
But am unable to execute multiple commands (e.g., MatchPhotos + AlignCameras) using Alexey's code:
path = "/1a_u6/Metashape_Project.psx"
root = "/xdisk/jgillan"
network_tasks = list()
### match photos
task = Metashape.Tasks.MatchPhotos()
task.downscale = Metashape.Accuracy.MediumAccuracy
task.keypoint_limit = 50000
task.tiepoint_limit = 0
task.preselection_generic = True
task.preselection_reference = True
task.network_distribute = True
n_task = Metashape.NetworkTask()
n_task.name = task.name
n_task.params = task.encode()
n_task.frames.append((chunk.key, 0))
network_tasks.append(n_task)
###align cameras
task = Metashape.Tasks.AlignCameras()
task.adaptive_fitting = True
task.network_distribute = True
n_task = Metashape.NetworkTask()
n_task.name = task.name
n_task.params = task.encode()
n_task.frames.append(chunk.key)
network_tasks.append(n_task)
client = Metashape.NetworkClient()
client.connect('10.1.2.234')
batch_id = client.createBatch(path[len(root):], network_tasks)
client.resumeBatch(batch_id)
doc.save()
The 'client.createBatch' line appears to be the problem. I've tried writing that line of code a hundred different ways and tried changing the formatting of the path and root a hundred different ways. It always throws the error 'value is a not a tuple'.
I'm using Linux version 1.5.5.9097
Python 3.7
Please help.
