Forum

Author Topic: Delaying start of a project  (Read 1480 times)

caioll

  • Newbie
  • *
  • Posts: 5
    • View Profile
Delaying start of a project
« on: June 06, 2018, 08:33:35 PM »
Hi guys,

sometimes the projects are too big to run two of them at a time. I am trying to set up a delay, so one process starts when the first one is already finished.

So far I have ran this script and it has worked, but if anyone has a better way of doing it, I would like to know.


Code: [Select]
import time

delay = int(36000)

for i in range(delay):
    print (str(delay-i) + ( "  "), end='\r')
    time.sleep(1)
   







Thank you,

Caio
« Last Edit: June 06, 2018, 08:52:32 PM by caioll »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Delaying start of a project
« Reply #1 on: June 07, 2018, 12:22:05 PM »
Hello Caio,

What is the goal of the script delay?

If you are processing the projects using the same parameters, then you can use the loop in the script that opens different projects and just runs the same processing workflow for each one of them doing that one by one.
Best regards,
Alexey Pasumansky,
Agisoft LLC

caioll

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Delaying start of a project
« Reply #2 on: June 08, 2018, 12:47:41 AM »
Hello Alexey,

The goal is to process different projects one after the other, so the computer does not run out of memory and crushes.
I did not now there was such a thing as this loop, is there any examples you can post?

Thank you.

Caio

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Delaying start of a project
« Reply #3 on: July 01, 2018, 07:19:09 PM »
Hello Caio,

If you have multiple projects for which you would like to perform the same operations, you can do something like the following:

Code: [Select]
import PhotoScan

project_list = ["D:/projects/proj2.psx", "C:/datasets/proj.psx", "D:/data/someotherdoc.psx"] #list of paths

for path in project_list:
    doc = PhotoScan.Document()
    doc.open(path)
    chunk = doc.chunk
    chunk.matchPhotos()
    chunk.alignCameras()
    #etc.
    doc.save(path)

This code will open the project from the defined list one by one and perform the same processing operations to each one of them.
Best regards,
Alexey Pasumansky,
Agisoft LLC