Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tinco

Pages: [1]
1
Python and Java API / Re: Can not export depth maps
« on: May 21, 2019, 09:42:24 PM »
The buildModel step is crashing with RuntimeError: Index overflow, but if I google that it looks like it's a problem with dense cloud points, but I'm not using dense cloud..

Code: [Select]
2019-05-21 12:44:49.085103 :  buildModel 2.5
Traceback (most recent call last):
  File "./process_dataset.py", line 155, in <module>
    run_existing_project(doc)
  File "./process_dataset.py", line 50, in run_existing_project
    chunk.buildModel(source=Metashape.DepthMapsData, keep_depth=True, face_count=Metashape.HighFaceCount, progress=progress("buildModel"))
RuntimeError: Index overflow

2
Python and Java API / Re: Interactive mode doesn't have readline
« on: May 21, 2019, 12:04:37 PM »
I tried adding the readline module like in the guide here:

https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-metashape-professional-package

And I got libssl0.9.8 installed, but I'm still getting the "cannot import name 'HTTPSHandler'" error. Is there some step to reconfigure python missing?

Code: [Select]
tinco@metashape-experiment:~$ ls /usr/lib/libssl.so.0.9.8
/usr/lib/libssl.so.0.9.8
tinco@metashape-experiment:~$ uname -a
Linux metashape-experiment 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64 GNU/Linux
tinco@metashape-experiment:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.9 (stretch)
Release:        9.9
Codename:       stretch
tinco@metashape-experiment:~$ ./bin/metashape_interactive.sh
Agisoft Metashape Professional Version: 1.5.2 build 7838 (64 bit)
Platform: Linux
CPU: Intel(R) Xeon(R) CPU @ 2.00GHz
CPU family: 6 model: 85 signature: 50653h
RAM: 354.3 GB
Starting Interactive Python Console
Type exit() and press Enter to exit
>>>
tinco@metashape-experiment:~$ ./metashape-pro/python/bin/python3.5 -m pip install readline
Traceback (most recent call last):
.....
  File "/home/tinco/metashape-pro/python/lib/python3.5/site-packages/pip/_vendor/distlib/compat.py", line 66, in <module>
    from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler'

3
Python and Java API / Interactive mode doesn't have readline
« on: May 20, 2019, 11:47:29 AM »
This is more sort of a bug report or feature request I think. Sometimes I have to experiment on the server a little to prepare a render, and I use:

Code: [Select]
metashape.sh -platform offscreen -i

To load the project and make some tweaks. This works well, but an inconvenience is that the metashape python doesn't have the readline package installed. This means that the arrow keys don't work, so I can not correct typos or go back to a previous line in history.

It's a small thing, but I get that it might be complicated to work in production for you guys, maybe just a way or a guide on how to enable readline would be nice.  :)

4
Python and Java API / Re: Can not export depth maps
« on: May 18, 2019, 03:48:06 PM »
Thanks that would be appreciated :) Though it would also be fine if there is a different route to building the high quality tiled model. Maybe I could just build a model, and then run the Cesium model tiler on that? https://cesium.com/docs/on-premise/tilers/models/

edit: oh nvm, I need an on-premise cesium license for that..

5
Python and Java API / Re: Can not export depth maps
« on: May 17, 2019, 07:59:30 PM »
Ah thanks Alexey, that explains a lot. So at the moment we're calculating the depth maps twice, and it's not even using the high quality depth maps for constructing the final model.

Is there a way we can get a tiled model based on high quality depth maps? It is important for our use case that they be as accurate as possible. Would it be better for example to make the dense point cloud based on the depth maps and then make the tiled model based on that?

6
Python and Java API / Re: Can not export depth maps
« on: May 17, 2019, 06:41:11 PM »
Does it throw away the depth maps after buildTiledModel?

7
Python and Java API / Re: Can not export depth maps
« on: May 17, 2019, 03:45:02 PM »
Thanks Alexey!

I am running 1.5.2. I'll start a job now with keep_depth instead of reuse_depth. Note that I think that means the Python documentation is out of date then, because it still says reuse_depth in the docs for buildTiledModel.

I think it has not saved the depth_maps at all with the reuse_depth setting, if I open the project this is my output:

Code: [Select]
>>> doc.open(doc_path,ignore_lock=True)
LoadProject: path = project.psx
loaded project in 1.49855 sec
>>> doc.chunks
[<Chunk 'Chunk 1'>]
>>> doc.chunks[0]
<Chunk 'Chunk 1'>
>>> doc.chunks[0].depth_maps
{}

I'll try moving the saving depth part to right after the depth map generation as well. Could it be the buildTiledModel step throws them away?

8
Python and Java API / Can not export depth maps
« on: May 16, 2019, 04:50:07 PM »
Hi,

I found this snippet on this forum to export depth maps as .exr files:

Code: [Select]
Traceback (most recent call last):
  File "./process_dataset.py", line 107, in <module>
    run_new_project(doc)
  File "./process_dataset.py", line 89, in run_new_project
    if camera in chunk.depth_maps.keys():

And I inserted into my experimentation script like so:

Code: [Select]
def run_new_project(doc):
  photo_files = glob.glob(source_dir + "/*.JPG")
  chunk = doc.addChunk()
  chunk.addPhotos(photo_files)
  chunk.matchPhotos(progress=progress("matchPhotos"), accuracy=Metashape.HighestAccuracy, generic_preselection=True, reference_preselection=False)
  chunk.alignCameras(progress=progress("alignCameras"))
  chunk.optimizeCameras(progress=progress("optimizeCameras"))
  chunk.buildDepthMaps(quality=Metashape.HighQuality, max_neighbors=50, progress=progress("buildDepthMaps"))
  chunk.buildTiledModel(source=Metashape.DepthMapsData, reuse_depth=True, face_count=16000, progress=progress("buildTiledModel")) #, tile_size=1024)
  chunk.exportTiledModel(target_dir + '/scene.zip', Metashape.TiledModelFormatCesium, progress=progress("exportTiledModel"))

  for camera in chunk.cameras:
    if camera in chunk.depth_maps.keys():
        depth = chunk.depth_maps[camera].image()
        depth.save(target_dir + '/' + camera.label + ".exr")
  doc.save()

Metashape.app.gpu_mask = 2 ** (len(Metashape.app.enumGPUDevices())) - 1
doc = Metashape.app.document

doc_path = target_dir + "/project.psx"
exists = os.path.isfile(doc_path)

doc.save(doc_path)
run_new_project(doc)

The exporting of the model works fine, but the exporting of the depth maps fails with this error:

Code: [Select]
Traceback (most recent call last):
  File "./process_dataset.py", line 107, in <module>
    run_new_project(doc)
  File "./process_dataset.py", line 89, in run_new_project
    if camera in chunk.depth_maps.keys():
Exception: Null depth maps

Has it not calculated the depth maps? Is it using the depth maps generated in the depth maps step for building the tiled model?

Thanks :)

Tinco

Pages: [1]