sinapsis-generic-data-tools 0.1.1__tar.gz → 0.1.3__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 (20) hide show
  1. sinapsis_generic_data_tools-0.1.3/PKG-INFO +152 -0
  2. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/pyproject.toml +2 -5
  3. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/helpers/file_downloader.py +1 -1
  4. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/templates/image_color_conversion.py +2 -4
  5. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/templates/mask_non_roi.py +3 -2
  6. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/templates/packet_buffer_queue.py +2 -2
  7. sinapsis_generic_data_tools-0.1.3/src/sinapsis_generic_data_tools.egg-info/PKG-INFO +152 -0
  8. sinapsis_generic_data_tools-0.1.1/PKG-INFO +0 -812
  9. sinapsis_generic_data_tools-0.1.1/src/sinapsis_generic_data_tools.egg-info/PKG-INFO +0 -812
  10. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/LICENSE +0 -0
  11. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/README.md +0 -0
  12. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/setup.cfg +0 -0
  13. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/__init__.py +0 -0
  14. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/helpers/__init__.py +0 -0
  15. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/helpers/image_color_space_converter.py +0 -0
  16. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools/templates/__init__.py +0 -0
  17. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools.egg-info/SOURCES.txt +0 -0
  18. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools.egg-info/dependency_links.txt +0 -0
  19. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools.egg-info/requires.txt +0 -0
  20. {sinapsis_generic_data_tools-0.1.1 → sinapsis_generic_data_tools-0.1.3}/src/sinapsis_generic_data_tools.egg-info/top_level.txt +0 -0
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: sinapsis-generic-data-tools
3
+ Version: 0.1.3
4
+ Summary: Collection of generic data tools
5
+ Author-email: SinapsisAI <dev@sinapsis.tech>
6
+ Project-URL: Homepage, https://sinapsis.tech
7
+ Project-URL: Documentation, https://docs.sinapsis.tech/docs
8
+ Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
9
+ Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-data-tools.git
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: requests>=2.32.3
14
+ Requires-Dist: sinapsis>=0.1.1
15
+ Dynamic: license-file
16
+
17
+ <h1 align="center">
18
+ <br>
19
+ <a href="https://sinapsis.tech/">
20
+ <img
21
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
22
+ alt="" width="300">
23
+ </a>
24
+
25
+ <br>
26
+ Sinapsis Generic Data Tools
27
+ <br>
28
+ </h1>
29
+
30
+ <h4 align="center"> Package with generic data tools for image color conversion, buffering of data packets and other useful tools for handling data</h4>
31
+
32
+ <p align="center">
33
+ <a href="#installation">🐍 Installation</a> •
34
+ <a href="#documentation">📙 Documentation</a> •
35
+ <a href="#license">🔍 License</a>
36
+ </p>
37
+
38
+ <h2 id="installation">🐍 Installation</h2>
39
+
40
+
41
+ Install using your package manager of choice. We encourage the use of <code>uv</code>
42
+
43
+ Example with <code>uv</code>:
44
+
45
+ ```bash
46
+ uv pip install sinapsis-generic-data-tools --extra-index-url https://pypi.sinapsis.tech
47
+ ```
48
+ or with raw <code>pip</code>:
49
+ ```bash
50
+ pip install sinapsis-generic-data-tools --extra-index-url https://pypi.sinapsis.tech
51
+ ```
52
+
53
+ > [!IMPORTANT]
54
+ > Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
55
+ >
56
+
57
+ with <code>uv</code>:
58
+
59
+ ```bash
60
+ uv pip install sinapsis-generic-data-tools[all] --extra-index-url https://pypi.sinapsis.tech
61
+ ```
62
+ or with raw <code>pip</code>:
63
+ ```bash
64
+ pip install sinapsis-generic-data-tools[all] --extra-index-url https://pypi.sinapsis.tech
65
+ ```
66
+
67
+
68
+
69
+ > [!TIP]
70
+ > Use CLI command ``` sinapsis info --all-template-names``` to show a list with all the available Template names installed with Sinapsis Data Tools.
71
+
72
+ > [!TIP]
73
+ > Use CLI command ```sinapsis info --example-template-config TEMPLATE_NAME``` to produce an example Agent config for the Template specified in ***TEMPLATE_NAME***.
74
+
75
+ For example, for ***ColorConversion*** use ```sinapsis info --example-template-config ImageColorConversion``` to produce the following example config:
76
+
77
+
78
+ ```yaml
79
+ agent:
80
+ name: my_test_agent
81
+ templates:
82
+ - template_name: InputTemplate
83
+ class_name: InputTemplate
84
+ attributes: {}
85
+ - template_name: ImageColorConversion
86
+ class_name: ImageColorConversion
87
+ template_input: InputTemplate
88
+ attributes:
89
+ target_color_space: 2
90
+ ```
91
+
92
+
93
+ <h2 id="usage">📚 Usage example</h2>
94
+ <details id='usage'><summary><strong><span style="font-size: 1.0em;"> Example agent config</span></strong></summary>
95
+ You can copy and paste the following config and run it using the sinapsis cli, changing the <code>data_dir</code> attribute in the <code>FolderImageDatasetCV2</code> and the <code>root_dir</code> attribute in the <code>ImageSaver</code> template
96
+
97
+ ```yaml
98
+ agent:
99
+ name: my_test_agent
100
+ description: agent to save image locally
101
+ templates:
102
+ - template_name: InputTemplate
103
+ class_name: InputTemplate
104
+ attributes: {}
105
+ - template_name: FolderImageDatasetCV2
106
+ class_name: FolderImageDatasetCV2
107
+ attributes:
108
+ data_dir: /path/to/image
109
+ pattern: '**/*'
110
+ batch_size: 1
111
+ load_on_init: true
112
+ label_path_index: 0
113
+ is_ground_truth: false
114
+ - template_name: ImageColorConversion
115
+ class_name: ImageColorConversion
116
+ template_input: FolderImageDatasetCV2
117
+ attributes:
118
+ target_color_space: 2
119
+ - template_name: ImageSaver
120
+ class_name: ImageSaver
121
+ template_input: ColorConversion
122
+ attributes:
123
+ save_dir: /path/to/save/dir
124
+ extension: jpg
125
+ root_dir: '/path/to/sinapsis/cache'
126
+ save_full_image: true
127
+ save_bbox_crops: false
128
+ save_mask_crops: false
129
+ min_bbox_dim: 5
130
+ ```
131
+ </details>
132
+ To run, simply use:
133
+
134
+ ```bash
135
+ sinapsis run name_of_the_config.yml
136
+ ```
137
+ **NOTE**: Make sure to update the `data_dir` attribute in the `FolderImageDatasetCV2`, and the `save_dir` and `root_dir` attributes in the `ImageSaver` templates to actual directories
138
+
139
+ <h2 id="documentation">📙 Documentation</h2>
140
+
141
+ Documentation for this and other sinapsis packages is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
142
+
143
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
144
+
145
+ <h2 id="license">🔍 License</h2>
146
+
147
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
148
+
149
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
150
+
151
+
152
+
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "sinapsis-generic-data-tools"
3
- version = "0.1.1"
3
+ version = "0.1.3"
4
4
  description = "Collection of generic data tools"
