rockmapper 1.0.0a1__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.
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: rockmapper
3
+ Version: 1.0.0a1
4
+ Summary: Interface for predicting and mapping benthic habitat (substrates) from any side-scan sonar mosaic.
5
+ Author: Cameron Bodine, Wyatt Wolfenkoehler
6
+ Author-email: bodine.cs@gmail.email
7
+ Project-URL: Issues, https://github.com/PINGEcosystem/RockMapper/issues
8
+ Project-URL: GitHub, https://github.com/PINGEcosystem/RockMapper
9
+ Keywords: pingmapper,sonar,ecology,remotesensing,sidescan,sidescan-sonar,aquatic,humminbird,lowrance,gis,oceanography,limnology
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Classifier: Topic :: Scientific/Engineering :: Visualization
16
+ Classifier: Topic :: Scientific/Engineering :: Oceanography
17
+ Classifier: Topic :: Scientific/Engineering :: GIS
18
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
19
+ Requires-Python: <3.13
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: pinginstaller
22
+ Requires-Dist: pingwizard
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: keywords
29
+ Dynamic: project-url
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # RockMapper
35
+
36
+ # 🚧**UNDER CONSTRUCTION**🚧
37
+
38
+ [![PyPI - Version](https://img.shields.io/pypi/v/rockmapper?style=flat-square&label=Latest%20Version%20(PyPi))](https://pypi.org/project/rockmapper/)
39
+ [![GitHub last commit](https://img.shields.io/github/last-commit/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/commits)
40
+ [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/commits)
41
+ [![GitHub](https://img.shields.io/github/license/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/blob/main/LICENSE)
42
+
43
+
44
+ Interface for predicting and mapping benthic habitat (substrates) from any side-scan sonar mosaic.
45
+
46
+ ## Overview
47
+
48
+ `RockMapper` is an open-source Python interface for automatically predicting and mapping substrate types from and side-scan sonar mosaic(s). `RockMapper` leverages SegFormer pre-trained models fine-tuned with [Segmentation Gym](https://github.com/Doodleverse/segmentation_gym) to automatically predict Paddlefish spawning habitat (manuscript forthcoming).
49
+
50
+ ## Published Documentation
51
+
52
+ ### Journal Article
53
+
54
+ Wolfenkoehler, Bodine, Long (*forthcoming...*)
55
+
56
+ ## Installation
57
+
58
+ 1. Install [`Miniforge`](https://conda-forge.org/download/).
59
+ 2. Open the [`Miniforge`](https://conda-forge.org/download/) prompt.
60
+ 3. Install `PINGInstaller`:
61
+ ```
62
+ pip install pinginstaller
63
+ ```
64
+ 4. Install `RockMapper`.
65
+ ```
66
+ python -m pinginstaller rockmapper
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ 1. Copy the following script to some location on your computer:
72
+
73
+ ```python
74
+
75
+
76
+ '''
77
+ Copyright (c) 2025 Cameron S. Bodine
78
+ '''
79
+
80
+ #########
81
+ # Imports
82
+ import os, sys
83
+ import time, datetime
84
+
85
+ start_time = time.time()
86
+
87
+ # Set ROCKMAPPER utils dir
88
+ USER_DIR = os.path.expanduser('~')
89
+ GV_UTILS_DIR = os.path.join(USER_DIR, '.rockmapper')
90
+ if not os.path.exists(GV_UTILS_DIR):
91
+ os.makedirs(GV_UTILS_DIR)
92
+
93
+ def gui():
94
+ '''
95
+ '''
96
+
97
+ #################
98
+ # NEED TO ADD GUI
99
+
100
+
101
+ # FOR DEVELOPMENT
102
+ #############################
103
+ # Update Parameters
104
+ seg_model = 'RockMapper_20250628_v1' # Don't update
105
+ inDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\mosaics'
106
+ mosaicFileType = '.tif'
107
+ outDirTop = r'Z:\scratch'
108
+ projName = 'RockMapperTest'
109
+ mapRast = False
110
+ mapShp = True
111
+
112
+ epsg = 32616
113
+
114
+ windowSize_m = (18, 18)
115
+ window_stride = 9
116
+ minArea_percent = 0.75
117
+ threadCnt = 0.25
118
+
119
+ predBatchSize = 30
120
+
121
+ deleteIntData = True
122
+
123
+
124
+ ################
125
+ # Run HabiMapper
126
+
127
+ modelDir = os.path.join(GV_UTILS_DIR, 'models')
128
+
129
+ # RockMapper
130
+ if seg_model == 'RockMapper_20250628_v1':
131
+ from rockmapper.rock_mapper import do_work
132
+
133
+ modelDir = os.path.join(modelDir, seg_model)
134
+
135
+
136
+ print('\n\nMapping habitat with ROCKMAPPER model...\n\n')
137
+ do_work(
138
+ inDir = inDir,
139
+ outDirTop = outDirTop,
140
+ projName = projName,
141
+ mapRast = mapRast,
142
+ mapShp = mapShp,
143
+ epsg = epsg,
144
+ windowSize_m = windowSize_m,
145
+ window_stride = window_stride,
146
+ minArea_percent = minArea_percent,
147
+ threadCnt = threadCnt,
148
+ mosaicFileType=mosaicFileType,
149
+ modelDir=modelDir,
150
+ predBatchSize=predBatchSize,
151
+ deleteIntData=deleteIntData
152
+ )
153
+
154
+
155
+
156
+
157
+
158
+ print("\n\nGrand Total Processing Time: ", datetime.timedelta(seconds = round(time.time() - start_time, ndigits=0)))
159
+ return
160
+ ```
161
+
162
+ 2. Open the file with [Visual Studio Code](https://code.visualstudio.com/).
163
+ 3. Update the Parameters as necessary:
164
+
165
+ ```python
166
+ # Update Parameters
167
+ seg_model = 'RockMapper_20250628_v1' # Don't update
168
+ inDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\mosaics'
169
+ mosaicFileType = '.tif'
170
+ outDirTop = r'Z:\scratch'
171
+ projName = 'RockMapperTest'
172
+ mapRast = False
173
+ mapShp = True
174
+
175
+ epsg = 32616
176
+
177
+ windowSize_m = (18, 18)
178
+ window_stride = 9
179
+ minArea_percent = 0.75
180
+ threadCnt = 0.25
181
+
182
+ predBatchSize = 30
183
+
184
+ deleteIntData = True
185
+ ```
186
+
187
+ 4. Ensure the `rockmapper` environment is selected as the Interpreter [see this](https://stackoverflow.com/a/76289404).
188
+ 5. Run the script in debug mode by pressing `F5`.
@@ -0,0 +1,155 @@
1
+ # RockMapper
2
+
3
+ # 🚧**UNDER CONSTRUCTION**🚧
4
+
5
+ [![PyPI - Version](https://img.shields.io/pypi/v/rockmapper?style=flat-square&label=Latest%20Version%20(PyPi))](https://pypi.org/project/rockmapper/)
6
+ [![GitHub last commit](https://img.shields.io/github/last-commit/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/commits)
7
+ [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/commits)
8
+ [![GitHub](https://img.shields.io/github/license/PINGEcosystem/GhostVision)](https://github.com/PINGEcosystem/GhostVision/blob/main/LICENSE)
9
+
10
+
11
+ Interface for predicting and mapping benthic habitat (substrates) from any side-scan sonar mosaic.
12
+
13
+ ## Overview
14
+
15
+ `RockMapper` is an open-source Python interface for automatically predicting and mapping substrate types from and side-scan sonar mosaic(s). `RockMapper` leverages SegFormer pre-trained models fine-tuned with [Segmentation Gym](https://github.com/Doodleverse/segmentation_gym) to automatically predict Paddlefish spawning habitat (manuscript forthcoming).
16
+
17
+ ## Published Documentation
18
+
19
+ ### Journal Article
20
+
21
+ Wolfenkoehler, Bodine, Long (*forthcoming...*)
22
+
23
+ ## Installation
24
+
25
+ 1. Install [`Miniforge`](https://conda-forge.org/download/).
26
+ 2. Open the [`Miniforge`](https://conda-forge.org/download/) prompt.
27
+ 3. Install `PINGInstaller`:
28
+ ```
29
+ pip install pinginstaller
30
+ ```
31
+ 4. Install `RockMapper`.
32
+ ```
33
+ python -m pinginstaller rockmapper
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ 1. Copy the following script to some location on your computer:
39
+
40
+ ```python
41
+
42
+
43
+ '''
44
+ Copyright (c) 2025 Cameron S. Bodine
45
+ '''
46
+
47
+ #########
48
+ # Imports
49
+ import os, sys
50
+ import time, datetime
51
+
52
+ start_time = time.time()
53
+
54
+ # Set ROCKMAPPER utils dir
55
+ USER_DIR = os.path.expanduser('~')
56
+ GV_UTILS_DIR = os.path.join(USER_DIR, '.rockmapper')
57
+ if not os.path.exists(GV_UTILS_DIR):
58
+ os.makedirs(GV_UTILS_DIR)
59
+
60
+ def gui():
61
+ '''
62
+ '''
63
+
64
+ #################
65
+ # NEED TO ADD GUI
66
+
67
+
68
+ # FOR DEVELOPMENT
69
+ #############################
70
+ # Update Parameters
71
+ seg_model = 'RockMapper_20250628_v1' # Don't update
72
+ inDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\mosaics'
73
+ mosaicFileType = '.tif'
74
+ outDirTop = r'Z:\scratch'
75
+ projName = 'RockMapperTest'
76
+ mapRast = False
77
+ mapShp = True
78
+
79
+ epsg = 32616
80
+
81
+ windowSize_m = (18, 18)
82
+ window_stride = 9
83
+ minArea_percent = 0.75
84
+ threadCnt = 0.25
85
+
86
+ predBatchSize = 30
87
+
88
+ deleteIntData = True
89
+
90
+
91
+ ################
92
+ # Run HabiMapper
93
+
94
+ modelDir = os.path.join(GV_UTILS_DIR, 'models')
95
+
96
+ # RockMapper
97
+ if seg_model == 'RockMapper_20250628_v1':
98
+ from rockmapper.rock_mapper import do_work
99
+
100
+ modelDir = os.path.join(modelDir, seg_model)
101
+
102
+
103
+ print('\n\nMapping habitat with ROCKMAPPER model...\n\n')
104
+ do_work(
105
+ inDir = inDir,
106
+ outDirTop = outDirTop,
107
+ projName = projName,
108
+ mapRast = mapRast,
109
+ mapShp = mapShp,
110
+ epsg = epsg,
111
+ windowSize_m = windowSize_m,
112
+ window_stride = window_stride,
113
+ minArea_percent = minArea_percent,
114
+ threadCnt = threadCnt,
115
+ mosaicFileType=mosaicFileType,
116
+ modelDir=modelDir,
117
+ predBatchSize=predBatchSize,
118
+ deleteIntData=deleteIntData
119
+ )
120
+
121
+
122
+
123
+
124
+
125
+ print("\n\nGrand Total Processing Time: ", datetime.timedelta(seconds = round(time.time() - start_time, ndigits=0)))
126
+ return
127
+ ```
128
+
129
+ 2. Open the file with [Visual Studio Code](https://code.visualstudio.com/).
130
+ 3. Update the Parameters as necessary:
131
+
132
+ ```python
133
+ # Update Parameters
134
+ seg_model = 'RockMapper_20250628_v1' # Don't update
135
+ inDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\mosaics'
136
+ mosaicFileType = '.tif'
137
+ outDirTop = r'Z:\scratch'
138
+ projName = 'RockMapperTest'
139
+ mapRast = False
140
+ mapShp = True
141
+
142
+ epsg = 32616
143
+
144
+ windowSize_m = (18, 18)
145
+ window_stride = 9
146
+ minArea_percent = 0.75
147
+ threadCnt = 0.25
148
+
149
+ predBatchSize = 30
150
+
151
+ deleteIntData = True
152
+ ```
153
+
154
+ 4. Ensure the `rockmapper` environment is selected as the Interpreter [see this](https://stackoverflow.com/a/76289404).
155
+ 5. Run the script in debug mode by pressing `F5`.
@@ -0,0 +1 @@
1
+ from .version import __version__
@@ -0,0 +1,46 @@
1
+ '''
2
+ Copyright (c) 2025 Cameron S. Bodine
3
+ '''
4
+
5
+ #########
6
+ # Imports
7
+ import os, sys
8
+
9
+ # Add 'rockmapper' to the path, may not need after pypi package...
10
+ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
11
+ PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
12
+ sys.path.append(PACKAGE_DIR)
13
+
14
+ # Set GHOSTVISION utils dir
15
+ USER_DIR = os.path.expanduser('~')
16
+ GV_UTILS_DIR = os.path.join(USER_DIR, '.rockmapper')
17
+ if not os.path.exists(GV_UTILS_DIR):
18
+ os.makedirs(GV_UTILS_DIR)
19
+
20
+ # Default function to run
21
+ if len(sys.argv) == 1:
22
+ to_do = 'gui'
23
+ else:
24
+ to_do = sys.argv[1]
25
+
26
+ #=======================================================================
27
+ def main(process):
28
+ '''
29
+ '''
30
+
31
+ from rockmapper.version import __version__
32
+ print("\n\nRockMapper v{}".format(__version__))
33
+
34
+ # Launch GUI
35
+ if process == 'gui':
36
+ print('\n\nLaunching RockMapper gui...\n\n')
37
+
38
+ from rockmapper.gui_main import gui
39
+ gui()
40
+
41
+ return
42
+
43
+ #=======================================================================
44
+ if __name__ == "__main__":
45
+ main(to_do)
46
+
@@ -0,0 +1,88 @@
1
+
2
+ '''
3
+ Copyright (c) 2025 Cameron S. Bodine
4
+ '''
5
+
6
+ #########
7
+ # Imports
8
+ import os, sys
9
+ import time, datetime
10
+
11
+ start_time = time.time()
12
+
13
+ # Set ROCKMAPPER utils dir
14
+ USER_DIR = os.path.expanduser('~')
15
+ GV_UTILS_DIR = os.path.join(USER_DIR, '.rockmapper')
16
+ if not os.path.exists(GV_UTILS_DIR):
17
+ os.makedirs(GV_UTILS_DIR)
18
+
19
+ def gui():
20
+ '''
21
+ '''
22
+
23
+ #################
24
+ # NEED TO ADD GUI
25
+
26
+
27
+ # FOR DEVELOPMENT
28
+ #############################
29
+ # Hard coding for development
30
+ seg_model = 'RockMapper_20250628_v1'
31
+ inDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\mosaics'
32
+ # modelDir = r'Z:\scratch\202506_BrushyDeepKiamichi_Substrate\seg_gym\20250628_test\fold_0\RockMapper'
33
+ # inDir = r'Z:\scratch\USGS-CERC_2025\00_carp_group_targets\Mosaics'
34
+ # modelDir = r'D:\redbo_science\projects\USGS-CERC_2025\seg_gym\20250710_v01\fold_0'
35
+ mosaicFileType = '.tif'
36
+ outDirTop = r'Z:\scratch'
37
+ projName = 'RockMapperTest'
38
+ mapRast = False
39
+ mapShp = True
40
+
41
+ epsg = 32616
42
+
43
+ windowSize_m = (18, 18)
44
+ window_stride = 9
45
+ minArea_percent = 0.75
46
+ threadCnt = 0.25
47
+
48
+ predBatchSize = 30
49
+
50
+ deleteIntData = True
51
+
52
+
53
+ ################
54
+ # Run HabiMapper
55
+
56
+ modelDir = os.path.join(GV_UTILS_DIR, 'models')
57
+
58
+ # RockMapper
59
+ if seg_model == 'RockMapper_20250628_v1':
60
+ from rockmapper.rock_mapper import do_work
61
+
62
+ modelDir = os.path.join(modelDir, seg_model)
63
+
64
+
65
+ print('\n\nMapping habitat with ROCKMAPPER model...\n\n')
66
+ do_work(
67
+ inDir = inDir,
68
+ outDirTop = outDirTop,
69
+ projName = projName,
70
+ mapRast = mapRast,
71
+ mapShp = mapShp,
72
+ epsg = epsg,
73
+ windowSize_m = windowSize_m,
74
+ window_stride = window_stride,
75
+ minArea_percent = minArea_percent,
76
+ threadCnt = threadCnt,
77
+ mosaicFileType=mosaicFileType,
78
+ modelDir=modelDir,
79
+ predBatchSize=predBatchSize,
80
+ deleteIntData=deleteIntData
81
+ )
82
+
83
+
84
+
85
+
86
+
87
+ print("\n\nGrand Total Processing Time: ", datetime.timedelta(seconds = round(time.time() - start_time, ndigits=0)))
88
+ return