Forum

Author Topic: Network processing status not displayed  (Read 1571 times)

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Network processing status not displayed
« on: March 20, 2023, 10:50:58 AM »
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?

Code: [Select]
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

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Network processing status not displayed
« Reply #1 on: March 21, 2023, 05:50:52 AM »
To be clear, when running these scripts in console, GUI doesn't show processing in progress.
But if I close and reopen that project, I can see the processing status.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Network processing status not displayed
« Reply #2 on: March 23, 2023, 06:23:02 PM »
Hello Zeying,

Seems like it is not possible in the current version to open the network processing dialog in Metashape GUI using only Python API calls.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Network processing status not displayed
« Reply #3 on: March 24, 2023, 05:15:53 AM »
Thanks anyway!

Zeying

rhseaeng

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Network processing status not displayed
« Reply #4 on: March 08, 2024, 03:09:37 AM »
Hello Zeying,

Seems like it is not possible in the current version to open the network processing dialog in Metashape GUI using only Python API calls.

Are there any plans to update this? It seems that my scripts are successfully pushing batches to the network but Metashape is unresponsive for the entirety of the network processing.