5
5
  authors = [{ name = "SinapsisAI", email = "dev@sinapsis.tech" }]
6
6
 
7
7
  readme = "README.md"
8
- license = { file = "LICENSE" }
8
+ license-files = ["LICENSE"]
9
9
 
10
10
  requires-python = ">=3.10"
11
11
  dependencies = [
@@ -15,9 +15,6 @@ dependencies = [
15
15
  [build-system]
16
16
  requires = ["setuptools"]
17
17
  build-backend = "setuptools.build_meta"
18
- [tool.setuptools]
19
- license-files = []
20
-
21
18
 
22
19
 
23
20
  [[tool.uv.index]]
@@ -24,4 +24,4 @@ def download_file(url: str, output_path: str, description: str | None = None) ->
24
24
  f.write(chunk)
25
25
  sinapsis_logger.info(f"{description or 'File'} download completed successfully.")
26
26
  else:
27
- raise RuntimeError(f"Failed to download {description or 'file'}. HTTP status code: {response.status_code}")
27
+ raise RuntimeError(f"Failed to download {description or 'file'}. HTTP status code: {response.status_code}")
@@ -3,10 +3,8 @@ from sinapsis_core.data_containers.data_packet import (
3
3
  DataContainer,
4
4
  ImageColor,
5
5
  )
6
- from sinapsis_core.template_base import (
7
- Template,
8
- TemplateAttributes,
9
- )
6
+ from sinapsis_core.template_base import Template
7
+ from sinapsis_core.template_base.base_models import TemplateAttributes
10
8
 
11
9
  from sinapsis_generic_data_tools.helpers.image_color_space_converter import convert_color_space
12
10
 
@@ -7,7 +7,8 @@ import numpy as np
7
7
  from pydantic import BaseModel, ConfigDict, computed_field
8
8
  from sinapsis_core.data_containers.annotations import KeyPoint
9
9
  from sinapsis_core.data_containers.data_packet import DataContainer
10
- from sinapsis_core.template_base.template import Template, TemplateAttributes
10
+ from sinapsis_core.template_base.base_models import TemplateAttributes
11
+ from sinapsis_core.template_base.template import Template
11
12
 
12
13
 
13
14
  class RegionOfInterest(BaseModel):
@@ -71,7 +72,7 @@ class MaskNonROIs(Template):
71
72
  """
72
73
  Removed non-region of interest areas in an image, keeping only
73
74
  the regions specified in the attributes.
74
-
75
+
75
76
  Args:
76
77
  image (np.ndarray): image to be masked
77
78
  use_bitwise (bool): Flag to indicate if using cv2.bitwise_and
@@ -7,8 +7,8 @@ from typing import Literal, Type
7
7
 
8
8
  from pydantic.dataclasses import dataclass
9
9
  from sinapsis_core.data_containers.data_packet import DataContainer, Packet
10
- from sinapsis_core.template_base import (
11
- Template,
10
+ from sinapsis_core.template_base import Template
11
+ from sinapsis_core.template_base.base_models import (
12
12
  TemplateAttributes,
13
13
  TemplateAttributeType,
14
14
  )
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: sinapsis-generic-data-tools
3
+ Version: 0.1.3
4
+ Summary: Collection of generic data tools
5
+ Author-email: SinapsisAI <dev@sinapsis.tech>
6
+ Project-URL: Homepage, https://sinapsis.tech
7
+ Project-URL: Documentation, https://docs.sinapsis.tech/docs
8
+ Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
9
+ Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-data-tools.git
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: requests>=2.32.3
14
+ Requires-Dist: sinapsis>=0.1.1
15
+ Dynamic: license-file
16
+
17
+ <h1 align="center">
18
+ <br>
19
+ <a href="https://sinapsis.tech/">
20
+ <img
21
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
22
+ alt="" width="300">
23
+ </a>
24
+
25
+ <br>
26
+ Sinapsis Generic Data Tools
27
+ <br>
28
+ </h1>
29
+
30
+ <h4 align="center"> Package with generic data tools for image color conversion, buffering of data packets and other useful tools for handling data</h4>
31
+
32
+ <p align="center">
33
+ <a href="#installation">🐍 Installation</a> •
34
+ <a href="#documentation">📙 Documentation</a> •
35
+ <a href="#license">🔍 License</a>
36
+ </p>
37
+
38
+ <h2 id="installation">🐍 Installation</h2>
39
+
40
+
41
+ Install using your package manager of choice. We encourage the use of <code>uv</code>
42
+
43
+ Example with <code>uv</code>:
44
+
45
+ ```bash
46
+ uv pip install sinapsis-generic-data-tools --extra-index-url https://pypi.sinapsis.tech
47
+ ```
48
+ or with raw <code>pip</code>:
49
+ ```bash
50
+ pip install sinapsis-generic-data-tools --extra-index-url https://pypi.sinapsis.tech
51
+ ```
52
+
53
+ > [!IMPORTANT]
54
+ > Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
55
+ >
56
+
57
+ with <code>uv</code>:
58
+
59
+ ```bash
60
+ uv pip install sinapsis-generic-data-tools[all] --extra-index-url https://pypi.sinapsis.tech
61
+ ```
62
+ or with raw <code>pip</code>:
63
+ ```bash
64
+ pip install sinapsis-generic-data-tools[all] --extra-index-url https://pypi.sinapsis.tech
65
+ ```
66
+
67
+
68
+
69
+ > [!TIP]
70
+ > Use CLI command ``` sinapsis info --all-template-names``` to show a list with all the available Template names installed with Sinapsis Data Tools.
71
+
72
+ > [!TIP]
73
+ > Use CLI command ```sinapsis info --example-template-config TEMPLATE_NAME``` to produce an example Agent config for the Template specified in ***TEMPLATE_NAME***.
74
+
75
+ For example, for ***ColorConversion*** use ```sinapsis info --example-template-config ImageColorConversion``` to produce the following example config:
76
+
77
+
78
+ ```yaml
79
+ agent:
80
+ name: my_test_agent
81
+ templates:
82
+ - template_name: InputTemplate
83
+ class_name: InputTemplate
84
+ attributes: {}
85
+ - template_name: ImageColorConversion
86
+ class_name: ImageColorConversion
87
+ template_input: InputTemplate
88
+ attributes:
89
+ target_color_space: 2
90
+ ```
91
+
92
+
93
+ <h2 id="usage">📚 Usage example</h2>
94
+ <details id='usage'><summary><strong><span style="font-size: 1.0em;"> Example agent config</span></strong></summary>
95
+ You can copy and paste the following config and run it using the sinapsis cli, changing the <code>data_dir</code> attribute in the <code>FolderImageDatasetCV2</code> and the <code>root_dir</code> attribute in the <code>ImageSaver</code> template
96
+
97
+ ```yaml
98
+ agent:
99
+ name: my_test_agent
100
+ description: agent to save image locally
101
+ templates:
102
+ - template_name: InputTemplate
103
+ class_name: InputTemplate
104
+ attributes: {}
105
+ - template_name: FolderImageDatasetCV2
106
+ class_name: FolderImageDatasetCV2
107
+ attributes:
108
+ data_dir: /path/to/image
109
+ pattern: '**/*'
110
+ batch_size: 1
111
+ load_on_init: true
112
+ label_path_index: 0
113
+ is_ground_truth: false
114
+ - template_name: ImageColorConversion
115
+ class_name: ImageColorConversion
116
+ template_input: FolderImageDatasetCV2
117
+ attributes:
118
+ target_color_space: 2
119
+ - template_name: ImageSaver
120
+ class_name: ImageSaver
121
+ template_input: ColorConversion
122
+ attributes:
123
+ save_dir: /path/to/save/dir
124
+ extension: jpg
125
+ root_dir: '/path/to/sinapsis/cache'
126
+ save_full_image: true
127
+ save_bbox_crops: false
128
+ save_mask_crops: false
129
+ min_bbox_dim: 5
130
+ ```
131
+ </details>
132
+ To run, simply use:
133
+
134
+ ```bash
135
+ sinapsis run name_of_the_config.yml
136
+ ```
137
+ **NOTE**: Make sure to update the `data_dir` attribute in the `FolderImageDatasetCV2`, and the `save_dir` and `root_dir` attributes in the `ImageSaver` templates to actual directories
138
+
139
+ <h2 id="documentation">📙 Documentation</h2>
140
+
141
+ Documentation for this and other sinapsis packages is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
142
+
143
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
144
+
145
+ <h2 id="license">🔍 License</h2>
146
+
147
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
148
+
149
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
150
+
151
+
152
+