Forum

Author Topic: Cant run this good script after upgrade to 1.6.4  (Read 2716 times)

perelo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Cant run this good script after upgrade to 1.6.4
« on: November 20, 2020, 08:04:55 PM »
I've been using this script for automation, but it stopped working after I upgraded Metashape. Can someone with Python skills help med to get this running on version 1.6.4?

https://github.com/gisportsmouth/PhotoScan-Automation-Script/blob/master/PScan%20Chunk%20Scripts%20v7%20Metashape%20.py

I get this error message when I run it:

2020-11-20 17:54:58 Loading project...
2020-11-20 17:54:59 loaded project in 0.138 sec
2020-11-20 17:54:59 Finished processing in 0.139 sec (exit code 1)
2020-11-20 17:55:07 Traceback (most recent call last):
2020-11-20 17:55:07   File "H:/Kartering/PScan Chunk Scripts v7 Metashape .py", line 95, in <module>
2020-11-20 17:55:07     class MS_Proc(object):
2020-11-20 17:55:07   File "H:/Kartering/PScan Chunk Scripts v7 Metashape .py", line 508, in MS_Proc
2020-11-20 17:55:07     acc = Metashape.HighAccuracy,
2020-11-20 17:55:07 AttributeError: module 'Metashape' has no attribute 'HighAccuracy'
2020-11-20 17:55:07 Error: module 'Metashape' has no attribute 'HighAccuracy'

/Per E. Sweden

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15168
    • View Profile
Re: Cant run this good script after upgrade to 1.6.4
« Reply #1 on: November 21, 2020, 11:44:20 AM »
Hello Per,

Instead of Accuracy for matching and Quality for depth maps generation you should use corresponding Int values.

Quote
For matching accuracy the correspondence should be the following:
Highest = 0
High = 1
Medium = 2
Low = 4
Lowest = 8

For depth maps quality:
Ultra = 1
High = 2
Medium = 4
Low = 8
Lowest = 16

Additionally I can suggest to confirm the names of the parameters for the functions that you are using, as some of them might have changes since the version used for the script debugging.

For example, for matchPhotos: accuracy -> downscale; for buildDepthMaps -> quality -> downscale, filter -> filter_mode; for buildModel: surface -> surface_type, source -> source_data; for buildUV: mapping -> mapping_mode; for buildTexture: blending -> blending_mode, size -> texture_size; for buildDem: source -> source_data; for buildOrthomosaic: surface -> surface_data, blending -> blending_mode. For DEM and Orthomosaic export now exportRaster command should be used, also please check, how to set up the export projection for them:
https://www.agisoft.com/forum/index.php?topic=11802.msg52872#msg52872
Best regards,
Alexey Pasumansky,
Agisoft LLC