Dear Concerned
I refered to an example python codes from Alexey on network processing and managed to run the following tasks using several nodes.
I can see the processing status in the network monitor just like I ran it in GUI manually.
But in the GUI of that agisoft project on server node, it doesn't show the processing tasks/status like I ran it manually in GUI. I can only check the status in network monitor.
Also when processes finished the project GUI won't update with processed results, unless I close and reopen the that project file then the results are there.
Any idea?
import Metashape
doc = Metashape.app.document
chunk = doc.chunk
network_tasks = list()
dir_project = Metashape.app.document.path # '.../Processing/xxxx.psx'
### match photos
task = Metashape.Tasks.MatchPhotos()
task.downscale = 2
task.keypoint_limit = 100000
task.tiepoint_limit = 0
task.generic_preselection = True
task.reference_preselection = True
task.reference_preselection_mode = Metashape.ReferencePreselectionSource
task.subdivide_task = 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.subdivide_task = 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)
### depth maps
task = Metashape.Tasks.BuildDepthMaps()
task.downscale = 2
task.filter_mode = Metashape.FilterMode.MildFiltering
task.subdivide_task = 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)
### mesh
task = Metashape.Tasks.BuildModel()
task.source_data = Metashape.DepthMapsData
task.surface_type = Metashape.Arbitrary
task.interpolation = Metashape.EnabledInterpolation
task.face_count = Metashape.FaceCount.HighFaceCount
task.vertex_colors = 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)
### dense cloud
task = Metashape.Tasks.BuildDenseCloud()
task.point_colors = True
task.subdivide_task = 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)
### DEM
task = Metashape.Tasks.BuildDem()
task.source_data = Metashape.DepthMapsData
task.interpolation = Metashape.EnabledInterpolation
task.projection = chunk.crs
task.subdivide_task = 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)
### Orthomosaic
task = Metashape.Tasks.BuildOrthomosaic()
task.surface_data = Metashape.DataSource.ElevationData
task.resolution = 0.05
task.projection = chunk.crs
task.blending_mode = Metashape.BlendingMode.MosaicBlending
task.subdivide_task = 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)
### running processing:
client = Metashape.NetworkClient()
client.connect("192.168.2.39") #server ip
batch_id = client.createBatch(doc.path, network_tasks)
client.setBatchPaused(batch_id,False)
doc.save(path=dir_project)
doc.save()
Thanks in advance!!
Zeying