You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-30Lines changed: 47 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ Dependencies installation
29
29
-[GCC](https://gcc.gnu.org) v7.3.0 GNU compiler for `C++`.
30
30
-[UCL/GreatCMakeCookOff](https://github.com/UCL/GreatCMakeCookOff) Collection of `CMake` recipes. Downloaded automatically if absent.
31
31
-[OpenMP](http://openmp.org/wp/) v4.8.4 (Trusty) - Optional - Speeds up some of the operations.
32
+
-[Cppflow](https://github.com/UCL/cppflow) - Optional - A warpper for the Tensorflow C API allowing us to read Tensorflow models into SOPT. Needed if you are using a learned prior.
32
33
-[Conan](https://docs.conan.io/en/latest/installation.html) - C++ package manager which installs the following:
33
34
-[Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) v3.2.0 (Trusty) Modern `C++` linear algebra. Downloaded automatically if absent.
34
35
-[spdlog](https://github.com/gabime/spdlog) v* - Optional - Logging library. Downloaded automatically if
@@ -42,45 +43,61 @@ Dependencies installation
42
43
Installing and building SOPT
43
44
----------------------------
44
45
45
-
You can build **SOPT** entirely from the source code. Once the mandatory dependencies are present, `git clone` from the [GitHub repository](https://github.com/astro-informatics/sopt):
46
+
You can build **SOPT** entirely from the source code.
// Convert model output in a std::vector into a sopt::Image (2D Eigen::Array)
40
87
Eigen::Map<Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>> convert_tensor_to_image(std::vector<float> model_output, int image_rows, int image_cols){
41
88
// convert tensor of floats to Eigen::Array of doubles
Copy file name to clipboardExpand all lines: cpp/sopt/cppflow_utils.h
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,17 @@
5
5
#include"sopt/types.h"
6
6
#include<cppflow/cppflow.h>
7
7
#include"cppflow/ops.h"
8
+
#include<complex>
8
9
9
10
namespacesopt {
10
11
namespacecppflowutils {
12
+
11
13
//! Converts a sopt::Image to a cppflow::tensor
12
14
cppflow::tensor convert_image_to_tensor(sopt::Image<double> const &image, int image_rows, int image_cols);
15
+
cppflow::tensor convert_image_to_tensor(sopt::Image<std::complex<double>> const &image, int image_rows, int image_cols);
13
16
//! Converts a sopt::Vector to a cppflow::tensor
14
17
cppflow::tensor convert_image_to_tensor(sopt::Vector<double> const &image, int image_rows, int image_cols);
18
+
cppflow::tensor convert_image_to_tensor(sopt::Vector<std::complex<double>> const &image, int image_rows, int image_cols);
15
19
16
20
//! Convert a cppflow:tensor to an Eigen::Array
17
21
Eigen::Map<Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>> convert_tensor_to_image(std::vector<float> model_output, int image_rows, int image_cols);
0 commit comments