sinapsis-data-visualization 0.1.14__tar.gz → 1.0.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.
- sinapsis_data_visualization-1.0.1/LICENSE-APACHE +202 -0
- sinapsis_data_visualization-1.0.1/LICENSE-MIT +21 -0
- sinapsis_data_visualization-1.0.1/PKG-INFO +141 -0
- sinapsis_data_visualization-1.0.1/README.md +118 -0
- sinapsis_data_visualization-1.0.1/pyproject.toml +97 -0
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/annotation_drawer_tools.py +8 -31
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/color_utils.py +2 -3
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/detection_utils.py +1 -1
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/plot_distributions.py +2 -6
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/scikit_pca_analysis.py +1 -1
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/base_annotation_drawer.py +4 -4
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/base_visualization_template.py +7 -14
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/bbox_drawer.py +4 -12
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/data_distribution_visualization.py +2 -1
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/key_points_drawer.py +5 -13
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/label_drawer.py +8 -26
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/oriented_bbox_drawer.py +5 -17
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/segmentation_mask_drawer.py +4 -11
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/tabular_data_visualization.py +2 -1
- sinapsis_data_visualization-1.0.1/uv.lock +859 -0
- sinapsis_data_visualization-0.1.14/LICENSE +0 -661
- sinapsis_data_visualization-0.1.14/PKG-INFO +0 -197
- sinapsis_data_visualization-0.1.14/README.md +0 -176
- sinapsis_data_visualization-0.1.14/pyproject.toml +0 -36
- sinapsis_data_visualization-0.1.14/setup.cfg +0 -4
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization/__init__.py +0 -0
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization/helpers/__init__.py +0 -0
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization.egg-info/PKG-INFO +0 -197
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization.egg-info/SOURCES.txt +0 -28
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization.egg-info/dependency_links.txt +0 -1
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization.egg-info/requires.txt +0 -9
- sinapsis_data_visualization-0.1.14/src/sinapsis_data_visualization.egg-info/top_level.txt +0 -2
- {sinapsis_data_visualization-0.1.14/src → sinapsis_data_visualization-1.0.1/src/sinapsis_data_visualization/helpers}/__init__.py +0 -0
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/annotation_drawer_types.py +0 -0
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/helpers/tags.py +0 -0
- {sinapsis_data_visualization-0.1.14 → sinapsis_data_visualization-1.0.1}/src/sinapsis_data_visualization/templates/__init__.py +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sinapsis Group Limited
|
|
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.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sinapsis-data-visualization
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Templates to perform visualization of data distributions and image annotations.
|
|
5
|
+
Project-URL: Homepage, https://sinapsis.tech
|
|
6
|
+
Project-URL: Documentation, https://docs.sinapsis.tech/docs
|
|
7
|
+
Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
|
|
8
|
+
Project-URL: Repository, https://github.com/SinapsisHub/sinapsis-hub.git
|
|
9
|
+
Author-email: Ariel Ruiz-Garcia <ariel@sinapsis.tech>
|
|
10
|
+
Maintainer-email: sinapsis <dev@sinapsis.tech>
|
|
11
|
+
License-Expression: MIT OR Apache-2.0
|
|
12
|
+
License-File: LICENSE-APACHE
|
|
13
|
+
License-File: LICENSE-MIT
|
|
14
|
+
Requires-Python: >=3.13
|
|
15
|
+
Requires-Dist: numpy==1.26.4
|
|
16
|
+
Requires-Dist: pandas>=2.2.3
|
|
17
|
+
Requires-Dist: sinapsis<2,>=1
|
|
18
|
+
Provides-Extra: all
|
|
19
|
+
Requires-Dist: matplotlib>=3.9.2; extra == 'all'
|
|
20
|
+
Provides-Extra: visualization-matplotlib
|
|
21
|
+
Requires-Dist: matplotlib>=3.9.2; extra == 'visualization-matplotlib'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
<h1 align="center">
|
|
25
|
+
<br>
|
|
26
|
+
<a href="https://sinapsis.tech/">
|
|
27
|
+
<img
|
|
28
|
+
src="https://github.com/SinapsisHub/brand-resources/blob/main/public/logo/sinapsis-logo-horizontal-dark-brand.png?raw=true"
|
|
29
|
+
alt="Sinapsis"
|
|
30
|
+
width="300">
|
|
31
|
+
</a>
|
|
32
|
+
<br>
|
|
33
|
+
Sinapsis Data-Visualization
|
|
34
|
+
<br>
|
|
35
|
+
</h1>
|
|
36
|
+
|
|
37
|
+
<h3 align="center">Visualise packet content, annotations and distributions.</h3>
|
|
38
|
+
|
|
39
|
+
## Overview
|
|
40
|
+
|
|
41
|
+
**`sinapsis-data-visualization`** — Templates to perform visualization of data distributions and image annotations.
|
|
42
|
+
|
|
43
|
+
Model outputs need inspection: boxes, labels and data distributions help developers and operators understand what an Agent produced. Visualization Templates keep that work inside the graph rather than in ad hoc notebook code.
|
|
44
|
+
|
|
45
|
+
### Where it fits
|
|
46
|
+
|
|
47
|
+
Rendering is a separate step from inference. The `visualization-matplotlib` extra is useful when plots are needed; avoid drawing every frame in performance-sensitive pipelines unless required.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
Requires **Python 3.13 or later**, as declared in this package’s manifest. Install the base distribution using your preferred package manager:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv pip install sinapsis-data-visualization
|
|
55
|
+
# or
|
|
56
|
+
pip install sinapsis-data-visualization
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Optional features and dependencies
|
|
60
|
+
|
|
61
|
+
The base installation includes the dependencies required by the package. The following **extras** are declared in this package’s `pyproject.toml`; install only those needed by your workflow. They are standard Python optional dependencies, not separate execution profiles.
|
|
62
|
+
|
|
63
|
+
| Extra | Adds / when to select it |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `visualization-matplotlib` | Matplotlib-based rendering and plots. **Dependencies:** `matplotlib` |
|
|
66
|
+
| `all` | Bundle declared by this package; its manifest includes `visualization-matplotlib`. |
|
|
67
|
+
|
|
68
|
+
For example:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv pip install "sinapsis-data-visualization[visualization-matplotlib]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The manifest also defines development-only dependency groups: `dev` (`pre-commit`, `ruff`, `ty`). These support source development and testing and are **not** runtime extras.
|
|
75
|
+
|
|
76
|
+
<h2 id="features">🚀 Features</h2>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
For example, for ***BBoxDrawer*** use ```sinx templates example-config BBoxDrawer``` to produce the following example config:
|
|
80
|
+
<details id='packages'><summary><strong><span style="font-size: 1.0em;"> Config</span></strong></summary>
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
agent:
|
|
84
|
+
name: my_annotation_preview_agent
|
|
85
|
+
description: Draw existing image annotations for inspection
|
|
86
|
+
templates:
|
|
87
|
+
- template_name: InputTemplate
|
|
88
|
+
class_name: InputTemplate
|
|
89
|
+
attributes: {}
|
|
90
|
+
- template_name: FolderImageDatasetCV2
|
|
91
|
+
class_name: FolderImageDatasetCV2
|
|
92
|
+
template_input: InputTemplate
|
|
93
|
+
attributes:
|
|
94
|
+
data_dir: '/path/to/sinapsis/cache/dir'
|
|
95
|
+
pattern: '**/*'
|
|
96
|
+
batch_size: 1
|
|
97
|
+
shuffle_data: false
|
|
98
|
+
samples_to_load: -1
|
|
99
|
+
load_on_init: false
|
|
100
|
+
label_path_index: -2
|
|
101
|
+
is_ground_truth: false
|
|
102
|
+
- template_name: BBoxDrawer
|
|
103
|
+
class_name: BBoxDrawer
|
|
104
|
+
template_input: FolderImageDatasetCV2
|
|
105
|
+
attributes:
|
|
106
|
+
overwrite: false
|
|
107
|
+
randomized_color: true
|
|
108
|
+
draw_confidence: true
|
|
109
|
+
draw_extra_labels: true
|
|
110
|
+
text_style:
|
|
111
|
+
font: 0
|
|
112
|
+
font_scale: 0.5
|
|
113
|
+
thickness: 2
|
|
114
|
+
draw_classification_label: false
|
|
115
|
+
classification_label_position: top_right
|
|
116
|
+
text_box_to_border_offset: 0.01
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Template discovery and examples
|
|
121
|
+
|
|
122
|
+
The package exposes Template implementations including `BBoxDrawer`, `OrientedBBoxDrawer`, `KeyPointsDrawer`, `SegmentationMaskDrawer`, `TabularDataVisualization`, `DataDistributionVisualization`.
|
|
123
|
+
|
|
124
|
+
Inspect the installed environment for the exact classes and validated attributes, then generate a starter configuration:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
sinx templates show-all
|
|
128
|
+
sinx templates example-config TabularDataVisualization
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Visualisation operates on existing annotations or tabular data in the input packets. The illustrated `BBoxDrawer` assumes image annotations are already present; a folder reader alone will not generate bounding boxes.
|
|
132
|
+
|
|
133
|
+
## Documentation
|
|
134
|
+
|
|
135
|
+
- [Sinapsis documentation](https://docs.sinapsis.tech/)
|
|
136
|
+
- [Tutorials and examples](https://docs.sinapsis.tech/docs/latest/tutorials)
|
|
137
|
+
- [Sinapsis website](https://sinapsis.tech/)
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Sinapsis open-source components are available under your choice of the [MIT License](LICENSE-MIT) or the [Apache License 2.0](LICENSE-APACHE), unless otherwise noted.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<br>
|
|
3
|
+
<a href="https://sinapsis.tech/">
|
|
4
|
+
<img
|
|
5
|
+
src="https://github.com/SinapsisHub/brand-resources/blob/main/public/logo/sinapsis-logo-horizontal-dark-brand.png?raw=true"
|
|
6
|
+
alt="Sinapsis"
|
|
7
|
+
width="300">
|
|
8
|
+
</a>
|
|
9
|
+
<br>
|
|
10
|
+
Sinapsis Data-Visualization
|
|
11
|
+
<br>
|
|
12
|
+
</h1>
|
|
13
|
+
|
|
14
|
+
<h3 align="center">Visualise packet content, annotations and distributions.</h3>
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
**`sinapsis-data-visualization`** — Templates to perform visualization of data distributions and image annotations.
|
|
19
|
+
|
|
20
|
+
Model outputs need inspection: boxes, labels and data distributions help developers and operators understand what an Agent produced. Visualization Templates keep that work inside the graph rather than in ad hoc notebook code.
|
|
21
|
+
|
|
22
|
+
### Where it fits
|
|
23
|
+
|
|
24
|
+
Rendering is a separate step from inference. The `visualization-matplotlib` extra is useful when plots are needed; avoid drawing every frame in performance-sensitive pipelines unless required.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Requires **Python 3.13 or later**, as declared in this package’s manifest. Install the base distribution using your preferred package manager:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv pip install sinapsis-data-visualization
|
|
32
|
+
# or
|
|
33
|
+
pip install sinapsis-data-visualization
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Optional features and dependencies
|
|
37
|
+
|
|
38
|
+
The base installation includes the dependencies required by the package. The following **extras** are declared in this package’s `pyproject.toml`; install only those needed by your workflow. They are standard Python optional dependencies, not separate execution profiles.
|
|
39
|
+
|
|
40
|
+
| Extra | Adds / when to select it |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `visualization-matplotlib` | Matplotlib-based rendering and plots. **Dependencies:** `matplotlib` |
|
|
43
|
+
| `all` | Bundle declared by this package; its manifest includes `visualization-matplotlib`. |
|
|
44
|
+
|
|
45
|
+
For example:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv pip install "sinapsis-data-visualization[visualization-matplotlib]"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The manifest also defines development-only dependency groups: `dev` (`pre-commit`, `ruff`, `ty`). These support source development and testing and are **not** runtime extras.
|
|
52
|
+
|
|
53
|
+
<h2 id="features">🚀 Features</h2>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
For example, for ***BBoxDrawer*** use ```sinx templates example-config BBoxDrawer``` to produce the following example config:
|
|
57
|
+
<details id='packages'><summary><strong><span style="font-size: 1.0em;"> Config</span></strong></summary>
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
agent:
|
|
61
|
+
name: my_annotation_preview_agent
|
|
62
|
+
description: Draw existing image annotations for inspection
|
|
63
|
+
templates:
|
|
64
|
+
- template_name: InputTemplate
|
|
65
|
+
class_name: InputTemplate
|
|
66
|
+
attributes: {}
|
|
67
|
+
- template_name: FolderImageDatasetCV2
|
|
68
|
+
class_name: FolderImageDatasetCV2
|
|
69
|
+
template_input: InputTemplate
|
|
70
|
+
attributes:
|
|
71
|
+
data_dir: '/path/to/sinapsis/cache/dir'
|
|
72
|
+
pattern: '**/*'
|
|
73
|
+
batch_size: 1
|
|
74
|
+
shuffle_data: false
|
|
75
|
+
samples_to_load: -1
|
|
76
|
+
load_on_init: false
|
|
77
|
+
label_path_index: -2
|
|
78
|
+
is_ground_truth: false
|
|
79
|
+
- template_name: BBoxDrawer
|
|
80
|
+
class_name: BBoxDrawer
|
|
81
|
+
template_input: FolderImageDatasetCV2
|
|
82
|
+
attributes:
|
|
83
|
+
overwrite: false
|
|
84
|
+
randomized_color: true
|
|
85
|
+
draw_confidence: true
|
|
86
|
+
draw_extra_labels: true
|
|
87
|
+
text_style:
|
|
88
|
+
font: 0
|
|
89
|
+
font_scale: 0.5
|
|
90
|
+
thickness: 2
|
|
91
|
+
draw_classification_label: false
|
|
92
|
+
classification_label_position: top_right
|
|
93
|
+
text_box_to_border_offset: 0.01
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Template discovery and examples
|
|
98
|
+
|
|
99
|
+
The package exposes Template implementations including `BBoxDrawer`, `OrientedBBoxDrawer`, `KeyPointsDrawer`, `SegmentationMaskDrawer`, `TabularDataVisualization`, `DataDistributionVisualization`.
|
|
100
|
+
|
|
101
|
+
Inspect the installed environment for the exact classes and validated attributes, then generate a starter configuration:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sinx templates show-all
|
|
105
|
+
sinx templates example-config TabularDataVisualization
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Visualisation operates on existing annotations or tabular data in the input packets. The illustrated `BBoxDrawer` assumes image annotations are already present; a folder reader alone will not generate bounding boxes.
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
- [Sinapsis documentation](https://docs.sinapsis.tech/)
|
|
113
|
+
- [Tutorials and examples](https://docs.sinapsis.tech/docs/latest/tutorials)
|
|
114
|
+
- [Sinapsis website](https://sinapsis.tech/)
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
Sinapsis open-source components are available under your choice of the [MIT License](LICENSE-MIT) or the [Apache License 2.0](LICENSE-APACHE), unless otherwise noted.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "sinapsis-data-visualization"
|
|
3
|
+
version = "1.0.1"
|
|
4
|
+
description = "Templates to perform visualization of data distributions and image annotations."
|
|
5
|
+
requires-python = ">=3.13"
|
|
6
|
+
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Ariel Ruiz-Garcia", email = "ariel@sinapsis.tech" },
|
|
9
|
+
]
|
|
10
|
+
maintainers = [
|
|
11
|
+
{ name = "sinapsis", email = "dev@sinapsis.tech" },
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
license = "MIT OR Apache-2.0"
|
|
15
|
+
license-files = ["LICENSE-MIT", "LICENSE-APACHE"]
|
|
16
|
+
readme = "README.md"
|
|
17
|
+
|
|
18
|
+
dependencies = [
|
|
19
|
+
"numpy==1.26.4",
|
|
20
|
+
"pandas>=2.2.3",
|
|
21
|
+
"sinapsis>=1,<2",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
visualization-matplotlib = ["matplotlib>=3.9.2"]
|
|
26
|
+
all = ["sinapsis-data-visualization[visualization-matplotlib]"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
[[tool.uv.index]]
|
|
30
|
+
name = "sinapsis-private"
|
|
31
|
+
url = "https://private.pypi.sinapsis.tech/"
|
|
32
|
+
explicit = true
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
[[tool.uv.index]]
|
|
36
|
+
name = "sinapsis-internal"
|
|
37
|
+
url = "https://pypi.sinapsis.tech/"
|
|
38
|
+
explicit = true
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
lint.select = [
|
|
43
|
+
"ARG",
|
|
44
|
+
"ANN",
|
|
45
|
+
"BLE",
|
|
46
|
+
"C4",
|
|
47
|
+
"E",
|
|
48
|
+
"F",
|
|
49
|
+
"FIX",
|
|
50
|
+
"FLY",
|
|
51
|
+
"I",
|
|
52
|
+
"PERF",
|
|
53
|
+
"PIE",
|
|
54
|
+
"RUF",
|
|
55
|
+
"RSE",
|
|
56
|
+
"SIM",
|
|
57
|
+
"SLOT",
|
|
58
|
+
"T10",
|
|
59
|
+
"T20",
|
|
60
|
+
"TD",
|
|
61
|
+
"TID",
|
|
62
|
+
]
|
|
63
|
+
lint.ignore = ['ANN401']
|
|
64
|
+
line-length = 120
|
|
65
|
+
show-fixes = true
|
|
66
|
+
|
|
67
|
+
[dependency-groups]
|
|
68
|
+
dev = [
|
|
69
|
+
"pre-commit>=4.6.0",
|
|
70
|
+
"ruff>=0.15.12",
|
|
71
|
+
"ty>=0.0.32",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[tool.hatch.build.targets.wheel]
|
|
75
|
+
packages = ["src/sinapsis_data_visualization"]
|
|
76
|
+
|
|
77
|
+
[build-system]
|
|
78
|
+
requires = ["hatchling>=1.27"]
|
|
79
|
+
build-backend = "hatchling.build"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
[tool.hatch.version]
|
|
83
|
+
source = "vcs"
|
|
84
|
+
|
|
85
|
+
[project.urls]
|
|
86
|
+
Homepage = "https://sinapsis.tech"
|
|
87
|
+
Documentation = "https://docs.sinapsis.tech/docs"
|
|
88
|
+
Tutorials = "https://docs.sinapsis.tech/tutorials"
|
|
89
|
+
Repository = "https://github.com/SinapsisHub/sinapsis-hub.git"
|
|
90
|
+
|
|
91
|
+
[tool.sinapsis.release]
|
|
92
|
+
registry = "pypi"
|
|
93
|
+
source_visibility = "public"
|
|
94
|
+
catalog_visibility = "PUBLIC"
|
|
95
|
+
artifact_visibility = "PUBLIC"
|
|
96
|
+
import_name = "sinapsis_data_visualization"
|
|
97
|
+
inspect_templates = true
|
|
@@ -3,7 +3,8 @@ from typing import cast
|
|
|
3
3
|
|
|
4
4
|
import cv2
|
|
5
5
|
import numpy as np
|
|
6
|
-
from
|
|
6
|
+
from sinapsis.data_transport import BoundingBox, ImageAnnotations
|
|
7
|
+
|
|
7
8
|
from sinapsis_data_visualization.helpers.annotation_drawer_types import (
|
|
8
9
|
TextInstanceProperties,
|
|
9
10
|
TextStyle,
|
|
@@ -92,21 +93,13 @@ def get_text_size(text: str, text_style: TextStyle) -> tuple[int, int]:
|
|
|
92
93
|
Returns:
|
|
93
94
|
tuple[int, int]: The (width, height) of the text.
|
|
94
95
|
"""
|
|
95
|
-
text_size = cv2.getTextSize(
|
|
96
|
-
text,
|
|
97
|
-
text_style.font,
|
|
98
|
-
text_style.font_scale,
|
|
99
|
-
text_style.thickness,
|
|
100
|
-
)[0]
|
|
96
|
+
text_size = cv2.getTextSize(text, text_style.font, text_style.font_scale, text_style.thickness)[0]
|
|
101
97
|
text_size = cast(tuple[int, int], text_size)
|
|
102
98
|
return text_size
|
|
103
99
|
|
|
104
100
|
|
|
105
101
|
def draw_text(
|
|
106
|
-
image: np.ndarray,
|
|
107
|
-
text: str,
|
|
108
|
-
text_properties: TextInstanceProperties,
|
|
109
|
-
text_style: TextStyle,
|
|
102
|
+
image: np.ndarray, text: str, text_properties: TextInstanceProperties, text_style: TextStyle
|
|
110
103
|
) -> np.ndarray:
|
|
111
104
|
"""
|
|
112
105
|
Draws the specified text on the image at the given position.
|
|
@@ -124,10 +117,7 @@ def draw_text(
|
|
|
124
117
|
cv2.putText(
|
|
125
118
|
copy_image,
|
|
126
119
|
text,
|
|
127
|
-
(
|
|
128
|
-
int(text_properties.x_position),
|
|
129
|
-
int(text_properties.y_position),
|
|
130
|
-
),
|
|
120
|
+
(int(text_properties.x_position), int(text_properties.y_position)),
|
|
131
121
|
text_style.font,
|
|
132
122
|
text_style.font_scale,
|
|
133
123
|
text_properties.text_color,
|
|
@@ -166,22 +156,13 @@ def draw_extra_labels(
|
|
|
166
156
|
|
|
167
157
|
for str_repr, y_offset in zip(extra_str_repr, text_y_offsets):
|
|
168
158
|
y_position -= y_offset
|
|
169
|
-
image = draw_text(
|
|
170
|
-
image,
|
|
171
|
-
str_repr,
|
|
172
|
-
TextInstanceProperties(bbox.x, y_position, text_color),
|
|
173
|
-
text_style,
|
|
174
|
-
)
|
|
159
|
+
image = draw_text(image, str_repr, TextInstanceProperties(bbox.x, y_position, text_color), text_style)
|
|
175
160
|
|
|
176
161
|
return image
|
|
177
162
|
|
|
178
163
|
|
|
179
164
|
def draw_annotation_rectangle(
|
|
180
|
-
image: np.ndarray,
|
|
181
|
-
bbox: BoundingBox,
|
|
182
|
-
ann_color: RGB_TYPE,
|
|
183
|
-
text_h: float,
|
|
184
|
-
text_w: float,
|
|
165
|
+
image: np.ndarray, bbox: BoundingBox, ann_color: RGB_TYPE, text_h: float, text_w: float
|
|
185
166
|
) -> np.ndarray:
|
|
186
167
|
"""Draws the background rectangle for the label.
|
|
187
168
|
|
|
@@ -207,11 +188,7 @@ def draw_annotation_rectangle(
|
|
|
207
188
|
|
|
208
189
|
|
|
209
190
|
def get_extra_ann_labels(
|
|
210
|
-
annotation: ImageAnnotations,
|
|
211
|
-
text_w: int,
|
|
212
|
-
text_h: int,
|
|
213
|
-
text_style: TextStyle,
|
|
214
|
-
spacing: int = 5,
|
|
191
|
+
annotation: ImageAnnotations, text_w: int, text_h: int, text_style: TextStyle, spacing: int = 5
|
|
215
192
|
) -> tuple[list[int], list[str], int, int]:
|
|
216
193
|
"""
|
|
217
194
|
Extracts additional annotation labels and calculates their dimensions
|
|
@@ -4,6 +4,7 @@ import math
|
|
|
4
4
|
import random
|
|
5
5
|
|
|
6
6
|
from matplotlib import colors
|
|
7
|
+
|
|
7
8
|
from sinapsis_data_visualization.helpers.annotation_drawer_types import RGB_TYPE
|
|
8
9
|
|
|
9
10
|
|
|
@@ -39,9 +40,7 @@ def build_color_map(color_names: list[str] | None = None, shuffle: bool = True)
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
def get_color_rgb_tuple(
|
|
42
|
-
color_map: dict[int, RGB_TYPE],
|
|
43
|
-
class_id: int | None = None,
|
|
44
|
-
randomized: bool = True,
|
|
43
|
+
color_map: dict[int, RGB_TYPE], class_id: int | None = None, randomized: bool = True
|
|
45
44
|
) -> RGB_TYPE:
|
|
46
45
|
"""
|
|
47
46
|
Method to fetch the RGB color combination associated with a specific class_id
|