seavision-python 0.1.1__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 (78) hide show
  1. seavision_python-0.1.1/PKG-INFO +286 -0
  2. seavision_python-0.1.1/README.md +231 -0
  3. seavision_python-0.1.1/pyproject.toml +94 -0
  4. seavision_python-0.1.1/seavision/__init__.py +3 -0
  5. seavision_python-0.1.1/seavision/defaults.py +38 -0
  6. seavision_python-0.1.1/seavision/edge/__init__.py +38 -0
  7. seavision_python-0.1.1/seavision/edge/bundle.py +189 -0
  8. seavision_python-0.1.1/seavision/edge/capture.py +107 -0
  9. seavision_python-0.1.1/seavision/edge/config.py +219 -0
  10. seavision_python-0.1.1/seavision/edge/postprocess.py +185 -0
  11. seavision_python-0.1.1/seavision/edge/runtime.py +416 -0
  12. seavision_python-0.1.1/seavision/edge/writer.py +167 -0
  13. seavision_python-0.1.1/seavision/engine/__init__.py +52 -0
  14. seavision_python-0.1.1/seavision/engine/detectors/__init__.py +90 -0
  15. seavision_python-0.1.1/seavision/engine/detectors/base.py +179 -0
  16. seavision_python-0.1.1/seavision/engine/detectors/motion/__init__.py +14 -0
  17. seavision_python-0.1.1/seavision/engine/detectors/motion/background.py +92 -0
  18. seavision_python-0.1.1/seavision/engine/detectors/motion/detector.py +218 -0
  19. seavision_python-0.1.1/seavision/engine/detectors/motion/stabiliser.py +174 -0
  20. seavision_python-0.1.1/seavision/engine/detectors/motion/tracker.py +174 -0
  21. seavision_python-0.1.1/seavision/engine/detectors/sam3/__init__.py +23 -0
  22. seavision_python-0.1.1/seavision/engine/detectors/sam3/config.py +309 -0
  23. seavision_python-0.1.1/seavision/engine/detectors/sam3/detector.py +1316 -0
  24. seavision_python-0.1.1/seavision/engine/detectors/sam3/native.py +490 -0
  25. seavision_python-0.1.1/seavision/engine/detectors/yolo/__init__.py +12 -0
  26. seavision_python-0.1.1/seavision/engine/detectors/yolo/config.py +39 -0
  27. seavision_python-0.1.1/seavision/engine/detectors/yolo/detector.py +236 -0
  28. seavision_python-0.1.1/seavision/engine/export/__init__.py +24 -0
  29. seavision_python-0.1.1/seavision/engine/export/config.py +160 -0
  30. seavision_python-0.1.1/seavision/engine/export/exporter.py +286 -0
  31. seavision_python-0.1.1/seavision/engine/export/validation.py +314 -0
  32. seavision_python-0.1.1/seavision/engine/postprocessor.py +738 -0
  33. seavision_python-0.1.1/seavision/engine/source/__init__.py +16 -0
  34. seavision_python-0.1.1/seavision/engine/source/base.py +87 -0
  35. seavision_python-0.1.1/seavision/engine/source/discovery.py +154 -0
  36. seavision_python-0.1.1/seavision/engine/source/local.py +155 -0
  37. seavision_python-0.1.1/seavision/engine/source/s3.py +231 -0
  38. seavision_python-0.1.1/seavision/engine/visualiser/__init__.py +62 -0
  39. seavision_python-0.1.1/seavision/engine/visualiser/annotator.py +382 -0
  40. seavision_python-0.1.1/seavision/engine/visualiser/config.py +127 -0
  41. seavision_python-0.1.1/seavision/engine/visualiser/loader.py +558 -0
  42. seavision_python-0.1.1/seavision/engine/visualiser/visualiser.py +402 -0
  43. seavision_python-0.1.1/seavision/engine/visualiser/writer.py +245 -0
  44. seavision_python-0.1.1/seavision/gui/__init__.py +0 -0
  45. seavision_python-0.1.1/seavision/gui/app.py +30 -0
  46. seavision_python-0.1.1/seavision/gui/main_window.py +891 -0
  47. seavision_python-0.1.1/seavision/gui/shared/__init__.py +0 -0
  48. seavision_python-0.1.1/seavision/gui/shared/conversion.py +55 -0
  49. seavision_python-0.1.1/seavision/gui/shared/session_utils.py +37 -0
  50. seavision_python-0.1.1/seavision/gui/validation/__init__.py +0 -0
  51. seavision_python-0.1.1/seavision/gui/validation/button_styles.py +144 -0
  52. seavision_python-0.1.1/seavision/gui/validation/detection_detail.py +164 -0
  53. seavision_python-0.1.1/seavision/gui/validation/detection_rect_item.py +486 -0
  54. seavision_python-0.1.1/seavision/gui/validation/detection_table.py +563 -0
  55. seavision_python-0.1.1/seavision/gui/validation/interactive_frame_scene.py +340 -0
  56. seavision_python-0.1.1/seavision/gui/validation/interactive_frame_view.py +252 -0
  57. seavision_python-0.1.1/seavision/gui/validation/s3_browser.py +645 -0
  58. seavision_python-0.1.1/seavision/gui/validation/seekable_source.py +262 -0
  59. seavision_python-0.1.1/seavision/gui/validation/session.py +376 -0
  60. seavision_python-0.1.1/seavision/gui/validation/tab.py +2503 -0
  61. seavision_python-0.1.1/seavision/gui/validation/transport_bar.py +172 -0
  62. seavision_python-0.1.1/seavision/gui/validation/validation_model.py +482 -0
  63. seavision_python-0.1.1/seavision/gui/validation/video_cache.py +215 -0
  64. seavision_python-0.1.1/seavision/gui/validation/video_list.py +140 -0
  65. seavision_python-0.1.1/seavision/gui/validation/video_viewer.py +150 -0
  66. seavision_python-0.1.1/seavision/gui/validation/video_worker.py +422 -0
  67. seavision_python-0.1.1/seavision/pipeline.py +856 -0
  68. seavision_python-0.1.1/seavision/resources/default.yaml +139 -0
  69. seavision_python-0.1.1/seavision/run_edge.py +96 -0
  70. seavision_python-0.1.1/seavision/run_export.py +176 -0
  71. seavision_python-0.1.1/seavision/run_pipeline.py +388 -0
  72. seavision_python-0.1.1/seavision_python.egg-info/PKG-INFO +286 -0
  73. seavision_python-0.1.1/seavision_python.egg-info/SOURCES.txt +76 -0
  74. seavision_python-0.1.1/seavision_python.egg-info/dependency_links.txt +1 -0
  75. seavision_python-0.1.1/seavision_python.egg-info/entry_points.txt +5 -0
  76. seavision_python-0.1.1/seavision_python.egg-info/requires.txt +43 -0
  77. seavision_python-0.1.1/seavision_python.egg-info/top_level.txt +1 -0
  78. seavision_python-0.1.1/setup.cfg +4 -0
