I'm having some trouble with very high memory spikes during the buildOrthomosaic processing step that is actually crashing / failing photoscan for some projects (this doesn't happen for all projects). I'm running version 1.2.2, and don't seem to have the same issue when running an older version of the software (1.1.6).
For example, for a relatively small project (99 images / 500MB) with version 1.2.2, I'm seeing a large memory spike up to about 50GB, but when running version 1.1.6 the memory usage never rose above about 14GB. Here's a link to the input images if you want to replicate:
https://www.dropbox.com/s/ysmjsuahw5nsagt/sample_images.zip?dl=0My workflow for 1.2.2 is as follows:
import PhotoScan
app = PhotoScan.Application()
doc = PhotoScan.Document()
chunk = doc.addChunk()
chunk.addPhotos(image_list)
chunk.loadReferenceExif()
coord_system = PhotoScan.CoordinateSystem('EPSG::4326')
chunk.crs = coord_system
chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.ReferencePreselection, tiepoint_limit=10000)
chunk.alignCameras()
chunk.optimizeCameras()
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality, filter=PhotoScan.AggressiveFiltering)
chunk.buildModel(surface=PhotoScan.HeightField, source=PhotoScan.DenseCloudData, face_count=PhotoScan.HighFaceCount, interpolation=PhotoScan.EnabledInterpolation)
chunk.model.closeHoles()
chunk.model.fixTopology()
chunk.buildUV(mapping=PhotoScan.GenericMapping, count=16)
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
doc.save(path=new_project_path, chunks=[chunk])
doc = PhotoScan.Document()
doc.open(new_project_path)
chunk = doc.chunk
chunk.buildOrthomosaic()
chunk.exportOrthomosaic(ortho_path, projection=chunk.crs)
chunk.buildDem(source=PhotoScan.DenseCloudData)
chunk.exportDem(dem_path, projection=chunk.crs)
doc.save(path=project_path, chunks=[chunk])
app.quit()
My workflow for 1.1.6 is as follows:
import PhotoScan
app = PhotoScan.Application()
doc = PhotoScan.Document()
chunk = PhotoScan.Chunk()
doc.addChunk(chunk)
chunk.addPhotos(image_list)
chunk.loadReferenceExif()
coord_system = PhotoScan.CoordinateSystem('EPSG::4326')
chunk.crs = coord_system
chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.ReferencePreselection, tiepoint_limit=10000)
chunk.alignCameras()
chunk.optimizeCameras()
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality, filter=PhotoScan.AggressiveFiltering)
chunk.buildModel(surface=PhotoScan.HeightField, source=PhotoScan.DensePoints, face_count=PhotoScan.HighFaceCount, interpolation=PhotoScan.EnabledInterpolation)
chunk.model.closeHoles()
chunk.model.fixTopology()
chunk.buildUV(mapping=PhotoScan.GenericMapping, count=16) # try different mapping modes
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
chunk.exportOrthophoto(ortho_path, color_correction=False, blending=PhotoScan.MosaicBlending, projection=chunk.crs)
chunk.exportDem(dem_path, projection=chunk.crs)
doc.save(project_path)
app.quit()
Is this a known issue / can I change my 1.2.2 workflow to avoid such high memory usage?
Any help greatly appreciated.