geograypher 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. geograypher-0.1.0/LICENSE +28 -0
  2. geograypher-0.1.0/PKG-INFO +62 -0
  3. geograypher-0.1.0/README.md +33 -0
  4. geograypher-0.1.0/geograypher/__init__.py +0 -0
  5. geograypher-0.1.0/geograypher/cameras/__init__.py +3 -0
  6. geograypher-0.1.0/geograypher/cameras/cameras.py +1118 -0
  7. geograypher-0.1.0/geograypher/cameras/derived_cameras.py +257 -0
  8. geograypher-0.1.0/geograypher/cameras/segmentor.py +55 -0
  9. geograypher-0.1.0/geograypher/constants.py +141 -0
  10. geograypher-0.1.0/geograypher/entrypoints/__init__.py +3 -0
  11. geograypher-0.1.0/geograypher/entrypoints/aggregate_images.py +271 -0
  12. geograypher-0.1.0/geograypher/entrypoints/evaluate_predictions.py +50 -0
  13. geograypher-0.1.0/geograypher/entrypoints/label_polygons.py +188 -0
  14. geograypher-0.1.0/geograypher/entrypoints/orthomosaic_predictions.py +133 -0
  15. geograypher-0.1.0/geograypher/entrypoints/project_detections.py +142 -0
  16. geograypher-0.1.0/geograypher/entrypoints/render_labels.py +266 -0
  17. geograypher-0.1.0/geograypher/meshes/__init__.py +1 -0
  18. geograypher-0.1.0/geograypher/meshes/derived_meshes.py +516 -0
  19. geograypher-0.1.0/geograypher/meshes/meshes.py +2112 -0
  20. geograypher-0.1.0/geograypher/predictors/__init__.py +5 -0
  21. geograypher-0.1.0/geograypher/predictors/derived_segmentors.py +257 -0
  22. geograypher-0.1.0/geograypher/predictors/ortho_segmentor.py +372 -0
  23. geograypher-0.1.0/geograypher/predictors/segmentor.py +69 -0
  24. geograypher-0.1.0/geograypher/utils/__init__.py +0 -0
  25. geograypher-0.1.0/geograypher/utils/example_data.py +112 -0
  26. geograypher-0.1.0/geograypher/utils/files.py +28 -0
  27. geograypher-0.1.0/geograypher/utils/geometric.py +104 -0
  28. geograypher-0.1.0/geograypher/utils/geospatial.py +361 -0
  29. geograypher-0.1.0/geograypher/utils/image.py +21 -0
  30. geograypher-0.1.0/geograypher/utils/indexing.py +53 -0
  31. geograypher-0.1.0/geograypher/utils/io.py +35 -0
  32. geograypher-0.1.0/geograypher/utils/numeric.py +157 -0
  33. geograypher-0.1.0/geograypher/utils/parsing.py +96 -0
  34. geograypher-0.1.0/geograypher/utils/prediction_metrics.py +335 -0
  35. geograypher-0.1.0/geograypher/utils/visualization.py +244 -0
  36. geograypher-0.1.0/pyproject.toml +38 -0
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Open Forest Observatory
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.1
2
+ Name: geograypher
3
+ Version: 0.1.0
4
+ Summary:
5
+ Author: David Russell
6
+ Author-email: davidrussell327@gmail.com
7
+ Requires-Python: >=3.9,<3.12
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Requires-Dist: cchardet (>=2.1.7,<3.0.0)
13
+ Requires-Dist: chardet (>=5.2.0,<6.0.0)
14
+ Requires-Dist: geopandas (>=0.14.2,<0.15.0)
15
+ Requires-Dist: ipykernel (>=6.26.0,<7.0.0)
16
+ Requires-Dist: ipywidgets (>=8.1.1,<9.0.0)
17
+ Requires-Dist: piexif (>=1.1.3,<2.0.0)
18
+ Requires-Dist: pyvista (>=0.42.2,<0.43.0)
19
+ Requires-Dist: rasterstats (>=0.19.0,<0.20.0)
20
+ Requires-Dist: scikit-image (>=0.21.0,<0.22.0)
21
+ Requires-Dist: scikit-learn (>=1.4.0,<2.0.0)
22
+ Requires-Dist: tqdm (>=4.66.2,<5.0.0)
23
+ Requires-Dist: trame (>=3.2.8,<4.0.0)
24
+ Requires-Dist: trame-vtk (>=2.8.0,<3.0.0)
25
+ Requires-Dist: trame-vuetify (>=2.4.2,<3.0.0)
26
+ Requires-Dist: ubelt (>=1.3.5,<2.0.0)
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Geograypher: Multiview Semantic Reasoning with Geospatial Data
30
+ [![DOI](https://zenodo.org/badge/644076369.svg)](https://zenodo.org/doi/10.5281/zenodo.11193026)
31
+
32
+ This tool is designed for multiview image datasets where multiple photos are taken of the same scene. The goal is to address two related tasks: generating a prediction about one point in the real world using observations of that point from multiple viewpoints and locating where a point in the real world is observed in each image. The intended application is drone surveys for ecology but the tool is designed to be generalizable.
33
+
34
+ In drone surveys, multiple overlapping images are taken of a region. A common technique to align these images is using photogrammetry software such as the commercially-available Agisoft Metashape or open-source COLMAP. This project only supports Metashape at the moment, but we plan to expand to other software. We use two outputs from photogrammetry, the location and calibration parameters of the cameras and a 3D "mesh" model of the environment. Using techniques from graphics, we can find the correspondences between locations on the mesh and on the image.
35
+
36
+ One task that this can support is multiview classification. For example, if you have a computer vision model that generates land cover classifications (for example trees, shrubs, grasses, and bare earth) for each pixel in an image, these predictions can be transferred to the mesh. Then, the predictions for each viewpoint can be aggregated using a voting or averaging scheme to come up with a final land cover prediction for that location. The other task is effectively the reverse. If you have the data from the field, for example marking one geospatial region as shrubs and another as grasses, you can determine which portions of each image corresponds to these classes. This information can be used to train a computer vision model, that could be used in the first step.
37
+
38
+ ### Documentation
39
+ Documentation of this tool, including how to set it up and examples of how to use it, can be found [here](https://open-forest-observatory.github.io/geograypher/).
40
+
41
+ ### Running
42
+
43
+ There are currently two main 3D workflows that this tool supports, rendering and aggregation. The goal of rendering is to take data that is associated with a mesh or geospatially referenced and translate it to the viewpoint of each image. An example of this is exporting the height above ground or species classification for each point on an image. The goal of aggregation is to take information from each viewpoint and aggregate it onto a mesh and optionally export it as a geospatial file. An example of this is taking species or veg-cover type predictions from each viewpoints and aggregating them onto the mesh.
44
+
45
+ It also provides functionality for making predictions on top-down orthomosaics. This is not the main focus of the tool but is intended as a strong baseline or for applications where only this data is available.
46
+
47
+ There is one script for each of these workflows. They each have a variety of command line options that can be used to control the behavior. But in either case, they can be run without any flags to produce an example result. To see the options, run either script with the `-h` flag as seen below.
48
+
49
+ ```
50
+ conda activate geograypher
51
+ python geograypher/entrypoints/render_labels.py --help
52
+ python geograypher/entrypoints/aggregate_viewpoints.py --help
53
+ python geograypher/entrypoints/orthomosaic_predictions.py --help
54
+ ```
55
+
56
+ Quality metrics can be computed using the evaluation script
57
+
58
+ ```
59
+ conda activate geograypher
60
+ python geograypher/entrypoints/evaluate_predictions.py --help
61
+ ```
62
+
@@ -0,0 +1,33 @@
1
+ # Geograypher: Multiview Semantic Reasoning with Geospatial Data
2
+ [![DOI](https://zenodo.org/badge/644076369.svg)](https://zenodo.org/doi/10.5281/zenodo.11193026)
3
+
4
+ This tool is designed for multiview image datasets where multiple photos are taken of the same scene. The goal is to address two related tasks: generating a prediction about one point in the real world using observations of that point from multiple viewpoints and locating where a point in the real world is observed in each image. The intended application is drone surveys for ecology but the tool is designed to be generalizable.
5
+
6
+ In drone surveys, multiple overlapping images are taken of a region. A common technique to align these images is using photogrammetry software such as the commercially-available Agisoft Metashape or open-source COLMAP. This project only supports Metashape at the moment, but we plan to expand to other software. We use two outputs from photogrammetry, the location and calibration parameters of the cameras and a 3D "mesh" model of the environment. Using techniques from graphics, we can find the correspondences between locations on the mesh and on the image.
7
+
8
+ One task that this can support is multiview classification. For example, if you have a computer vision model that generates land cover classifications (for example trees, shrubs, grasses, and bare earth) for each pixel in an image, these predictions can be transferred to the mesh. Then, the predictions for each viewpoint can be aggregated using a voting or averaging scheme to come up with a final land cover prediction for that location. The other task is effectively the reverse. If you have the data from the field, for example marking one geospatial region as shrubs and another as grasses, you can determine which portions of each image corresponds to these classes. This information can be used to train a computer vision model, that could be used in the first step.
9
+
10
+ ### Documentation
11
+ Documentation of this tool, including how to set it up and examples of how to use it, can be found [here](https://open-forest-observatory.github.io/geograypher/).
12
+
13
+ ### Running
14
+
15
+ There are currently two main 3D workflows that this tool supports, rendering and aggregation. The goal of rendering is to take data that is associated with a mesh or geospatially referenced and translate it to the viewpoint of each image. An example of this is exporting the height above ground or species classification for each point on an image. The goal of aggregation is to take information from each viewpoint and aggregate it onto a mesh and optionally export it as a geospatial file. An example of this is taking species or veg-cover type predictions from each viewpoints and aggregating them onto the mesh.
16
+
17
+ It also provides functionality for making predictions on top-down orthomosaics. This is not the main focus of the tool but is intended as a strong baseline or for applications where only this data is available.
18
+
19
+ There is one script for each of these workflows. They each have a variety of command line options that can be used to control the behavior. But in either case, they can be run without any flags to produce an example result. To see the options, run either script with the `-h` flag as seen below.
20
+
21
+ ```
22
+ conda activate geograypher
23
+ python geograypher/entrypoints/render_labels.py --help
24
+ python geograypher/entrypoints/aggregate_viewpoints.py --help
25
+ python geograypher/entrypoints/orthomosaic_predictions.py --help
26
+ ```
27
+
28
+ Quality metrics can be computed using the evaluation script
29
+
30
+ ```
31
+ conda activate geograypher
32
+ python geograypher/entrypoints/evaluate_predictions.py --help
33
+ ```
File without changes
@@ -0,0 +1,3 @@
1
+ from geograypher.cameras.cameras import PhotogrammetryCamera, PhotogrammetryCameraSet
2
+ from geograypher.cameras.derived_cameras import MetashapeCameraSet
3
+ from geograypher.cameras.segmentor import SegmentorPhotogrammetryCameraSet