Forum

Poll

NetworkTask parameters for standard workflow functions?

NetworkTask parameters for standard workflow functions?
0 (0%)
NetworkTask parameters for standard workflow functions?
2 (100%)

Total Members Voted: 2

Author Topic: Providing list of parameter names for each NetworkTask  (Read 7629 times)

smihic

  • Newbie
  • *
  • Posts: 31
    • View Profile
Providing list of parameter names for each NetworkTask
« on: April 27, 2016, 02:09:56 PM »
Hi,
    first of all thank you for providing networking for Python scripting. We have tried standard workflow functions, but some without success:
  • BuildModel works but ignores some parameters provided e.g. task.params['face_count'] = 2000000
  • BuildDenseCloud works but ignores some parameters provided e.g. task.params['filter'] = int(PhotoScan.FilterMode.MildFiltering).
  • All functions that require a path as parameters failed. Are paths need to be relative from the root folder for networking? Could you provide an example for textures and importmasks?

In addition, some parameters have changed name e.g. quality (BuildDenseCloud) in network mode is now downscale etc.

It seems that parameter mapping to NetworkTask parameters is not one on one. So, could you please provide a complete list of parameters?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #1 on: April 27, 2016, 02:56:39 PM »
Hello smihic,

For custom face count you need  to use face_count = 0 and also specify the desired value using face_count_custom = 2000000.

Parameter for the depth filtering in the Network Processing scripting is called filter_mode, not filter as for regular processing function.

The paths should be specified relatively to the root path. Which operation are you using that require path, so that I could check it and post an example?
Best regards,
Alexey Pasumansky,
Agisoft LLC

smihic

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #2 on: April 27, 2016, 04:08:03 PM »
Thank you Alexey for your prompt reply.

We are trying to use Import Masks from background where we specify background images pattern.
In addition, we have the same problem with Import Cameras function.
e.g.
Code: [Select]
task = PhotoScan.NetworkTask()
for c in PhotoScan.app.document.chunks:
task.frames.append((c.key,0))

task.name = 'ImportMasks'
task.params['network_distribute'] = True
task.params['path'] = "test/empty/{filename}.jpg" #where e.g. D:\network is set as root shared folder, and test absolute path is on D:\network\test. D drive is shared drive
task.params['method'] = 'background'
task.params['operation'] = 'replacement'
task.params['tolerance'] = 10
.
.
.
task1.name = 'ImportCameras'
task1.params['network_distribute'] = True
task1.params['path'] = "test/cameras.xml" #where e.g. D:\network is set as root shared folder, and test absolute path is on D:\network\test. D drive is shared drive
.
.
.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #3 on: April 27, 2016, 05:58:58 PM »
Hello smihic,

The script for camera import should look like the following:
Code: [Select]
import PhotoScan

client = PhotoScan.NetworkClient()
chunk = PhotoScan.app.document.chunk

task1 = PhotoScan.NetworkTask()
task1.name = 'ImportCameras'
task1.chunks.append(chunk.key)
task1.params['format'] = 0 #xml
task1.params['path'] = "processing/cameras.xml" #processing folder is subdir of the root folder

path = "processing/project.psx" #also relative path from root folder
client.connect('192.168.0.2') #server ip
batch_id = client.createBatch(path, [task1])
client.resumeBatch(batch_id)
print("Job started...")

and for mask import it's a little bit more complicated:
Code: [Select]
import PhotoScan

client = PhotoScan.NetworkClient()
chunk = PhotoScan.app.document.chunk

task1 = PhotoScan.NetworkTask()
task1.name = 'ImportMasks'
task1.frames.append((chunk.key, 0))
task1.params['path'] = "processing/masks/{filename}.png"
task1.params['method'] = 2 #2 = From Background
task1.params['operation'] = 0 #0 = replace

path = "processing/project.psx"
client.connect('192.168.0.2') #server ip
batch_id = client.createBatch(path, [task1])
client.resumeBatch(batch_id)
print("Job started...")
« Last Edit: April 27, 2016, 06:15:21 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC

smihic

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #4 on: April 28, 2016, 02:25:43 PM »
Thank you Alexey. Code that you provided works.

