[doc] added section about local build on macos in README.md, updated docs, updated changelog
Browse files- README.md +29 -1
- docs/Changelog.md +7 -0
- docs/conf.py +14 -3
- docs/samgis_core.prediction_api.rst +11 -3
- docs/samgis_core.utilities.rst +8 -0
- samgis/__version__.py +1 -1
README.md
CHANGED
|
@@ -113,6 +113,33 @@ URL=http://localhost:7860/infer_samgis
|
|
| 113 |
curl -d@./events/payload_point_eolie.json -H 'content-type: application/json' ${URL}
|
| 114 |
```
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
### Tests
|
| 117 |
|
| 118 |
Tests are defined in the `tests` folder in this project. Use PIP to install the test dependencies and run tests.
|
|
@@ -130,7 +157,8 @@ Run the command from the project root:
|
|
| 130 |
|
| 131 |
```bash
|
| 132 |
# missing docs folder (run from project root) initialize this way
|
| 133 |
-
|
|
|
|
| 134 |
|
| 135 |
# update docs folder (from project root)
|
| 136 |
sphinx-apidoc -f -o docs samgis
|
|
|
|
| 113 |
curl -d@./events/payload_point_eolie.json -H 'content-type: application/json' ${URL}
|
| 114 |
```
|
| 115 |
|
| 116 |
+
#### Local execution on MacOS
|
| 117 |
+
|
| 118 |
+
There is a known issue running the project on MacOS. SamGIS still work also without executing it within a docker container, but is slower during image embedding because of a memory leak caused by CoreML. Here a log about this bug:
|
| 119 |
+
|
| 120 |
+
```less
|
| 121 |
+
[...]
|
| 122 |
+
2024-05-15T18:38:37.478698+0200 - INFO - predictors.py - samexporter_predict - (be2506dc-0887-4752-9889-cf12db7501f5) missing instance model mobile_sam, instantiating it now!
|
| 123 |
+
2024-05-15T18:38:37.479582+0200 - INFO - sam_onnx2.py - __init__ - (be2506dc-0887-4752-9889-cf12db7501f5) Available providers for ONNXRuntime: %s
|
| 124 |
+
2024-05-15 18:38:37.673229 [W:onnxruntime:, coreml_execution_provider.cc:81 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 104 number of nodes in the graph: 566 number of nodes supported by CoreML: 383
|
| 125 |
+
Context leak detected, CoreAnalytics returned false
|
| 126 |
+
Context leak detected, CoreAnalytics returned false
|
| 127 |
+
Context leak detected, CoreAnalytics returned false
|
| 128 |
+
Context leak detected, CoreAnalytics returned false
|
| 129 |
+
Context leak detected, CoreAnalytics returned false
|
| 130 |
+
Context leak detected, CoreAnalytics returned false
|
| 131 |
+
2024-05-15T18:38:47.691608+0200 - INFO - sam_onnx2.py - __init__ - (be2506dc-0887-4752-9889-cf12db7501f5) encoder_input_name:
|
| 132 |
+
2024-05-15 18:38:47.913677 [W:onnxruntime:, coreml_execution_provider.cc:81 GetCapability] CoreMLExecutionProvider::GetCapability, number of partitions supported by CoreML: 48 number of nodes in the graph: 496 number of nodes supported by CoreML: 221
|
| 133 |
+
Context leak detected, CoreAnalytics returned false
|
| 134 |
+
Context leak detected, CoreAnalytics returned false
|
| 135 |
+
Context leak detected, CoreAnalytics returned false
|
| 136 |
+
Context leak detected, CoreAnalytics returned false
|
| 137 |
+
2024-05-15T18:38:50.926801+0200 - DEBUG - predictors.py - samexporter_predict - (be2506dc-0887-4752-9889-cf12db7501f5) using a mobile_sam instance model...
|
| 138 |
+
[...]
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
This problem doesn't rise if running it within the docker container.
|
| 142 |
+
|
| 143 |
### Tests
|
| 144 |
|
| 145 |
Tests are defined in the `tests` folder in this project. Use PIP to install the test dependencies and run tests.
|
|
|
|
| 157 |
|
| 158 |
```bash
|
| 159 |
# missing docs folder (run from project root) initialize this way
|
| 160 |
+
#
|
| 161 |
+
cd docs && sphinx-quickstart --project SamGIS --release 1.0.0 --language python --master index
|
| 162 |
|
| 163 |
# update docs folder (from project root)
|
| 164 |
sphinx-apidoc -f -o docs samgis
|
docs/Changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
| 1 |
# Changelog
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
## Version 1.5.0
|
| 4 |
|
| 5 |
- now it's possible to download tmp images from /vis_output routes if WRITE_TMP_ON_DISK env variable exists (it's the output folder path)
|
|
|
|
| 1 |
# Changelog
|
| 2 |
|
| 3 |
+
## Version 1.5.1
|
| 4 |
+
|
| 5 |
+
- samgis_core: now support onnxruntime 1.17.x and later
|
| 6 |
+
- samgis_core: remove opencv-python dependency, now SegmentAnythingONNX2 resize images using PIL
|
| 7 |
+
- samgis_core: bump to version 2.0.0 to remark a breaking change: passage from SegmentAnythingONNX to SegmentAnythingONNX2
|
| 8 |
+
- known issue: on MacOS, samgis still work without executing it within a docker container, but it's slower during image embedding because of a memory leak caused by CoreML
|
| 9 |
+
|
| 10 |
## Version 1.5.0
|
| 11 |
|
| 12 |
- now it's possible to download tmp images from /vis_output routes if WRITE_TMP_ON_DISK env variable exists (it's the output folder path)
|
docs/conf.py
CHANGED
|
@@ -7,16 +7,27 @@
|
|
| 7 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
| 8 |
import os
|
| 9 |
import sys
|
|
|
|
|
|
|
| 10 |
|
| 11 |
project = 'SamGIS'
|
| 12 |
-
copyright = '2023-now, alessandro trinca tornidor'
|
| 13 |
-
author = 'alessandro trinca tornidor'
|
| 14 |
-
release = '1.3.0'
|
| 15 |
|
| 16 |
# -- General configuration ---------------------------------------------------
|
| 17 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
| 18 |
sys.path.insert(0, os.path.abspath('..'))
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
extensions = [
|
| 21 |
'sphinx.ext.autodoc',
|
| 22 |
'sphinx.ext.viewcode',
|
|
|
|
| 7 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
| 8 |
import os
|
| 9 |
import sys
|
| 10 |
+
import tomllib
|
| 11 |
+
|
| 12 |
|
| 13 |
project = 'SamGIS'
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# -- General configuration ---------------------------------------------------
|
| 16 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
| 17 |
sys.path.insert(0, os.path.abspath('..'))
|
| 18 |
|
| 19 |
+
# Pull general sphinx project info from pyproject.toml
|
| 20 |
+
# Modified from https://stackoverflow.com/a/75396624/1304076
|
| 21 |
+
with open("../pyproject.toml", "rb") as f:
|
| 22 |
+
toml = tomllib.load(f)
|
| 23 |
+
|
| 24 |
+
pyproject = toml["tool"]["poetry"]
|
| 25 |
+
version = pyproject["version"]
|
| 26 |
+
release = version
|
| 27 |
+
authors_list = [author for author in pyproject["authors"]]
|
| 28 |
+
author = ", ".join(authors_list) if len(authors_list) > 1 else authors_list[0]
|
| 29 |
+
copyright = f"2023-now {author}"
|
| 30 |
+
|
| 31 |
extensions = [
|
| 32 |
'sphinx.ext.autodoc',
|
| 33 |
'sphinx.ext.viewcode',
|
docs/samgis_core.prediction_api.rst
CHANGED
|
@@ -4,10 +4,18 @@ samgis\_core.prediction\_api package
|
|
| 4 |
Submodules
|
| 5 |
----------
|
| 6 |
|
| 7 |
-
samgis\_core.prediction\_api.sam\
|
| 8 |
-
|
| 9 |
|
| 10 |
-
.. automodule:: samgis_core.prediction_api.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
:members:
|
| 12 |
:undoc-members:
|
| 13 |
:show-inheritance:
|
|
|
|
| 4 |
Submodules
|
| 5 |
----------
|
| 6 |
|
| 7 |
+
samgis\_core.prediction\_api.sam\_onnx2 module
|
| 8 |
+
----------------------------------------------
|
| 9 |
|
| 10 |
+
.. automodule:: samgis_core.prediction_api.sam_onnx2
|
| 11 |
+
:members:
|
| 12 |
+
:undoc-members:
|
| 13 |
+
:show-inheritance:
|
| 14 |
+
|
| 15 |
+
samgis\_core.prediction\_api.sam\_onnx\_inference module
|
| 16 |
+
--------------------------------------------------------
|
| 17 |
+
|
| 18 |
+
.. automodule:: samgis_core.prediction_api.sam_onnx_inference
|
| 19 |
:members:
|
| 20 |
:undoc-members:
|
| 21 |
:show-inheritance:
|
docs/samgis_core.utilities.rst
CHANGED
|
@@ -20,6 +20,14 @@ samgis\_core.utilities.fastapi\_logger module
|
|
| 20 |
:undoc-members:
|
| 21 |
:show-inheritance:
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
samgis\_core.utilities.serialize module
|
| 24 |
---------------------------------------
|
| 25 |
|
|
|
|
| 20 |
:undoc-members:
|
| 21 |
:show-inheritance:
|
| 22 |
|
| 23 |
+
samgis\_core.utilities.plot\_images module
|
| 24 |
+
------------------------------------------
|
| 25 |
+
|
| 26 |
+
.. automodule:: samgis_core.utilities.plot_images
|
| 27 |
+
:members:
|
| 28 |
+
:undoc-members:
|
| 29 |
+
:show-inheritance:
|
| 30 |
+
|
| 31 |
samgis\_core.utilities.serialize module
|
| 32 |
---------------------------------------
|
| 33 |
|
samgis/__version__.py
CHANGED
|
@@ -5,4 +5,4 @@ try:
|
|
| 5 |
__version__ = importlib.metadata.version(__package__ or __name__)
|
| 6 |
except importlib.metadata.PackageNotFoundError or ImportError as e:
|
| 7 |
print(f"metadata::e: {type(e)}, {e}: package installed?")
|
| 8 |
-
__version__ = "1.
|
|
|
|
| 5 |
__version__ = importlib.metadata.version(__package__ or __name__)
|
| 6 |
except importlib.metadata.PackageNotFoundError or ImportError as e:
|
| 7 |
print(f"metadata::e: {type(e)}, {e}: package installed?")
|
| 8 |
+
__version__ = "1.5.1"
|