Forum

Author Topic: BuildModel hangs CPU during decimating mesh  (Read 3568 times)

pilot_a

  • Newbie
  • *
  • Posts: 4
    • View Profile
BuildModel hangs CPU during decimating mesh
« on: May 20, 2021, 02:11:50 PM »

Hi,

I am looking for hints and comments to resolve API script problem concerning a mesh model calculation from imported LAS point clouds.
The script slows down and hangs for days. There is no any error messages or crash downs. It just stops and CPU usage is all the time at 100%.
If there is something to control CPU during the process or other way out I would be glad.
However, the script succeeds when the LAS file is around 1 million points or less, but I need to calculate much bigger files (50M points).

Sometimes that happens too via GUI. More specified it will happen when decimating mesh step is started. It stucks when processing bar is 21%

Below my script and it stucks before UV baking process.

I tried to add "subdivide_task=True" but nothing happened.

chunk.buildModel(surface_type=Metashape.Arbitrary, interpolation=Metashape.EnabledInterpolation, vertex_colors=True, face_count=Metashape.MediumFaceCount, source_data=Metashape.DenseCloudData, volumetric_masks=False, keep_depth=True)
chunk.buildUV(mapping_mode=Metashape.AdaptiveOrthophotoMapping, page_count=1, texture_size=8192)
chunk.buildTexture(blending_mode=Metashape.DisabledBlending, texture_size=8192, texture_type=Metashape.Model.TextureType.DiffuseMap, source_model=chunk.models[0].key, transfer_texture=False)


PC specs:
-AMD Ryzen Threadripper 2920X  12-cores
-64BG RAM (memory test succeeded)

Thanks in advance,
pilot A

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15168
    • View Profile
Re: BuildModel hangs CPU during decimating mesh
« Reply #1 on: May 20, 2021, 02:27:40 PM »
Hello pilot A,

Can you provide the processing log lines related to the build mesh operation that stalls?

Also please check the RAM consumption during this operation.
Best regards,
Alexey Pasumansky,
Agisoft LLC

pilot_a

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: BuildModel hangs CPU during decimating mesh
« Reply #2 on: May 20, 2021, 03:57:21 PM »
Thanks for answering.


I sent a log as a pm.

RAM consumption is only 20-30% No need for virtual mem.

Best Regards,
pilot_A

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15168
    • View Profile
Re: BuildModel hangs CPU during decimating mesh
« Reply #3 on: May 20, 2021, 04:46:29 PM »
Hello pilot A,

Thank you for sharing the log.

Do you observe the same behavior, if you generate the mesh model using custom face count = 0 value, save the project and then try to decimate it to the reasonable value via Tools Menu -> Mesh -> Decimate command?
Before trying this I recommend to set the default view option from Model to Point Cloud in General preferences tab, thus the Model view wouldn't try to display the model, once it is generated.

In your log a different CPU model is specified from the one you have mentioned in the original post - does it mean that you observe the problem on different machines?
Best regards,
Alexey Pasumansky,
Agisoft LLC

pilot_a

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: BuildModel hangs CPU during decimating mesh
« Reply #4 on: May 20, 2021, 05:09:53 PM »
Hello,


I already tried to set  face count = 0, but it still occurs via API. As well no matter what is the resolution of final model.
It seems to depend on only the size of LAS file. When it is big enough API script just run and run with full CPU usage.


Yes, this appears on both PCs that's why a different log file.

I am looking for if some determination to script could help.

Thanks again,
pilot_A

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15168
    • View Profile
Re: BuildModel hangs CPU during decimating mesh
« Reply #5 on: May 21, 2021, 02:21:44 PM »
Hello pilot A,

Via API you should use face_count = Metashape.FaceCount.CustomFaceCount and face_count_custom = 0 parameters for buildModel operation. In this case no decimation will be applied. At which line of log the operation freezes in this case?

And whether it is possible to share Metashape project in PSZ format with the already imported point cloud that we can use to reproduce the problem on our side (providing that same project fails on your side)?
Best regards,
Alexey Pasumansky,
Agisoft LLC