Forum

Author Topic: Metashape 2.0.2 and 2.0.3 crash when using scripts  (Read 3747 times)

Wizyza

  • Newbie
  • *
  • Posts: 17
    • View Profile
Metashape 2.0.2 and 2.0.3 crash when using scripts
« on: September 19, 2023, 12:12:37 AM »
Hello,

I'm testing out using scripts to automate some of my processing. Currently, I'm trying a script developed by the USGS. Maybe some of you are familiar with the script associated with this publication:

    Over, J.R., A.C. Ritchie, C. Kranenburg, J.A. Brown, D.D. Buscombe,
    T. Noble, C.R. Sherwood, J. Warrick, and P.A. Wernette. (2021) Processing
    coastal imagery with Agisoft Metashape Professional Edition, version
    1.6—Structure from motion workflow documentation: U.S. Geological Survey
    Open-File Report 2021-1039, x p. www.doi.org/10.3133/ofr20211039.

The script contains a workflow for alignment and error reduction.

Unfortunately, using the script causes Metashape (2.0.2 and 2.0.3 running on Windows 11) to crash. When I use the script to perform alignment, the application crashes right as the camera positions are calculated. I've also tried alignment using the GUI and then using the script for error reduction - Metashape crashes immediately.

Has anyone had similar issues when using scripts?

Thanks.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #1 on: September 21, 2023, 06:11:05 PM »
Hello Wizyza,

Does the application crash, if you follow the steps using GUI only?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Wizyza

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #2 on: September 25, 2023, 05:44:40 PM »
Hi Alexey,

No, the GUI works just fine. I'm writing my own script, which has run with no issue. I was hoping to use the script I referenced, making any changes needed to get it to run under 2.0.3. However, when I try to run the script through the GUI, the GUI crashes immediately. This is unfortunate, because I receive no feedback that would help me figure out where any issues are.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #3 on: September 25, 2023, 08:16:39 PM »
Hello Wizyza,

Can you attach the script to a reply or send it to support@agisoft.com, so that we could check exactly the same code on our side?

Also the log file from the script start up to its crash would be helpful.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Wizyza

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #4 on: October 02, 2023, 10:32:11 PM »
Hi Alexey,

The script can be downloaded from here:

https://code.usgs.gov/pcmsc/AgisoftAlignmentErrorReduction/-/tree/v2.0

I figured I'd post the link along with the actual script so you know where it's coming from.

Where are the log files stored?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #5 on: October 03, 2023, 01:47:40 PM »
Hello Wizyza,

If you are starting the script from Metashape GUI, then the log will be saved to the same file that is indicated in "Write log to file" field on the General Preferences tab. In case the script is started from the command line (terminal) the output will be shown directly in the same terminal window.

In the original script you should modify chunk.point_cloud to chunk.tie_points and Metashape.PointCloud.Filter should be replaced by Metashape.TiePoints.Filter should be replaced in all the occurrences.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Wizyza

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #6 on: October 03, 2023, 06:03:51 PM »
Hi Alexey,

I made the changes you mentioned. I also was not aware of the "Write log to file" check box, so thank you for mentioning that.

However, the script still crashes Metashape and unfortunately, the log file (which I've attached) does not mention any errors that would help in diagnosing the issue.

Maybe it's just as well. I've already poured much time into the script I'm writing now and it's been a good learning experience.

Thank you again for the help.

PS - I had been running the script through the GUI.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Metashape 2.0.2 and 2.0.3 crash when using scripts
« Reply #7 on: October 04, 2023, 05:33:36 PM »
Hello Wizyza,

What happens if you start image matching (Align Photos) operation for the same dataset via GUI? And can you please also share the GPU Preferences tab screenshot.
Best regards,
Alexey Pasumansky,
Agisoft LLC