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

Fix open photogrammetry example not working on Windows #3705

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/python/open_photogrammetry_format/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Load an Open Photogrammetry Format (OFP) project and display the cameras and point cloud.
Load an Open Photogrammetry Format (OPF) project and display the cameras and point cloud.

OPF specification: https://pix4d.github.io/opf-spec/index.html
Dataset source: https://support.pix4d.com/hc/en-us/articles/360000235126-Example-projects-real-photogrammetry-data#OPF1
Expand Down Expand Up @@ -77,8 +77,13 @@ def __init__(self, path: Path, log_as_frames: bool = True) -> None:
log_as_frames : bool, optional
Whether to log the cameras as individual frames, by default True
"""
import os

self.path = path
self.project = resolve(load(str(path)))
# TODO(Pix4D/pyopf#6):
emilk marked this conversation as resolved.
Show resolved Hide resolved
# pyopf doesn't seem to work with regular windows paths, but a "UNC dos path" works
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
path_as_str = "\\\\.\\" + str(path.absolute()) if os.name == "nt" else str(path)
self.project = resolve(load(path_as_str))
self.log_as_frames = log_as_frames

@classmethod
Expand Down
Loading