viseda 1.0.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.
- viseda-1.0.0/LICENSE +21 -0
- viseda-1.0.0/PKG-INFO +266 -0
- viseda-1.0.0/README.md +222 -0
- viseda-1.0.0/pyproject.toml +88 -0
- viseda-1.0.0/setup.cfg +4 -0
- viseda-1.0.0/tests/test_smoke.py +135 -0
- viseda-1.0.0/viseda/__init__.py +20 -0
- viseda-1.0.0/viseda/cli.py +144 -0
- viseda-1.0.0/viseda/core/__init__.py +3 -0
- viseda-1.0.0/viseda/core/base.py +69 -0
- viseda-1.0.0/viseda/hyperspectral/__init__.py +1 -0
- viseda-1.0.0/viseda/hyperspectral/eda.py +1849 -0
- viseda-1.0.0/viseda/image/__init__.py +1 -0
- viseda-1.0.0/viseda/image/eda.py +1840 -0
- viseda-1.0.0/viseda/pointcloud/__init__.py +3 -0
- viseda-1.0.0/viseda/pointcloud/eda.py +1167 -0
- viseda-1.0.0/viseda/report/__init__.py +3 -0
- viseda-1.0.0/viseda/report/html_report.py +213 -0
- viseda-1.0.0/viseda/text/__init__.py +3 -0
- viseda-1.0.0/viseda/text/eda.py +1613 -0
- viseda-1.0.0/viseda/utils/__init__.py +27 -0
- viseda-1.0.0/viseda/utils/helpers.py +120 -0
- viseda-1.0.0/viseda/video/__init__.py +3 -0
- viseda-1.0.0/viseda/video/eda.py +587 -0
- viseda-1.0.0/viseda.egg-info/PKG-INFO +266 -0
- viseda-1.0.0/viseda.egg-info/SOURCES.txt +28 -0
- viseda-1.0.0/viseda.egg-info/dependency_links.txt +1 -0
- viseda-1.0.0/viseda.egg-info/entry_points.txt +2 -0
- viseda-1.0.0/viseda.egg-info/requires.txt +25 -0
- viseda-1.0.0/viseda.egg-info/top_level.txt +1 -0
viseda-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 VisEDA Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
viseda-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: viseda
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Visual Exploratory Data Analysis for image, video, hyperspectral, point-cloud, and text/NLP datasets
|
|
5
|
+
Author: Isaac Osei Agyemang, Daniel Acheampong, Adu Asare Baffour, Isaac Adjei-Mensah
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: EDA,exploratory data analysis,image,video,hyperspectral,point cloud,LiDAR,text,NLP,computer vision,remote sensing
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: numpy>=1.23
|
|
23
|
+
Requires-Dist: matplotlib>=3.6
|
|
24
|
+
Requires-Dist: scikit-learn>=1.2
|
|
25
|
+
Requires-Dist: scikit-image>=0.20
|
|
26
|
+
Requires-Dist: opencv-python>=4.7
|
|
27
|
+
Provides-Extra: hyperspectral
|
|
28
|
+
Requires-Dist: scipy>=1.10; extra == "hyperspectral"
|
|
29
|
+
Requires-Dist: spectral>=0.23; extra == "hyperspectral"
|
|
30
|
+
Requires-Dist: rasterio>=1.3; extra == "hyperspectral"
|
|
31
|
+
Provides-Extra: pointcloud
|
|
32
|
+
Requires-Dist: laspy[lazrs]>=2.3; extra == "pointcloud"
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: scipy>=1.10; extra == "all"
|
|
35
|
+
Requires-Dist: spectral>=0.23; extra == "all"
|
|
36
|
+
Requires-Dist: rasterio>=1.3; extra == "all"
|
|
37
|
+
Requires-Dist: laspy[lazrs]>=2.3; extra == "all"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
41
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
42
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# VisEDA — Visual Exploratory Data Analysis
|
|
46
|
+
|
|
47
|
+
VisEDA is a Python toolkit for exploratory data analysis of **image, video,
|
|
48
|
+
hyperspectral, point-cloud, and text/NLP datasets**. It provides numerical
|
|
49
|
+
summaries, dataset-level visualisations, per-sample diagnostics, duplicate or
|
|
50
|
+
similarity analysis where applicable, command-line workflows, and
|
|
51
|
+
self-contained HTML reports.
|
|
52
|
+
|
|
53
|
+
## Modules
|
|
54
|
+
|
|
55
|
+
- **ImageEDA** — spatial, pixel, quality, colour, texture, frequency, duplicate,
|
|
56
|
+
class-balance, and normalisation analysis.
|
|
57
|
+
- **VideoEDA** — spatial, temporal, motion, blur, scene-change, colour, and
|
|
58
|
+
video-similarity analysis.
|
|
59
|
+
- **HyperspectralEDA** — per-band statistics, SNR/noise, spectral quality,
|
|
60
|
+
vegetation/water indices, PCA, false-colour, texture, and spectral-diversity analysis.
|
|
61
|
+
- **PointCloudEDA** — geometry, density, height, duplicate/outlier,
|
|
62
|
+
nearest-neighbour, PCA shape-descriptor, and attribute analysis.
|
|
63
|
+
- **TextEDA** — length, vocabulary, lexical diversity, symbols, readability,
|
|
64
|
+
writing scripts, duplicates, TF-IDF document distances, and label analysis.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install viseda
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Optional file-format support:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# MATLAB/ENVI/GeoTIFF hyperspectral files
|
|
76
|
+
pip install "viseda[hyperspectral]"
|
|
77
|
+
|
|
78
|
+
# LAS/LAZ point clouds
|
|
79
|
+
pip install "viseda[pointcloud]"
|
|
80
|
+
|
|
81
|
+
# All optional file-format dependencies
|
|
82
|
+
pip install "viseda[all]"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Python 3.9 or later is required.
|
|
86
|
+
|
|
87
|
+
## Quick start
|
|
88
|
+
|
|
89
|
+
### ImageEDA
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from viseda import ImageEDA
|
|
93
|
+
|
|
94
|
+
eda = ImageEDA(verbose=True)
|
|
95
|
+
eda.load("path/to/images", label_from_parent=True)
|
|
96
|
+
|
|
97
|
+
summary = eda.summary()
|
|
98
|
+
print(summary["inventory"])
|
|
99
|
+
print(summary["quality"])
|
|
100
|
+
|
|
101
|
+
eda.plot(save_path="image_dashboard.png")
|
|
102
|
+
eda.report("image_report.html")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
In-memory images are supported through `load_arrays()`.
|
|
106
|
+
|
|
107
|
+
### VideoEDA
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from viseda import VideoEDA
|
|
111
|
+
|
|
112
|
+
eda = VideoEDA(verbose=True, frame_sample_rate=5)
|
|
113
|
+
eda.load("path/to/videos", label_from_parent=True)
|
|
114
|
+
|
|
115
|
+
print(eda.summary()["temporal"])
|
|
116
|
+
eda.plot_dataset(save_path="video_dashboard.png")
|
|
117
|
+
eda.report("video_report.html")
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
NumPy video arrays can be loaded with `load_arrays()`.
|
|
121
|
+
|
|
122
|
+
### HyperspectralEDA
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
import numpy as np
|
|
126
|
+
from viseda import HyperspectralEDA
|
|
127
|
+
|
|
128
|
+
cube = np.random.default_rng(0).random((128, 128, 103)).astype("float32")
|
|
129
|
+
wavelengths = np.linspace(400, 1500, cube.shape[2])
|
|
130
|
+
|
|
131
|
+
np.save("scene.npy", cube)
|
|
132
|
+
|
|
133
|
+
eda = HyperspectralEDA(
|
|
134
|
+
wavelengths=wavelengths,
|
|
135
|
+
compute_glcm=False,
|
|
136
|
+
compute_pca=True,
|
|
137
|
+
)
|
|
138
|
+
eda.load("scene.npy")
|
|
139
|
+
|
|
140
|
+
print(eda.summary()["spectral_quality"])
|
|
141
|
+
ndvi = eda.compute_index(cube_index=0, index_name="ndvi")
|
|
142
|
+
scores, variance_ratio = eda.pca_scores(cube_index=0, n_components=3)
|
|
143
|
+
|
|
144
|
+
eda.plot(save_path="hyper_dashboard.png")
|
|
145
|
+
eda.report("hyper_report.html")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The `hyperspectral` extra adds support for MATLAB `.mat`, ENVI, and
|
|
149
|
+
multi-band GeoTIFF files.
|
|
150
|
+
|
|
151
|
+
### PointCloudEDA
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
import numpy as np
|
|
155
|
+
from viseda import PointCloudEDA
|
|
156
|
+
|
|
157
|
+
points = np.random.default_rng(0).random((10000, 3)).astype("float32")
|
|
158
|
+
|
|
159
|
+
eda = PointCloudEDA(
|
|
160
|
+
max_points_per_cloud=200000,
|
|
161
|
+
compute_neighbors=True,
|
|
162
|
+
compute_geometry=True,
|
|
163
|
+
)
|
|
164
|
+
eda.load_arrays([points], labels=["sample"])
|
|
165
|
+
|
|
166
|
+
print(eda.summary()["geometry"])
|
|
167
|
+
eda.plot_dataset(save_path="pointcloud_dashboard.png")
|
|
168
|
+
eda.report("pointcloud_report.html")
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The `pointcloud` extra adds LAS/LAZ support. NPY, NPZ, TXT, CSV, XYZ, PTS,
|
|
172
|
+
and ASCII PLY are supported by the base installation.
|
|
173
|
+
|
|
174
|
+
### TextEDA
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
from viseda import TextEDA
|
|
178
|
+
|
|
179
|
+
eda = TextEDA()
|
|
180
|
+
eda.load_texts(
|
|
181
|
+
[
|
|
182
|
+
"Exploratory data analysis is useful before model training.",
|
|
183
|
+
"TextEDA summarises vocabulary, length, readability and duplicates.",
|
|
184
|
+
],
|
|
185
|
+
labels=["eda", "eda"],
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
print(eda.summary()["lexical"])
|
|
189
|
+
print(eda.vocabulary(top_n=10))
|
|
190
|
+
|
|
191
|
+
eda.plot_dataset(save_path="text_dashboard.png")
|
|
192
|
+
eda.report("text_report.html")
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
TextEDA also loads TXT, Markdown, HTML, CSV, TSV, JSON, JSONL and NDJSON
|
|
196
|
+
datasets through `load()`.
|
|
197
|
+
|
|
198
|
+
## Command line
|
|
199
|
+
|
|
200
|
+
The package installs the `viseda` command:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
viseda --help
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Available subcommands are:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
viseda image ...
|
|
210
|
+
viseda hyper ...
|
|
211
|
+
viseda cloud ...
|
|
212
|
+
viseda video ...
|
|
213
|
+
viseda text ...
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Examples:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
viseda image "C:/datasets/images" --label-from-parent --plot --report image_report.html
|
|
220
|
+
|
|
221
|
+
viseda video "C:/datasets/videos" --label-from-parent --plot --report video_report.html
|
|
222
|
+
|
|
223
|
+
viseda hyper "C:/datasets/hyper" --label-from-parent --plot --dataset-plot \
|
|
224
|
+
--report hyper_report.html
|
|
225
|
+
|
|
226
|
+
viseda cloud "C:/datasets/pointclouds" --label-from-parent --plot \
|
|
227
|
+
--report pointcloud_report.html
|
|
228
|
+
|
|
229
|
+
viseda text "C:/datasets/text" --label-from-parent --plot \
|
|
230
|
+
--report text_report.html
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Use `viseda <subcommand> --help` for the options of a particular modality.
|
|
234
|
+
|
|
235
|
+
## Supported input formats
|
|
236
|
+
|
|
237
|
+
| Module | Main file inputs |
|
|
238
|
+
|---|---|
|
|
239
|
+
| ImageEDA | JPG/JPEG, PNG, BMP, TIFF and other formats accepted by the current image loader |
|
|
240
|
+
| VideoEDA | MP4, AVI, MOV, MKV, WEBM, MPEG/MPG, M4V |
|
|
241
|
+
| HyperspectralEDA | MAT, NPY, NPZ, ENVI HDR/BIL/BIP/BSQ/ENVI, TIF/TIFF |
|
|
242
|
+
| PointCloudEDA | NPY, NPZ, TXT, CSV, XYZ, PTS, ASCII PLY, LAS/LAZ |
|
|
243
|
+
| TextEDA | TXT/TEXT, MD, RST, LOG, HTML/HTM, CSV/TSV, JSON, JSONL/NDJSON |
|
|
244
|
+
|
|
245
|
+
Some file formats require the optional extras described above.
|
|
246
|
+
|
|
247
|
+
## Development
|
|
248
|
+
|
|
249
|
+
Install the project in editable mode with development tools:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
python -m pip install -e ".[dev]"
|
|
253
|
+
pytest
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Build and validate a release:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
python -m pip install --upgrade build twine
|
|
260
|
+
python -m build
|
|
261
|
+
python -m twine check dist/*
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## License
|
|
265
|
+
|
|
266
|
+
MIT. See `LICENSE`.
|
viseda-1.0.0/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# VisEDA — Visual Exploratory Data Analysis
|
|
2
|
+
|
|
3
|
+
VisEDA is a Python toolkit for exploratory data analysis of **image, video,
|
|
4
|
+
hyperspectral, point-cloud, and text/NLP datasets**. It provides numerical
|
|
5
|
+
summaries, dataset-level visualisations, per-sample diagnostics, duplicate or
|
|
6
|
+
similarity analysis where applicable, command-line workflows, and
|
|
7
|
+
self-contained HTML reports.
|
|
8
|
+
|
|
9
|
+
## Modules
|
|
10
|
+
|
|
11
|
+
- **ImageEDA** — spatial, pixel, quality, colour, texture, frequency, duplicate,
|
|
12
|
+
class-balance, and normalisation analysis.
|
|
13
|
+
- **VideoEDA** — spatial, temporal, motion, blur, scene-change, colour, and
|
|
14
|
+
video-similarity analysis.
|
|
15
|
+
- **HyperspectralEDA** — per-band statistics, SNR/noise, spectral quality,
|
|
16
|
+
vegetation/water indices, PCA, false-colour, texture, and spectral-diversity analysis.
|
|
17
|
+
- **PointCloudEDA** — geometry, density, height, duplicate/outlier,
|
|
18
|
+
nearest-neighbour, PCA shape-descriptor, and attribute analysis.
|
|
19
|
+
- **TextEDA** — length, vocabulary, lexical diversity, symbols, readability,
|
|
20
|
+
writing scripts, duplicates, TF-IDF document distances, and label analysis.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install viseda
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Optional file-format support:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# MATLAB/ENVI/GeoTIFF hyperspectral files
|
|
32
|
+
pip install "viseda[hyperspectral]"
|
|
33
|
+
|
|
34
|
+
# LAS/LAZ point clouds
|
|
35
|
+
pip install "viseda[pointcloud]"
|
|
36
|
+
|
|
37
|
+
# All optional file-format dependencies
|
|
38
|
+
pip install "viseda[all]"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Python 3.9 or later is required.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
### ImageEDA
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from viseda import ImageEDA
|
|
49
|
+
|
|
50
|
+
eda = ImageEDA(verbose=True)
|
|
51
|
+
eda.load("path/to/images", label_from_parent=True)
|
|
52
|
+
|
|
53
|
+
summary = eda.summary()
|
|
54
|
+
print(summary["inventory"])
|
|
55
|
+
print(summary["quality"])
|
|
56
|
+
|
|
57
|
+
eda.plot(save_path="image_dashboard.png")
|
|
58
|
+
eda.report("image_report.html")
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
In-memory images are supported through `load_arrays()`.
|
|
62
|
+
|
|
63
|
+
### VideoEDA
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from viseda import VideoEDA
|
|
67
|
+
|
|
68
|
+
eda = VideoEDA(verbose=True, frame_sample_rate=5)
|
|
69
|
+
eda.load("path/to/videos", label_from_parent=True)
|
|
70
|
+
|
|
71
|
+
print(eda.summary()["temporal"])
|
|
72
|
+
eda.plot_dataset(save_path="video_dashboard.png")
|
|
73
|
+
eda.report("video_report.html")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
NumPy video arrays can be loaded with `load_arrays()`.
|
|
77
|
+
|
|
78
|
+
### HyperspectralEDA
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
import numpy as np
|
|
82
|
+
from viseda import HyperspectralEDA
|
|
83
|
+
|
|
84
|
+
cube = np.random.default_rng(0).random((128, 128, 103)).astype("float32")
|
|
85
|
+
wavelengths = np.linspace(400, 1500, cube.shape[2])
|
|
86
|
+
|
|
87
|
+
np.save("scene.npy", cube)
|
|
88
|
+
|
|
89
|
+
eda = HyperspectralEDA(
|
|
90
|
+
wavelengths=wavelengths,
|
|
91
|
+
compute_glcm=False,
|
|
92
|
+
compute_pca=True,
|
|
93
|
+
)
|
|
94
|
+
eda.load("scene.npy")
|
|
95
|
+
|
|
96
|
+
print(eda.summary()["spectral_quality"])
|
|
97
|
+
ndvi = eda.compute_index(cube_index=0, index_name="ndvi")
|
|
98
|
+
scores, variance_ratio = eda.pca_scores(cube_index=0, n_components=3)
|
|
99
|
+
|
|
100
|
+
eda.plot(save_path="hyper_dashboard.png")
|
|
101
|
+
eda.report("hyper_report.html")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The `hyperspectral` extra adds support for MATLAB `.mat`, ENVI, and
|
|
105
|
+
multi-band GeoTIFF files.
|
|
106
|
+
|
|
107
|
+
### PointCloudEDA
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
import numpy as np
|
|
111
|
+
from viseda import PointCloudEDA
|
|
112
|
+
|
|
113
|
+
points = np.random.default_rng(0).random((10000, 3)).astype("float32")
|
|
114
|
+
|
|
115
|
+
eda = PointCloudEDA(
|
|
116
|
+
max_points_per_cloud=200000,
|
|
117
|
+
compute_neighbors=True,
|
|
118
|
+
compute_geometry=True,
|
|
119
|
+
)
|
|
120
|
+
eda.load_arrays([points], labels=["sample"])
|
|
121
|
+
|
|
122
|
+
print(eda.summary()["geometry"])
|
|
123
|
+
eda.plot_dataset(save_path="pointcloud_dashboard.png")
|
|
124
|
+
eda.report("pointcloud_report.html")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The `pointcloud` extra adds LAS/LAZ support. NPY, NPZ, TXT, CSV, XYZ, PTS,
|
|
128
|
+
and ASCII PLY are supported by the base installation.
|
|
129
|
+
|
|
130
|
+
### TextEDA
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from viseda import TextEDA
|
|
134
|
+
|
|
135
|
+
eda = TextEDA()
|
|
136
|
+
eda.load_texts(
|
|
137
|
+
[
|
|
138
|
+
"Exploratory data analysis is useful before model training.",
|
|
139
|
+
"TextEDA summarises vocabulary, length, readability and duplicates.",
|
|
140
|
+
],
|
|
141
|
+
labels=["eda", "eda"],
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
print(eda.summary()["lexical"])
|
|
145
|
+
print(eda.vocabulary(top_n=10))
|
|
146
|
+
|
|
147
|
+
eda.plot_dataset(save_path="text_dashboard.png")
|
|
148
|
+
eda.report("text_report.html")
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
TextEDA also loads TXT, Markdown, HTML, CSV, TSV, JSON, JSONL and NDJSON
|
|
152
|
+
datasets through `load()`.
|
|
153
|
+
|
|
154
|
+
## Command line
|
|
155
|
+
|
|
156
|
+
The package installs the `viseda` command:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
viseda --help
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Available subcommands are:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
viseda image ...
|
|
166
|
+
viseda hyper ...
|
|
167
|
+
viseda cloud ...
|
|
168
|
+
viseda video ...
|
|
169
|
+
viseda text ...
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Examples:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
viseda image "C:/datasets/images" --label-from-parent --plot --report image_report.html
|
|
176
|
+
|
|
177
|
+
viseda video "C:/datasets/videos" --label-from-parent --plot --report video_report.html
|
|
178
|
+
|
|
179
|
+
viseda hyper "C:/datasets/hyper" --label-from-parent --plot --dataset-plot \
|
|
180
|
+
--report hyper_report.html
|
|
181
|
+
|
|
182
|
+
viseda cloud "C:/datasets/pointclouds" --label-from-parent --plot \
|
|
183
|
+
--report pointcloud_report.html
|
|
184
|
+
|
|
185
|
+
viseda text "C:/datasets/text" --label-from-parent --plot \
|
|
186
|
+
--report text_report.html
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Use `viseda <subcommand> --help` for the options of a particular modality.
|
|
190
|
+
|
|
191
|
+
## Supported input formats
|
|
192
|
+
|
|
193
|
+
| Module | Main file inputs |
|
|
194
|
+
|---|---|
|
|
195
|
+
| ImageEDA | JPG/JPEG, PNG, BMP, TIFF and other formats accepted by the current image loader |
|
|
196
|
+
| VideoEDA | MP4, AVI, MOV, MKV, WEBM, MPEG/MPG, M4V |
|
|
197
|
+
| HyperspectralEDA | MAT, NPY, NPZ, ENVI HDR/BIL/BIP/BSQ/ENVI, TIF/TIFF |
|
|
198
|
+
| PointCloudEDA | NPY, NPZ, TXT, CSV, XYZ, PTS, ASCII PLY, LAS/LAZ |
|
|
199
|
+
| TextEDA | TXT/TEXT, MD, RST, LOG, HTML/HTM, CSV/TSV, JSON, JSONL/NDJSON |
|
|
200
|
+
|
|
201
|
+
Some file formats require the optional extras described above.
|
|
202
|
+
|
|
203
|
+
## Development
|
|
204
|
+
|
|
205
|
+
Install the project in editable mode with development tools:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
python -m pip install -e ".[dev]"
|
|
209
|
+
pytest
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Build and validate a release:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
python -m pip install --upgrade build twine
|
|
216
|
+
python -m build
|
|
217
|
+
python -m twine check dist/*
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## License
|
|
221
|
+
|
|
222
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "viseda"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Visual Exploratory Data Analysis for image, video, hyperspectral, point-cloud, and text/NLP datasets"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Isaac Osei Agyemang, Daniel Acheampong, Adu Asare Baffour, Isaac Adjei-Mensah" },
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"EDA",
|
|
18
|
+
"exploratory data analysis",
|
|
19
|
+
"image",
|
|
20
|
+
"video",
|
|
21
|
+
"hyperspectral",
|
|
22
|
+
"point cloud",
|
|
23
|
+
"LiDAR",
|
|
24
|
+
"text",
|
|
25
|
+
"NLP",
|
|
26
|
+
"computer vision",
|
|
27
|
+
"remote sensing",
|
|
28
|
+
]
|
|
29
|
+
classifiers = [
|
|
30
|
+
"Development Status :: 4 - Beta",
|
|
31
|
+
"Intended Audience :: Science/Research",
|
|
32
|
+
"Intended Audience :: Developers",
|
|
33
|
+
"Programming Language :: Python :: 3",
|
|
34
|
+
"Programming Language :: Python :: 3.9",
|
|
35
|
+
"Programming Language :: Python :: 3.10",
|
|
36
|
+
"Programming Language :: Python :: 3.11",
|
|
37
|
+
"Programming Language :: Python :: 3.12",
|
|
38
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
39
|
+
"Topic :: Scientific/Engineering :: Visualization",
|
|
40
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
dependencies = [
|
|
44
|
+
"numpy>=1.23",
|
|
45
|
+
"matplotlib>=3.6",
|
|
46
|
+
"scikit-learn>=1.2",
|
|
47
|
+
"scikit-image>=0.20",
|
|
48
|
+
"opencv-python>=4.7",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[project.optional-dependencies]
|
|
52
|
+
hyperspectral = [
|
|
53
|
+
"scipy>=1.10",
|
|
54
|
+
"spectral>=0.23",
|
|
55
|
+
"rasterio>=1.3",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
pointcloud = [
|
|
59
|
+
"laspy[lazrs]>=2.3",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
all = [
|
|
63
|
+
"scipy>=1.10",
|
|
64
|
+
"spectral>=0.23",
|
|
65
|
+
"rasterio>=1.3",
|
|
66
|
+
"laspy[lazrs]>=2.3",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
dev = [
|
|
70
|
+
"pytest>=7.4",
|
|
71
|
+
"pytest-cov>=4.1",
|
|
72
|
+
"build>=1.0",
|
|
73
|
+
"twine>=5.0",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[project.scripts]
|
|
77
|
+
viseda = "viseda.cli:main"
|
|
78
|
+
|
|
79
|
+
[tool.setuptools]
|
|
80
|
+
include-package-data = false
|
|
81
|
+
|
|
82
|
+
[tool.setuptools.packages.find]
|
|
83
|
+
where = ["."]
|
|
84
|
+
include = ["viseda*"]
|
|
85
|
+
|
|
86
|
+
[tool.pytest.ini_options]
|
|
87
|
+
testpaths = ["tests"]
|
|
88
|
+
addopts = "-q"
|
viseda-1.0.0/setup.cfg
ADDED