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

Windows Support (#735) #795

Closed
wants to merge 2 commits into from
Closed

Conversation

YanNoun
Copy link
Member

@YanNoun YanNoun commented Sep 14, 2021

Summary:
Hello ✋

This PR gets OpenSfM to compile and run on Windows!

The main points that have been addressed:

  • Rewrote the memory functions in context.py to work on all three platforms (Windows, Mac, Linux). This adds a new small dependency (vmem).
  • Added a bin/opensfm.bat script for invoking the program.
  • Some minor compilation issues related to Visual Studio are addressed. The definition of M_PI is a bit.. hackish, but the alternative is to include:
#define _USE_MATH_DEFINES
#include <cmath>

In a lot of places where M_PI is referenced. I'm not sure that's better (but I can change it if you want). I'm also unsure of what side effects the _USE_MATH_DEFINES macro might do. 💣

  • Updated the docs with build instructions for Windows.
  • Installs opencv-python as a pip dependency on Windows only; this is because vcpkg builds of OpenCV don't provide a version with OpenCV's Python bindings. This only affects Windows environments (it won't install on Mac or Linux).

I hope this can be useful to others.

Pull Request resolved: #735

Differential Revision: D29959025

Pulled By: YanNoun

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D29959025

@YanNoun
Copy link
Member Author

YanNoun commented Sep 15, 2021

@pierotofy we're on the verge of merging it. What's the purpose of the opencv-python==4.5.1.48 ; sys_platform == "win32" in the requirements ?

@pierotofy
Copy link
Contributor

pierotofy commented Sep 15, 2021

The OpenCV python bindings (import cv2) are not included in vcpkg, so they need to be installed separately.

If we don't want to explicitly include this in the requirements.txt, we can always just add an install step in the docs to tell people to install opencv-python separately on Windows.

YanNoun pushed a commit to YanNoun/OpenSfM that referenced this pull request Sep 20, 2021
Summary:
Pull Request resolved: mapillary#795

Hello ✋

This PR gets OpenSfM to compile and run on Windows!

The main points that have been addressed:
 - [x] Rewrote the memory functions in `context.py` to work on all three platforms (Windows, Mac, Linux). This adds a new small dependency (`vmem`).
 - [x] Added a `bin/opensfm.bat` script for invoking the program.
 - [x] Some minor compilation issues related to Visual Studio are addressed. The definition of `M_PI` is a bit.. hackish, but the alternative is to include:

```
#define _USE_MATH_DEFINES
#include <cmath>
```

In a lot of places where M_PI is referenced. I'm not sure that's better (but I can change it if you want). I'm also unsure of what side effects the `_USE_MATH_DEFINES` macro might do. 💣

 - [x] Updated the docs with build instructions for Windows.
 - [x] Installs `opencv-python` as a pip dependency on Windows only; this is because vcpkg builds of OpenCV don't provide a version with OpenCV's Python bindings. This only affects Windows environments (it won't install on Mac or Linux).

I hope this can be useful to others.

Pull Request resolved: mapillary#735

Reviewed By: paulinus

Differential Revision: D29959025

Pulled By: YanNoun

fbshipit-source-id: df5f3a8701552f44e35b89657f3a68101214ce2f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D29959025

ynoutary and others added 2 commits September 20, 2021 06:51
Summary:
This Diff adds the ability to set the GCPs default horizontal and vertical accuracy from the `config.yaml`

We also added the corresponding check in the incremental reconstruction test.

Differential Revision: D30963281

fbshipit-source-id: d77b952f689ce87120eef5187077b694ce414bcf
Summary:
Pull Request resolved: mapillary#795

Hello ✋

This PR gets OpenSfM to compile and run on Windows!

The main points that have been addressed:
 - [x] Rewrote the memory functions in `context.py` to work on all three platforms (Windows, Mac, Linux). This adds a new small dependency (`vmem`).
 - [x] Added a `bin/opensfm.bat` script for invoking the program.
 - [x] Some minor compilation issues related to Visual Studio are addressed. The definition of `M_PI` is a bit.. hackish, but the alternative is to include:

```
#define _USE_MATH_DEFINES
#include <cmath>
```

In a lot of places where M_PI is referenced. I'm not sure that's better (but I can change it if you want). I'm also unsure of what side effects the `_USE_MATH_DEFINES` macro might do. 💣

 - [x] Updated the docs with build instructions for Windows.
 - [x] Installs `opencv-python` as a pip dependency on Windows only; this is because vcpkg builds of OpenCV don't provide a version with OpenCV's Python bindings. This only affects Windows environments (it won't install on Mac or Linux).

I hope this can be useful to others.

Pull Request resolved: mapillary#735

Reviewed By: paulinus

Differential Revision: D29959025

Pulled By: YanNoun

fbshipit-source-id: b79e2c7355200d86b01eb8504169a03034fda7a6
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D29959025

@facebook-github-bot
Copy link
Contributor

@YanNoun merged this pull request in 13b0b65.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants