Forum

Author Topic: Speed up metashape process - multiprocessing or other multicore/thread methods  (Read 249 times)

Emanuele1234

  • Newbie
  • *
  • Posts: 14
    • View Profile
Dear everyone,

I have a little question about how Python and Metashape works.
I have a problem, because I have to speed up a script which extract coordinates for any selected point in Metashape, but it needs like 27 days to run across 1 milion points.
For this reason I was wondering if you know a way to multiprocess everything and speed up a little the process.
I have already splitted  my dataframe in several parts, to call it in different functions, and I tried with asyncio to see if the process was speeding up a little but nothing. So I was wandering if multiprocessing package was a good solution. Unfortunately until now it gives me always an error:

Traceback (most recent call last):
  File "C:/Users/eepi0002/PycharmProjects/train/Proiection_asyncio.py", line 207, in <module>
    tree_array1.start()
  File "C:\Users\eepi0002\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\eepi0002\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Users\eepi0002\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 326, in _Popen
    return Popen(process_obj)
  File "C:\Users\eepi0002\AppData\Local\Programs\Python\Python38\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\eepi0002\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'Metashape.Metashape.Camera' object

Do you have any Idea?
Thank you in advance.
Best regards.
Emanuele Papucci.