When we execute these operations (ImportMasks, MatchPhotos etc.), we need to check for their status (completed, errors etc.) with batchStatus periodically (probably from different thread?) or there is a better way to do this?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #5 on: April 29, 2016, 06:29:23 PM »
Hello smihic,

At the moment I don't see any other options apart from checking the status of the task regularly.
Best regards,
Alexey Pasumansky,
Agisoft LLC

smihic

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #6 on: May 06, 2016, 11:58:53 AM »
Hi,
   when we use NetworkTasks on multi chunk projects and error occurs on one of them, how can we know on which one error occurred? From response we get from batchStatus, we get only number of active/processed and total items.

Best regards,
Srdjan
« Last Edit: May 06, 2016, 04:11:09 PM by smihic »

ajovanovic

  • Newbie
  • *
  • Posts: 2
    • View Profile
Providing list of parameter names for each NetworkTask
« Reply #7 on: March 01, 2017, 02:59:28 PM »
Dear Agisoft team,

Could you please provide us list of parameter names for each NetworkTask that we use in Python API?
List of NetworkTask names is provided in this post: http://www.agisoft.com/forum/index.php?topic=6543.msg31580#msg31580

Also, please mark equivalent parameter names that we use in chunk methods, for example:
Chunk method with parameters: optimizeCameras(fit_f=True, fit_cxcy=True, fit_b1=True, fit_b2=True, fit_k1k2k3=True, fit_p1p2=True, fit_k4=False, fit_p3=False, fit_p4=False [ , progress ] )
NetworkTask:
   task.name = 'OptimizeCameras'
   task.params['fit_f'] = True # if we use 'fit_f' as parameter name to reference parameter fit_f in optimizeCameras Chunk method
   # etc.

Thank you in advance.

Best regards, Aleksandar

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Providing list of parameter names for each NetworkTask
« Reply #8 on: March 02, 2017, 01:21:28 PM »
Hello Aleksandar,

For OptimizeCameras task the list of parameters is the following (for version 1.3.0):

Code: [Select]
fit_f
fit_cx
fit_cy
fit_b1
fit_b2
fit_k1
fit_k2
fit_k3
fit_k4
fit_p1
fit_p2
fit_p3
fit_p4
fit_shutter

all of them are accepting Boolean values.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ajovanovic

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Providing list of parameter names for each NetworkTask
« Reply #9 on: March 02, 2017, 01:45:33 PM »
Thank you very much Alexey and Agisoft Support team

pihulj

  • Newbie
  • *
  • Posts: 2
    • View Profile
NetworkTask parameters for standard workflow functions?
« Reply #10 on: April 21, 2017, 03:07:01 PM »
It seems that parameter mapping to NetworkTask parameters is not one on one. So, could you please provide a complete list of parameters?

coreyevanf

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #11 on: November 22, 2017, 11:40:21 PM »
Hi Alexey,

Without a reference which lists Network task parameters, it is impossible to set custom values for processing.

"In addition, some parameters have changed name e.g. quality (BuildDenseCloud) in network mode is now downscale etc.

It seems that parameter mapping to NetworkTask parameters is not one on one. So, could you please provide a complete list of parameters?"

Could you please direct us to a list of all parameters?

Thanks
C

coreyevanf

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Providing list of parameter names for each NetworkTask
« Reply #12 on: November 22, 2017, 11:43:43 PM »
Thanks, but we still need the parameters for all of the other items on the list!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: NetworkTask parameters for standard workflow functions?
« Reply #13 on: January 25, 2018, 03:17:22 PM »
In the version 1.4.0 you can print out the list of the network task names and the parameters used with the following script:

Code: [Select]
import PhotoScan, inspect
tasks = inspect.getmembers(PhotoScan.Tasks, predicate=inspect.isclass)
for task in tasks:
if task[0] == "__class__":
continue
print(task[0]) #task name
methods = inspect.getmembers(b, predicate=inspect.isdatadescriptor)
for method in methods:
print("\t\t" +method[0])

Also you can find the list in PhotoScan.Tasks section of Python API for the version 1.4.0:
http://www.agisoft.com/pdf/photoscan_python_api_1_4_0.pdf
Best regards,
Alexey Pasumansky,
Agisoft LLC