pingmapper 5.0.7__tar.gz → 5.0.9__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.
- {pingmapper-5.0.7 → pingmapper-5.0.9}/PKG-INFO +1 -1
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/class_portstarObj.py +8 -3
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/class_sonObj.py +34 -6
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/funcs_model.py +32 -11
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/gui_main.py +27 -25
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/main_readFiles.py +54 -12
- pingmapper-5.0.9/pingmapper/version.py +1 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper.egg-info/PKG-INFO +1 -1
- pingmapper-5.0.7/pingmapper/version.py +0 -1
- {pingmapper-5.0.7 → pingmapper-5.0.9}/LICENSE +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/README.md +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/__init__.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/__main__.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/class_mapSubstrateObj.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/class_rectObj.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/class_sonObj_nadirgaptest.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/default_params.json +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/funcs_common.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/funcs_rectify.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/main_mapSubstrate.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/main_rectify.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/test_PINGMapper.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper/test_time.py +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper.egg-info/SOURCES.txt +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper.egg-info/dependency_links.txt +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper.egg-info/requires.txt +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/pingmapper.egg-info/top_level.txt +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/setup.cfg +0 -0
- {pingmapper-5.0.7 → pingmapper-5.0.9}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.9
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine, Daniel Buscombe
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -59,9 +59,14 @@ import matplotlib.pyplot as plt
|
|
|
59
59
|
|
|
60
60
|
import inspect
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
from doodleverse_utils.
|
|
64
|
-
from doodleverse_utils.
|
|
62
|
+
try:
|
|
63
|
+
from doodleverse_utils.imports import *
|
|
64
|
+
from doodleverse_utils.model_imports import *
|
|
65
|
+
from doodleverse_utils.prediction_imports import *
|
|
66
|
+
except ImportError:
|
|
67
|
+
print('Could not import Doodleverse Utils. Please install these packages to use PING-Mapper.')
|
|
68
|
+
print('They are not needed for GhostVision. Trying to continue...')
|
|
69
|
+
pass
|
|
65
70
|
|
|
66
71
|
import geopandas as gpd
|
|
67
72
|
|
|
@@ -1301,7 +1301,10 @@ class sonObj(object):
|
|
|
1301
1301
|
|
|
1302
1302
|
# Distance (in meters)
|
|
1303
1303
|
d = sonMeta['trk_dist'].to_numpy()
|
|
1304
|
-
d = np.max(d) - np.min(d)
|
|
1304
|
+
# d = np.max(d) - np.min(d)
|
|
1305
|
+
d = d[-1] - d[0]
|
|
1306
|
+
|
|
1307
|
+
|
|
1305
1308
|
|
|
1306
1309
|
pixM = sonMeta['pixM']
|
|
1307
1310
|
# Find most common pixel size
|
|
@@ -1313,11 +1316,36 @@ class sonObj(object):
|
|
|
1313
1316
|
# Distance in pix
|
|
1314
1317
|
d = round(d / pixM, 0).astype(int)
|
|
1315
1318
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1319
|
+
# to avoid oom errors
|
|
1320
|
+
rows = sonDat.shape[0]
|
|
1321
|
+
new_cols = d # your target width
|
|
1322
|
+
item_size = sonDat.itemsize # bytes per element
|
|
1323
|
+
|
|
1324
|
+
estimated_bytes = rows * new_cols * item_size
|
|
1325
|
+
estimated_MB = estimated_bytes / 1e6
|
|
1326
|
+
|
|
1327
|
+
available_bytes = psutil.virtual_memory().available
|
|
1328
|
+
available_MB = available_bytes / 1e6
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
mem_margin = 0.9
|
|
1332
|
+
safe_limit_MB = available_MB * (1 - mem_margin)
|
|
1333
|
+
|
|
1334
|
+
if d > 0 and estimated_MB < safe_limit_MB and new_cols<65500:
|
|
1335
|
+
sonDat = resize(
|
|
1336
|
+
sonDat,
|
|
1337
|
+
(rows, new_cols),
|
|
1338
|
+
mode='reflect',
|
|
1339
|
+
clip=True,
|
|
1340
|
+
preserve_range=True
|
|
1341
|
+
)
|
|
1342
|
+
if estimated_MB > safe_limit_MB:
|
|
1343
|
+
print(f"Resize skipped for chunk {chunk}: estimated {estimated_MB:.2f} MB exceeds safe limit of {safe_limit_MB:.2f} MB.")
|
|
1344
|
+
# Optionally: fallback to chunked resize or downsampling
|
|
1345
|
+
elif new_cols>65500:
|
|
1346
|
+
print(f"Resize skipped for chunk {chunk}: Maximum supported image dimension is 65500 pixels.")
|
|
1347
|
+
else:
|
|
1348
|
+
print(f"Resize skipped for chunk {chunk}: Vessel did not move.")
|
|
1321
1349
|
|
|
1322
1350
|
else:
|
|
1323
1351
|
sonDat = resize(sonDat,
|
|
@@ -42,22 +42,42 @@ from pingmapper.funcs_common import *
|
|
|
42
42
|
os.environ['TF_CPP_MIN_LOG_LEVEL']='3'
|
|
43
43
|
import json
|
|
44
44
|
import numpy as np
|
|
45
|
-
import tensorflow as tf
|
|
46
|
-
import tensorflow.keras.backend as K
|
|
47
|
-
from tensorflow.python.client import device_lib
|
|
45
|
+
# import tensorflow as tf
|
|
46
|
+
# import tensorflow.keras.backend as K
|
|
47
|
+
# from tensorflow.python.client import device_lib
|
|
48
48
|
|
|
49
49
|
import itertools
|
|
50
50
|
|
|
51
|
-
from transformers import TFSegformerForSemanticSegmentation
|
|
52
|
-
from transformers import logging
|
|
53
|
-
logging.set_verbosity_error()
|
|
51
|
+
# from transformers import TFSegformerForSemanticSegmentation
|
|
52
|
+
# from transformers import logging
|
|
53
|
+
# logging.set_verbosity_error()
|
|
54
54
|
|
|
55
|
-
# Fixes depth detection warning
|
|
56
|
-
tf.get_logger().setLevel('ERROR')
|
|
55
|
+
# # Fixes depth detection warning
|
|
56
|
+
# tf.get_logger().setLevel('ERROR')
|
|
57
57
|
|
|
58
|
-
from doodleverse_utils.imports import *
|
|
59
|
-
from doodleverse_utils.model_imports import *
|
|
60
|
-
from doodleverse_utils.prediction_imports import *
|
|
58
|
+
# from doodleverse_utils.imports import *
|
|
59
|
+
# from doodleverse_utils.model_imports import *
|
|
60
|
+
# from doodleverse_utils.prediction_imports import *
|
|
61
|
+
|
|
62
|
+
try:
|
|
63
|
+
import tensorflow as tf
|
|
64
|
+
import tensorflow.keras.backend as K
|
|
65
|
+
from tensorflow.python.client import device_lib
|
|
66
|
+
|
|
67
|
+
from transformers import TFSegformerForSemanticSegmentation
|
|
68
|
+
from transformers import logging
|
|
69
|
+
logging.set_verbosity_error()
|
|
70
|
+
|
|
71
|
+
# Fixes depth detection warning
|
|
72
|
+
tf.get_logger().setLevel('ERROR')
|
|
73
|
+
|
|
74
|
+
from doodleverse_utils.imports import *
|
|
75
|
+
from doodleverse_utils.model_imports import *
|
|
76
|
+
from doodleverse_utils.prediction_imports import *
|
|
77
|
+
except ImportError:
|
|
78
|
+
print('Could not import Tensorflow and/or Transformers. Please install these packages to use PING-Mapper.')
|
|
79
|
+
print('They are not needed for GhostVision. Trying to continue...')
|
|
80
|
+
pass
|
|
61
81
|
|
|
62
82
|
################################################################################
|
|
63
83
|
# model_imports.py from segmentation_gym #
|
|
@@ -93,6 +113,7 @@ def initModel(weights, configfile, USE_GPU=False):
|
|
|
93
113
|
--------------------
|
|
94
114
|
self._detectDepth()
|
|
95
115
|
'''
|
|
116
|
+
|
|
96
117
|
SEED=42
|
|
97
118
|
np.random.seed(SEED)
|
|
98
119
|
AUTO = tf.data.experimental.AUTOTUNE # used in tf.data.Dataset API
|
|
@@ -10,16 +10,16 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
10
10
|
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
|
|
11
11
|
sys.path.append(PACKAGE_DIR)
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
# For Debug
|
|
14
|
+
from funcs_common import *
|
|
15
|
+
from main_readFiles import read_master_func
|
|
16
|
+
from main_rectify import rectify_master_func
|
|
17
|
+
from main_mapSubstrate import map_master_func
|
|
18
18
|
|
|
19
|
-
from pingmapper.funcs_common import *
|
|
20
|
-
from pingmapper.main_readFiles import read_master_func
|
|
21
|
-
from pingmapper.main_rectify import rectify_master_func
|
|
22
|
-
from pingmapper.main_mapSubstrate import map_master_func
|
|
19
|
+
# from pingmapper.funcs_common import *
|
|
20
|
+
# from pingmapper.main_readFiles import read_master_func
|
|
21
|
+
# from pingmapper.main_rectify import rectify_master_func
|
|
22
|
+
# from pingmapper.main_mapSubstrate import map_master_func
|
|
23
23
|
|
|
24
24
|
import json
|
|
25
25
|
import pandas as pd
|
|
@@ -763,24 +763,26 @@ def gui(batch: bool):
|
|
|
763
763
|
print('\n===========================================')
|
|
764
764
|
print('===========================================')
|
|
765
765
|
print('***** READING *****')
|
|
766
|
-
read_master_func(**params)
|
|
766
|
+
ss_chan_avail = read_master_func(**params)
|
|
767
767
|
# read_master_func(sonFiles, humFile, projDir, t, nchunk, exportUnknown, wcp, wcr, detectDepth, smthDep, adjDep, pltBedPick, threadCnt)
|
|
768
768
|
|
|
769
|
-
if
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
769
|
+
if ss_chan_avail:
|
|
770
|
+
|
|
771
|
+
if rect_wcp or rect_wcr or banklines or coverage or pred_sub or map_sub or export_poly:
|
|
772
|
+
print('\n===========================================')
|
|
773
|
+
print('===========================================')
|
|
774
|
+
print('***** RECTIFYING *****')
|
|
775
|
+
rectify_master_func(**params)
|
|
776
|
+
# rectify_master_func(sonFiles, humFile, projDir, nchunk, rect_wcp, rect_wcr, mosaic, threadCnt)
|
|
777
|
+
|
|
778
|
+
#==================================================
|
|
779
|
+
#==================================================
|
|
780
|
+
if pred_sub or map_sub or export_poly or pltSubClass:
|
|
781
|
+
print('\n===========================================')
|
|
782
|
+
print('===========================================')
|
|
783
|
+
print('***** MAPPING SUBSTRATE *****')
|
|
784
|
+
print("working on "+projDir)
|
|
785
|
+
map_master_func(**params)
|
|
784
786
|
|
|
785
787
|
gc.collect()
|
|
786
788
|
print("\n\nTotal Processing Time: ",datetime.timedelta(seconds = round(time.time() - start_time, ndigits=0)))
|
|
@@ -36,17 +36,23 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
36
36
|
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
|
|
37
37
|
sys.path.append(PACKAGE_DIR)
|
|
38
38
|
|
|
39
|
-
#
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
# For debug
|
|
40
|
+
from funcs_common import *
|
|
41
|
+
from class_sonObj import sonObj
|
|
42
|
+
from class_portstarObj import portstarObj
|
|
43
43
|
|
|
44
|
-
from pingmapper.funcs_common import *
|
|
45
|
-
from pingmapper.class_sonObj import sonObj
|
|
46
|
-
from pingmapper.class_portstarObj import portstarObj
|
|
44
|
+
# from pingmapper.funcs_common import *
|
|
45
|
+
# from pingmapper.class_sonObj import sonObj
|
|
46
|
+
# from pingmapper.class_portstarObj import portstarObj
|
|
47
47
|
|
|
48
48
|
import shutil
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
from doodleverse_utils.imports import *
|
|
52
|
+
except ImportError:
|
|
53
|
+
print('Could not import Doodleverse Utils. Please install these packages to use PING-Mapper.')
|
|
54
|
+
print('They are not needed for GhostVision. Trying to continue...')
|
|
55
|
+
pass
|
|
50
56
|
|
|
51
57
|
from scipy.signal import savgol_filter
|
|
52
58
|
|
|
@@ -413,8 +419,34 @@ def read_master_func(logfilename='',
|
|
|
413
419
|
if son.beamName == 'ss_port' or son.beamName == 'ss_star':
|
|
414
420
|
ss_chan_avail.append(son)
|
|
415
421
|
if len(ss_chan_avail) == 0:
|
|
416
|
-
print('\n\nNo side-scan channels available. Aborting!')
|
|
417
|
-
sys.exit()
|
|
422
|
+
# print('\n\nNo side-scan channels available. Aborting!')
|
|
423
|
+
# sys.exit()
|
|
424
|
+
|
|
425
|
+
print('\n\nNo side-scan channels available!\nUpdating processing parameters as necessary...')
|
|
426
|
+
print('\nFiltering not avaialable...')
|
|
427
|
+
max_heading_deviation = 0
|
|
428
|
+
min_speed = 0
|
|
429
|
+
max_speed = 0
|
|
430
|
+
aoi = ''
|
|
431
|
+
time_table = ''
|
|
432
|
+
|
|
433
|
+
print('\nAuto depth picking not available...')
|
|
434
|
+
detectDep = 0
|
|
435
|
+
pltBedPick = False
|
|
436
|
+
|
|
437
|
+
print('\nShadow removal not available')
|
|
438
|
+
remShadow = 0
|
|
439
|
+
pred_sub = False
|
|
440
|
+
|
|
441
|
+
print('\nEGN not available...')
|
|
442
|
+
egn = False
|
|
443
|
+
|
|
444
|
+
print('\nWCO and WCM not available...')
|
|
445
|
+
wco = False
|
|
446
|
+
wcm = False
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
418
450
|
elif len(ss_chan_avail) == 1:
|
|
419
451
|
print('\n\nMaking copy of {} to ensure PINGMapper compatibility'.format(son.beamName))
|
|
420
452
|
origBeam = son.beamName
|
|
@@ -1015,8 +1047,12 @@ def read_master_func(logfilename='',
|
|
|
1015
1047
|
saveDepth = False
|
|
1016
1048
|
|
|
1017
1049
|
if saveDepth:
|
|
1018
|
-
|
|
1019
|
-
|
|
1050
|
+
|
|
1051
|
+
if ss_chan_avail:
|
|
1052
|
+
# Save detected depth to csv
|
|
1053
|
+
depDF = psObj._saveDepth(chunks, detectDep, smthDep, adjDep, instDepAvail)
|
|
1054
|
+
else:
|
|
1055
|
+
depDF = []
|
|
1020
1056
|
|
|
1021
1057
|
# Store depths in downlooking sonar files also
|
|
1022
1058
|
for son in sonObjs:
|
|
@@ -1495,3 +1531,9 @@ def read_master_func(logfilename='',
|
|
|
1495
1531
|
son._pickleSon()
|
|
1496
1532
|
gc.collect()
|
|
1497
1533
|
printUsage()
|
|
1534
|
+
|
|
1535
|
+
if len(ss_chan_avail) == 0:
|
|
1536
|
+
return False
|
|
1537
|
+
else:
|
|
1538
|
+
return True
|
|
1539
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '5.0.9'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.9
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine, Daniel Buscombe
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '5.0.7'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|