Permission Denied when using WebODM lightning API

Does anyone have an idea why this is happening? I am new to WebODM so this is probably just something small that I am missing.
I’m attempting to use the webodm lightning API in order to process and download images and point clouds, I have a file called process.py in which there is the following (slightly redacted) code:

from pyodm import Node
import glob

n = Node('spark1.webodm.net', 443, 'MY_TOKEN')
task = n.create_task(glob.glob("D:\\Documents\\University of Pretoria\\COS301\\Capstone Project\\Test Imagery"), {'dsm': True})
task.wait_for_completion()
task.download_assets("results")

When I try to run this, I get the following error message stream. I don’t know why this is the case and I have also tried running it as administrator but I get the same issue.

This is running on Windows 11 Home edition and within a python 3.10.5 virtual environment with the following libraries:

certifi==2022.6.15
charset-normalizer==2.1.0
idna==3.3
pyodm==1.5.9
requests==2.28.1
requests-toolbelt==0.9.1
urllib3==1.26.10

Any ideas? The error seems to originate from the pyodm/api.py file. Is the problem in that api.py file or am I using the API incorrectly? Thanks.

Hi, welcome :wave:

Try changing this line:

task = n.create_task(glob.glob("D:\\Documents\\University of Pretoria\\COS301\\Capstone Project\\Test Imagery"), {'dsm': True})

To:

task = n.create_task(glob.glob("D:\\Documents\\University of Pretoria\\COS301\\Capstone Project\\Test Imagery\\*"), {'dsm': True})

Note the * at the end. You need to pass a list of images, not a folder.

That solved it for me. Thank you very much :grin:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.