Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading of the opf-spec example fails #3

Closed
abey79 opened this issue Jun 6, 2023 · 6 comments
Closed

Loading of the opf-spec example fails #3

abey79 opened this issue Jun 6, 2023 · 6 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@abey79
Copy link

abey79 commented Jun 6, 2023

I tried loading the opf-spec example but it failed with the following error:

>>> from pyopf.resolve import resolve
>>> p =resolve(load("examples/project.json"))
Traceback (most recent call last):
  File "/Users/hhip/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.9011.38/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/resolve/resolver.py", line 96, in resolve
    obj = io.load(item.resources[0].uri, project.base_uri)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/io/loaders.py", line 145, in load
    return loader(*params)
           ^^^^^^^^^^^^^^^
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/io/loaders.py", line 35, in _load_from_json
    with open(str(uri)) as f:
         ^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/hhip/src/opf-spec/examples/cameras.json'

It looks like opf-spec/examples/project.json has many mis-formatted links to resource files (- vs _)—I'm not sure if this is intensional. Are there other example projects available for testing?

@krahenbuhl
Copy link
Contributor

Ooops, thanks for noticing! A fix is incoming

@krahenbuhl
Copy link
Contributor

Thanks @abey79
The faulty example should now be fixed in the main branch of https://github.com/Pix4D/opf-spec
We will provide a few demo OPF projects soon, I will update this ticket then

@krahenbuhl krahenbuhl added bug Something isn't working documentation Improvements or additions to documentation labels Jun 8, 2023
@abey79
Copy link
Author

abey79 commented Jun 8, 2023

Great thanks!

@krahenbuhl
Copy link
Contributor

@abey79
Copy link
Author

abey79 commented Jun 23, 2023

@krahenbuhl awesome, thanks!

@abey79
Copy link
Author

abey79 commented Jul 28, 2023

BTW, we have now published a Rerun example using pyopf: https://github.com/rerun-io/rerun/tree/main/examples/python/open_photogrammetry_format

The visual even made it to our recent release 0.8 announcement: https://twitter.com/rerundotio/status/1684668023959924736

Thanks again for the lib and the dataset 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants