Forum

Author Topic: Selectively upload outputs into agisoft cloud  (Read 4852 times)

SFL_Beda

  • Newbie
  • *
  • Posts: 24
    • View Profile
Selectively upload outputs into agisoft cloud
« on: September 20, 2023, 12:51:53 PM »
Hi I currently am working on this setup:


1. Metashape python script (standalone) processes a dataset and creates many different outputs (pointcloud, model, tiledmodel, orthomosaic etc.)
2. I want to upload a minimal amount of data into the agisoft cloud, probably orthomosaic and model/tiledmodel.
3. A user annotates that data
4. Based on the exported annotations and the results from 1. another python script does further processing (no metashape needed)

As far as I can see, uploadProject() just uploads the whole project into the cloud (does that even include the pictures?) which would make my workflow unnecessarily slow and waste a lot of space on the cloud.
What is the best way to only upload the data I need?


Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Selectively upload outputs into agisoft cloud
« Reply #1 on: September 20, 2023, 05:11:01 PM »
Hello,

you can remove all unwanted items in chunk (cameras, tie points, depth maps, etc...) and save as light project and upload this light project to Cloud...
Best Regards,
Paul Pelletier,
Surveyor

SFL_Beda

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Selectively upload outputs into agisoft cloud
« Reply #2 on: September 21, 2023, 11:47:30 AM »
Hi Paul

thx for the suggestion, that is certainly a way to work around this.

Here is what I tried:
Code: [Select]
    #code that creates outputs in doc.chunk and exports it locally
    doc.save()
    doclight=doc.copy()
    chunklight=doclight.chunk
    chunklight.remove(chunklight.tie_points)
    chunklight.remove(chunklight.depth_maps)
    chunklight.remove(chunklight.cameras)
    chunklight.remove(chunklight.point_clouds)
    chunklight.remove(chunklight.elevations)
    chunklight.remove(chunklight.models)
    client = Metashape.CloudClient()
    client.username = '<my_username>'
    client.password="<my_pw>
    client.uploadProject(doclight)

however I run into multiple problems:

1. when trying to copy doc to doclight, i get "Exception: Null tiled model" eveb though I can open the saved project in metashape and there is a tiled model also when looking at doc.chunk.tiled_model it clearly exists.
2.If I just apply the above directly to doc, everything but removing tie_points works. Tie_points seem to be treated differently from the rest, how do I delete them from the project?
3. After uploading (with the tie_points), the project shows up in my cloud account but looks completely empty (see attachment). I can solve that by clicking publish in the cloud but would like to do this from python. Is there a way I can enable publishing after upload (like there is the checkbox in the gui)?



SFL_Beda

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Selectively upload outputs into agisoft cloud
« Reply #3 on: September 27, 2023, 12:12:44 PM »
Sorry to bump this so fast but this issue currently blocks my progress

I would be especialy Interessted in the 3rd point:

Is there a way to trigger the publishing process in the cloud from the python api?