@@ -0,0 +1,286 @@
1
+ Metadata-Version: 2.4
2
+ Name: seavision-python
3
+ Version: 0.1.1
4
+ Summary: Human-in-the-loop Computer Vision for Marine Environments
5
+ Author: Mario Lambrette
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://github.com/mariolambrette/SeaVision
8
+ Project-URL: Documentation, https://github.com/mariolambrette/SeaVision/tree/Main/docs
9
+ Project-URL: Source, https://github.com/mariolambrette/SeaVision
10
+ Project-URL: Issues, https://github.com/mariolambrette/SeaVision/issues
11
+ Keywords: computer-vision,detection,marine,SAM3
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: numpy<2.0,>=1.21
20
+ Requires-Dist: opencv-python-headless>=4.8
21
+ Requires-Dist: PyYAML>=6.0
22
+ Requires-Dist: tqdm>=4.60
23
+ Provides-Extra: s3
24
+ Requires-Dist: boto3>=1.26; extra == "s3"
25
+ Provides-Extra: gui
26
+ Requires-Dist: boto3>=1.26; extra == "gui"
27
+ Requires-Dist: PySide6<6.9,>=6.5; extra == "gui"
28
+ Requires-Dist: psutil>=5.9; extra == "gui"
29
+ Provides-Extra: edge
30
+ Requires-Dist: onnxruntime>=1.16; extra == "edge"
31
+ Provides-Extra: export
32
+ Requires-Dist: onnxruntime>=1.16; extra == "export"
33
+ Requires-Dist: ultralytics>=8.3.237; extra == "export"
34
+ Provides-Extra: sam3
35
+ Requires-Dist: pillow>=10.0; extra == "sam3"
36
+ Requires-Dist: torch>=2.0; extra == "sam3"
37
+ Requires-Dist: torchvision>=0.20; extra == "sam3"
38
+ Requires-Dist: transformers>=4.47; extra == "sam3"
39
+ Requires-Dist: ultralytics>=8.3.237; extra == "sam3"
40
+ Provides-Extra: all
41
+ Requires-Dist: boto3>=1.26; extra == "all"
42
+ Requires-Dist: onnxruntime>=1.16; extra == "all"
43
+ Requires-Dist: pillow>=10.0; extra == "all"
44
+ Requires-Dist: psutil>=5.9; extra == "all"
45
+ Requires-Dist: PySide6<6.9,>=6.5; extra == "all"
46
+ Requires-Dist: torch>=2.0; extra == "all"
47
+ Requires-Dist: torchvision>=0.20; extra == "all"
48
+ Requires-Dist: transformers>=4.47; extra == "all"
49
+ Requires-Dist: ultralytics>=8.3.237; extra == "all"
50
+ Provides-Extra: dev
51
+ Requires-Dist: build>=1.2; extra == "dev"
52
+ Requires-Dist: pytest>=8.0; extra == "dev"
53
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
54
+ Requires-Dist: twine>=5.1; extra == "dev"
55
+
56
+ <p align="left">
57
+ <img src="https://raw.githubusercontent.com/mariolambrette/SeaVision/Main/assets/seavision_logo.jpg" alt="Logo" width="200"/>
58
+ </p>
59
+
60
+ # SeaVision
61
+
62
+ ## Human-in-the-loop Computer Vision for Marine Environments
63
+
64
+ > [!WARNING]
65
+ > Documentation is currently out of date.
66
+ > The packaging, release, and edge-deployment flows have changed recently, and
67
+ > some instructions in this README and the linked docs may still describe older
68
+ > clone-first or pre-release workflows. Treat the published release artifacts
69
+ > and current CLI behavior as the source of truth until the docs are refreshed.
70
+
71
+ SeaVision offers a practical computer vision workflow for marine monitoring. It supports the development of accurate,
72
+ custom detection models for specific deployment scenarios. The main workflow is:
73
+
74
+ 1. Deploy a generic detector (e.g. motion detection, SAM3-based semantic detection, etc.) on recorded footage.
75
+ 2. Use the provided GUI to validate and refine detections into a training dataset.
76
+ 3. Train a custom YOLO detection model.
77
+ 4. Deploy the trained model on a desktop workstation or edge device with the provided export functionality.
78
+
79
+ If you are new to the project, start with the [Start Here guide](./docs/Start_Here.md).
80
+
81
+ ## Start Here (New Users)
82
+
83
+ If you are not a computer vision specialist, use this short path first:
84
+
85
+ 1. Read the [Start Here guide](./docs/Start_Here.md) for a plain-language workflow and glossary.
86
+ 2. Install SeaVision in GUI mode: `python -m pip install ".[gui]"`.
87
+ 3. Run `seavision-gui` and create a new session with `Ctrl+N`.
88
+ 4. Follow the GUI [Getting Started guide](./docs/gui/Getting%20started.md).
89
+
90
+ ## Installation
91
+
92
+ ### Prerequisites
93
+
94
+ - Python 3.12
95
+ - pip
96
+
97
+ ### Install from a cloned repository
98
+
99
+ Before installing the package, you must currently clone this repository. Run the following in a
100
+ bash terminal:
101
+
102
+ ```bash
103
+ git clone https://github.com/mariolambrette/SeaVision
104
+ cd SeaVision
105
+ ```
106
+
107
+ It is recommended to install SeaVision in a dedicated environment. If you are a [conda](https://www.anaconda.com/docs/getting-started/anaconda/install/overview) user, run
108
+ the following:
109
+
110
+ ```bash
111
+ conda create seavision
112
+ conda activate seavision
113
+ ```
114
+
115
+ You can now install SeaVision using pip:
116
+
117
+ ```bash
118
+ pip install ".[<extras>]"
119
+ ```
120
+
121
+ SeaVision can be installed in various modes, each of which supports different modes of functionality. See below for a full
122
+ description of all installation modes.
123
+
124
+ ### Install Matrix (User Types)
125
+
126
+ Use the install command that matches your use case.
127
+
128
+ | User type | Install command | Primary CLI command(s) |
129
+ |---|---|---|
130
+ | Detection-only users (local videos) | `python -m pip install .` | `seavision` |
131
+ | Detection users with videos in S3 bucket | `python -m pip install ".[s3]"` | `seavision` |
132
+ | GUI users (includes S3 support) | `python -m pip install ".[gui]"` | `seavision-gui` |
133
+ | Edge device operators (runtime only) | `python -m pip install ".[edge]"` | `seavision-edge` |
134
+ | Export users (prepare edge artifacts) | `python -m pip install ".[export]"` | `seavision-export` |
135
+ | Advanced/full users | `python -m pip install ".[all]"` | `seavision`, `seavision-gui`, `seavision-export`, `seavision-edge` |
136
+
137
+ Most users should use either `python -m pip install ".[gui]"` for desktop-only usage or `python -m pip install ".[all]"` if they are
138
+ also likely to use edge deployment functionality. Other installation methods may provide lighter dependencies in specific scenarios.
139
+
140
+ You can verify your installation by running [test commands](#install-verification)
141
+
142
+ ### Development install
143
+
144
+ ```bash
145
+ python -m venv venv
146
+ venv\Scripts\activate.bat
147
+ python -m pip install -e ".[dev]"
148
+ ```
149
+
150
+ For release/distribution policy and compatibility targets, see:
151
+
152
+ - [Distribution and compatibility policy](./docs/release/Distribution_and_Compatibility.md)
153
+
154
+ ### Optional GPU acceleration
155
+
156
+ The above install allows you to run all SeaVision functionality but does not
157
+ provide support for GPU-accelerated processing. Some methods (e.g. SAM3-based
158
+ detection) will be significantly faster if a GPU is available. You will need to
159
+ install GPU-specific dependencies manually based on your hardware.
160
+
161
+ For example, to run on an NVIDIA RTX 5090 GPU with cuda 13 you could install
162
+ the following:
163
+
164
+ ```bash
165
+ pip install torch>=2.9.0 torchvision>=0.20.0 --index-url https://download.pytorch.org/whl/cu130 --force-reinstall
166
+ ```
167
+ You can find more information on PyTorch compatibility
168
+ [here](https://pytorch.org/get-started/locally/).
169
+
170
+ ### AWS S3 Access (Optional)
171
+
172
+ The pipeline supports streaming video directly from AWS. In order to access this
173
+ feature you will need to configure an AWS SSO profile. For more information on
174
+ how to do this and integrate AWS streaming into the SeaVision workflow, see the
175
+ [AWS setup documentation](./docs/AWS_SETUP.md)
176
+
177
+ ## Install verification
178
+
179
+ Run the command that matches your installed mode:
180
+
181
+ ```bash
182
+ # Detection CLI
183
+ seavision --help
184
+
185
+ # GUI
186
+ seavision-gui
187
+
188
+ # Export CLI
189
+ seavision-export --help
190
+
191
+ # Edge CLI
192
+ seavision-edge --help
193
+ ```
194
+
195
+ ## Quick start
196
+
197
+ ### 1. Run the detection pipeline
198
+
199
+ The full detection pipeline can be run with a CLI command, which can optionally be configured
200
+ with a [YAML file](./config/default.yaml)
201
+
202
+ ```bash
203
+ # Local files
204
+ seavision --input ./data/footage/ --output ./results/
205
+
206
+ # With config file
207
+ seavision --config config/default.yaml
208
+ ```
209
+
210
+ ### 2. Launch the GUI
211
+
212
+ ```bash
213
+ seavision-gui
214
+ ```
215
+
216
+ ### 3. Export for edge deployment
217
+
218
+ ```bash
219
+ seavision-export --weights models/fish.pt --output ./deployment --target onnx
220
+ ```
221
+
222
+ ### 4. Run on an edge device
223
+
224
+ ```bash
225
+ seavision-edge --artifact-dir ./deployment/artifact
226
+ ```
227
+
228
+ ## Troubleshooting quick checks
229
+
230
+ | Problem | Likely cause | Quick check | Fix |
231
+ |---|---|---|---|
232
+ | `seavision: command not found` | Package not installed in active environment | `python -m pip show seavision` | Activate the right environment and reinstall using the install matrix |
233
+ | `seavision-gui: command not found` | GUI extra not installed | `python -m pip show PySide6` | `python -m pip install ".[gui]"` |
234
+ | `seavision-edge: command not found` | Edge extra not installed | `python -m pip show onnxruntime` | `python -m pip install ".[edge]"` |
235
+ | Import error for `boto3` when using S3 | S3 dependency missing | `python -m pip show boto3` | `python -m pip install ".[s3]"` or `python -m pip install ".[gui]"` |
236
+ | GUI starts but S3 login fails | AWS credentials/session not configured | `aws sts get-caller-identity` | Run `aws sso login --profile <profile-name>` and retry |
237
+ | Edge run fails at startup validation | Artifact dir incomplete or invalid | `seavision-edge --artifact-dir <path>` output | Re-run `seavision-export` and copy the full artifact directory again |
238
+
239
+ ## Configuration
240
+
241
+ The SeaVision pipeline can be fully customised using YAML config files. For
242
+ a documented example of a config file see the
243
+ [default configuration](./config/default.yaml)
244
+
245
+
246
+ ## Edge Deployment
247
+
248
+ Users may wish to deploy models developed or refined using SeaVision to an edge
249
+ device. Full support is provided for deploying trained model weight files
250
+ (`*.pt`) on Raspberry Pi.
251
+
252
+ Edge deployment creates SeaVision detection files directly on the Pi which may
253
+ save compute time, power and data transfer requirements. Users can optionally
254
+ export periodic validation clips alongside the detections. See below for
255
+ detailed documentation:
256
+
257
+ If you are new to the deployment workflow, use this order:
258
+
259
+ 1. [Edge deployment overview](./docs/edge/README.md)
260
+ 2. [Concepts and Terms](./docs/edge/Concepts%20and%20Terms.md)
261
+ 3. [Prerequisites Checklist](./docs/edge/Prerequisites%20Checklist.md)
262
+ 4. [Operator Quickstart](./docs/edge/Operator%20Quickstart.md)
263
+ 5. [Troubleshooting](./docs/edge/Troubleshooting.md)
264
+
265
+ Use the technical references only when you are preparing the deployment files
266
+ or troubleshooting the package structure:
267
+
268
+ - [Deploy to Raspberry Pi](./docs/edge/Deploy%20to%20Raspberry%20Pi.md)
269
+ - [Troubleshooting](./docs/edge/Troubleshooting.md)
270
+ - [Wheel runtime workflow](./docs/edge/Wheel%20Runtime.md)
271
+ - [Model artifact layout](./docs/edge/Model%20Artifacts.md)
272
+ - [Rollback runbook](./docs/edge/Rollback%20Runbook.md)
273
+
274
+ ## Documentation
275
+
276
+ - [Start Here guide](./docs/Start_Here.md)
277
+ - [Class and API reference](./docs/Class_reference.md)
278
+ - [Architecture and class diagrams](./docs/Class_diagram.md)
279
+ - [AWS setup guide](./docs/AWS_SETUP.md)
280
+ - [Edge deployment docs](./docs/edge/README.md)
281
+ - [GUI docs](./docs/gui/README.md)
282
+
283
+ ## Project Status
284
+
285
+ Note that this project is under active development and features may not yet
286
+ work as intended.
@@ -0,0 +1,231 @@
1
+ <p align="left">
2
+ <img src="https://raw.githubusercontent.com/mariolambrette/SeaVision/Main/assets/seavision_logo.jpg" alt="Logo" width="200"/>
3
+ </p>
4
+
5
+ # SeaVision
6
+
7
+ ## Human-in-the-loop Computer Vision for Marine Environments
8
+
9
+ > [!WARNING]
10
+ > Documentation is currently out of date.
11
+ > The packaging, release, and edge-deployment flows have changed recently, and
12
+ > some instructions in this README and the linked docs may still describe older
13
+ > clone-first or pre-release workflows. Treat the published release artifacts
14
+ > and current CLI behavior as the source of truth until the docs are refreshed.
15
+
16
+ SeaVision offers a practical computer vision workflow for marine monitoring. It supports the development of accurate,
17
+ custom detection models for specific deployment scenarios. The main workflow is:
18
+
19
+ 1. Deploy a generic detector (e.g. motion detection, SAM3-based semantic detection, etc.) on recorded footage.
20
+ 2. Use the provided GUI to validate and refine detections into a training dataset.
21
+ 3. Train a custom YOLO detection model.
22
+ 4. Deploy the trained model on a desktop workstation or edge device with the provided export functionality.
23
+
24
+ If you are new to the project, start with the [Start Here guide](./docs/Start_Here.md).
25
+
26
+ ## Start Here (New Users)
27
+
28
+ If you are not a computer vision specialist, use this short path first:
29
+
30
+ 1. Read the [Start Here guide](./docs/Start_Here.md) for a plain-language workflow and glossary.
31
+ 2. Install SeaVision in GUI mode: `python -m pip install ".[gui]"`.
32
+ 3. Run `seavision-gui` and create a new session with `Ctrl+N`.
33
+ 4. Follow the GUI [Getting Started guide](./docs/gui/Getting%20started.md).
34
+
35
+ ## Installation
36
+
37
+ ### Prerequisites
38
+
39
+ - Python 3.12
40
+ - pip
41
+
42
+ ### Install from a cloned repository
43
+
44
+ Before installing the package, you must currently clone this repository. Run the following in a
45
+ bash terminal:
46
+
47
+ ```bash
48
+ git clone https://github.com/mariolambrette/SeaVision
49
+ cd SeaVision
50
+ ```
51
+
52
+ It is recommended to install SeaVision in a dedicated environment. If you are a [conda](https://www.anaconda.com/docs/getting-started/anaconda/install/overview) user, run
53
+ the following:
54
+
55
+ ```bash
56
+ conda create seavision
57
+ conda activate seavision
58
+ ```
59
+
60
+ You can now install SeaVision using pip:
61
+
62
+ ```bash
63
+ pip install ".[<extras>]"
64
+ ```
65
+
66
+ SeaVision can be installed in various modes, each of which supports different modes of functionality. See below for a full
67
+ description of all installation modes.
68
+
69
+ ### Install Matrix (User Types)
70
+
71
+ Use the install command that matches your use case.
72
+
73
+ | User type | Install command | Primary CLI command(s) |
74
+ |---|---|---|
75
+ | Detection-only users (local videos) | `python -m pip install .` | `seavision` |
76
+ | Detection users with videos in S3 bucket | `python -m pip install ".[s3]"` | `seavision` |
77
+ | GUI users (includes S3 support) | `python -m pip install ".[gui]"` | `seavision-gui` |
78
+ | Edge device operators (runtime only) | `python -m pip install ".[edge]"` | `seavision-edge` |
79
+ | Export users (prepare edge artifacts) | `python -m pip install ".[export]"` | `seavision-export` |
80
+ | Advanced/full users | `python -m pip install ".[all]"` | `seavision`, `seavision-gui`, `seavision-export`, `seavision-edge` |
81
+
82
+ Most users should use either `python -m pip install ".[gui]"` for desktop-only usage or `python -m pip install ".[all]"` if they are
83
+ also likely to use edge deployment functionality. Other installation methods may provide lighter dependencies in specific scenarios.
84
+
85
+ You can verify your installation by running [test commands](#install-verification)
86
+
87
+ ### Development install
88
+
89
+ ```bash
90
+ python -m venv venv
91
+ venv\Scripts\activate.bat
92
+ python -m pip install -e ".[dev]"
93
+ ```
94
+
95
+ For release/distribution policy and compatibility targets, see:
96
+
97
+ - [Distribution and compatibility policy](./docs/release/Distribution_and_Compatibility.md)
98
+
99
+ ### Optional GPU acceleration
100
+
101
+ The above install allows you to run all SeaVision functionality but does not
102
+ provide support for GPU-accelerated processing. Some methods (e.g. SAM3-based
103
+ detection) will be significantly faster if a GPU is available. You will need to
104
+ install GPU-specific dependencies manually based on your hardware.
105
+
106
+ For example, to run on an NVIDIA RTX 5090 GPU with cuda 13 you could install
107
+ the following:
108
+
109
+ ```bash
110
+ pip install torch>=2.9.0 torchvision>=0.20.0 --index-url https://download.pytorch.org/whl/cu130 --force-reinstall
111
+ ```
112
+ You can find more information on PyTorch compatibility
113
+ [here](https://pytorch.org/get-started/locally/).
114
+
115
+ ### AWS S3 Access (Optional)
116
+
117
+ The pipeline supports streaming video directly from AWS. In order to access this
118
+ feature you will need to configure an AWS SSO profile. For more information on
119
+ how to do this and integrate AWS streaming into the SeaVision workflow, see the
120
+ [AWS setup documentation](./docs/AWS_SETUP.md)
121
+
122
+ ## Install verification
123
+
124
+ Run the command that matches your installed mode:
125
+
126
+ ```bash
127
+ # Detection CLI
128
+ seavision --help
129
+
130
+ # GUI
131
+ seavision-gui
132
+
133
+ # Export CLI
134
+ seavision-export --help
135
+
136
+ # Edge CLI
137
+ seavision-edge --help
138
+ ```
139
+
140
+ ## Quick start
141
+
142
+ ### 1. Run the detection pipeline
143
+
144
+ The full detection pipeline can be run with a CLI command, which can optionally be configured
145
+ with a [YAML file](./config/default.yaml)
146
+
147
+ ```bash
148
+ # Local files
149
+ seavision --input ./data/footage/ --output ./results/
150
+
151
+ # With config file
152
+ seavision --config config/default.yaml
153
+ ```
154
+
155
+ ### 2. Launch the GUI
156
+
157
+ ```bash
158
+ seavision-gui
159
+ ```
160
+
161
+ ### 3. Export for edge deployment
162
+
163
+ ```bash
164
+ seavision-export --weights models/fish.pt --output ./deployment --target onnx
165
+ ```
166
+
167
+ ### 4. Run on an edge device
168
+
169
+ ```bash
170
+ seavision-edge --artifact-dir ./deployment/artifact
171
+ ```
172
+
173
+ ## Troubleshooting quick checks
174
+
175
+ | Problem | Likely cause | Quick check | Fix |
176
+ |---|---|---|---|
177
+ | `seavision: command not found` | Package not installed in active environment | `python -m pip show seavision` | Activate the right environment and reinstall using the install matrix |
178
+ | `seavision-gui: command not found` | GUI extra not installed | `python -m pip show PySide6` | `python -m pip install ".[gui]"` |
179
+ | `seavision-edge: command not found` | Edge extra not installed | `python -m pip show onnxruntime` | `python -m pip install ".[edge]"` |
180
+ | Import error for `boto3` when using S3 | S3 dependency missing | `python -m pip show boto3` | `python -m pip install ".[s3]"` or `python -m pip install ".[gui]"` |
181
+ | GUI starts but S3 login fails | AWS credentials/session not configured | `aws sts get-caller-identity` | Run `aws sso login --profile <profile-name>` and retry |
182
+ | Edge run fails at startup validation | Artifact dir incomplete or invalid | `seavision-edge --artifact-dir <path>` output | Re-run `seavision-export` and copy the full artifact directory again |
183
+
184
+ ## Configuration
185
+
186
+ The SeaVision pipeline can be fully customised using YAML config files. For
187
+ a documented example of a config file see the
188
+ [default configuration](./config/default.yaml)
189
+
190
+
191
+ ## Edge Deployment
192
+
193
+ Users may wish to deploy models developed or refined using SeaVision to an edge
194
+ device. Full support is provided for deploying trained model weight files
195
+ (`*.pt`) on Raspberry Pi.
196
+
197
+ Edge deployment creates SeaVision detection files directly on the Pi which may
198
+ save compute time, power and data transfer requirements. Users can optionally
199
+ export periodic validation clips alongside the detections. See below for
200
+ detailed documentation:
201
+
202
+ If you are new to the deployment workflow, use this order:
203
+
204
+ 1. [Edge deployment overview](./docs/edge/README.md)
205
+ 2. [Concepts and Terms](./docs/edge/Concepts%20and%20Terms.md)
206
+ 3. [Prerequisites Checklist](./docs/edge/Prerequisites%20Checklist.md)
207
+ 4. [Operator Quickstart](./docs/edge/Operator%20Quickstart.md)
208
+ 5. [Troubleshooting](./docs/edge/Troubleshooting.md)
209
+
210
+ Use the technical references only when you are preparing the deployment files
211
+ or troubleshooting the package structure:
212
+
213
+ - [Deploy to Raspberry Pi](./docs/edge/Deploy%20to%20Raspberry%20Pi.md)
214
+ - [Troubleshooting](./docs/edge/Troubleshooting.md)
215
+ - [Wheel runtime workflow](./docs/edge/Wheel%20Runtime.md)
216
+ - [Model artifact layout](./docs/edge/Model%20Artifacts.md)
217
+ - [Rollback runbook](./docs/edge/Rollback%20Runbook.md)
218
+
219
+ ## Documentation
220
+
221
+ - [Start Here guide](./docs/Start_Here.md)
222
+ - [Class and API reference](./docs/Class_reference.md)
223
+ - [Architecture and class diagrams](./docs/Class_diagram.md)
224
+ - [AWS setup guide](./docs/AWS_SETUP.md)
225
+ - [Edge deployment docs](./docs/edge/README.md)
226
+ - [GUI docs](./docs/gui/README.md)
227
+
228
+ ## Project Status
229
+
230
+ Note that this project is under active development and features may not yet
231
+ work as intended.
@@ -0,0 +1,94 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "seavision-python"
7
+ version = "0.1.1"
8
+ description = "Human-in-the-loop Computer Vision for Marine Environments"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "Mario Lambrette" }]
12
+ license = { text = "Proprietary" }
13
+ keywords = ["computer-vision", "detection", "marine", "SAM3"]
14
+ classifiers = [
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ ]
21
+ dependencies = [
22
+ "numpy>=1.21,<2.0",
23
+ "opencv-python-headless>=4.8",
24
+ "PyYAML>=6.0",
25
+ "tqdm>=4.60",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/mariolambrette/SeaVision"
30
+ Documentation = "https://github.com/mariolambrette/SeaVision/tree/Main/docs"
31
+ Source = "https://github.com/mariolambrette/SeaVision"
32
+ Issues = "https://github.com/mariolambrette/SeaVision/issues"
33
+
34
+ [project.optional-dependencies]
35
+ # Optional S3 support for pipeline and GUI remote workflows.
36
+ s3 = ["boto3>=1.26"]
37
+
38
+ # GUI mode dependencies.
39
+ gui = [
40
+ "boto3>=1.26",
41
+ "PySide6>=6.5,<6.9",
42
+ "psutil>=5.9",
43
+ ]
44
+
45
+ # Edge runtime dependencies.
46
+ edge = ["onnxruntime>=1.16"]
47
+
48
+ # Land-side model export dependencies.
49
+ export = [
50
+ "onnxruntime>=1.16",
51
+ "ultralytics>=8.3.237",
52
+ ]
53
+
54
+ # SAM3 detector dependencies.
55
+ sam3 = [
56
+ "pillow>=10.0",
57
+ "torch>=2.0",
58
+ "torchvision>=0.20",
59
+ "transformers>=4.47",
60
+ "ultralytics>=8.3.237",
61
+ ]
62
+
63
+ # Combined install for workstations needing all SeaVision features.
64
+ all = [
65
+ "boto3>=1.26",
66
+ "onnxruntime>=1.16",
67
+ "pillow>=10.0",
68
+ "psutil>=5.9",
69
+ "PySide6>=6.5,<6.9",
70
+ "torch>=2.0",
71
+ "torchvision>=0.20",
72
+ "transformers>=4.47",
73
+ "ultralytics>=8.3.237",
74
+ ]
75
+
76
+ # For development in this repo; install with: pip install -e .[dev]
77
+ dev = [
78
+ "build>=1.2",
79
+ "pytest>=8.0",
80
+ "pytest-cov>=5.0",
81
+ "twine>=5.1",
82
+ ]
83
+
84
+ [project.scripts]
85
+ seavision = "seavision.run_pipeline:main"
86
+ seavision-gui = "seavision.gui.app:main"
87
+ seavision-export = "seavision.run_export:main"
88
+ seavision-edge = "seavision.run_edge:main"
89
+
90
+ [tool.setuptools.packages.find]
91
+ include = ["seavision*"]
92
+
93
+ [tool.setuptools.package-data]
94
+ seavision = ["resources/*.yaml"]
@@ -0,0 +1,3 @@
1
+ """SeaVision - Human-in-the-loop Computer Vision for Marine Environments."""
2
+
3
+ __version__ = "0.1.1"
@@ -0,0 +1,38 @@
1
+ """Helpers for packaged default configuration files."""
2
+
3
+ from importlib.resources import files
4
+ from pathlib import Path
5
+
6
+ _DEFAULT_PIPELINE_CONFIG = files("seavision").joinpath("resources/default.yaml")
7
+
8
+ def default_pipeline_config_text() -> str:
9
+ """Return the packaged default pipeline configuration as text."""
10
+ return _DEFAULT_PIPELINE_CONFIG.read_text(encoding="utf-8")
11
+
12
+ def write_default_pipeline_config(
13
+ destination: str | Path,
14
+ overwrite: bool = False,
15
+ ) -> Path:
16
+ """
17
+ Write the packaged default pipeline configuration to a user-selected path.
18
+
19
+ Args:
20
+ destination: Output path for the YAML file.
21
+ overwrite: If True, replace an existing file.
22
+
23
+ Returns:
24
+ The resolved output path.
25
+
26
+ Raises:
27
+ FileExistsError: If the file already exists and overwrite is False.
28
+ """
29
+ output_path = Path(destination)
30
+
31
+ if output_path.exists() and not overwrite:
32
+ raise FileExistsError(
33
+ f"Refusing to overwrite existing file: {output_path}"
34
+ )
35
+
36
+ output_path.parent.mkdir(parents=True, exist_ok=True)
37
+ output_path.write_text(default_pipeline_config_text(), encoding="utf-8")
38
+ return output_path.resolve()
@@ -0,0 +1,38 @@
1
+ """
2
+ SeaVision edge inference runtime.
3
+
4
+ Lightweight inference package for edge devices (Raspberry Pi, Jetson,
5
+ etc.). Runs ONNX models with minimal dependencies — no PyTorch, no
6
+ Ultralytics.
7
+
8
+ Public API:
9
+ - EdgeConfig: Runtime configuration (always importable).
10
+ - EdgeRuntime: Main inference loop (requires onnxruntime at access time).
11
+ - FrameCapture: Video/camera input (requires opencv).
12
+ - EdgeDetectionWriter: CSV output (no special dependencies).
13
+ """
14
+
15
+ from __future__ import annotations
16
+ from typing import TYPE_CHECKING
17
+
18
+ from .config import EdgeConfig
19
+
20
+ if TYPE_CHECKING:
21
+ # Only imported during type checking, not at runtime.
22
+ # Keeps onnxruntime optional on the land-side tooling.
23
+ from .runtime import EdgeRuntime
24
+
25
+ # EdgeRuntime is imported lazily because it depends on onnxruntime,
26
+ # which is only installed on the edge device. This allows the land-side
27
+ # export tooling to import seavision.edge (for EdgeConfig and
28
+ # artifact builders) without requiring onnxruntime.
29
+
30
+
31
+ def __getattr__(name: str):
32
+ if name == "EdgeRuntime":
33
+ from .runtime import EdgeRuntime
34
+ return EdgeRuntime
35
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
36
+
37
+
38
+ __all__ = ["EdgeConfig", "EdgeRuntime"]