t2d2-sdk 2.3.2__tar.gz → 2.3.4__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.
- t2d2_sdk-2.3.4/PKG-INFO +145 -0
- t2d2_sdk-2.3.4/README.md +127 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/_version.py +2 -2
- t2d2_sdk-2.3.4/src/t2d2_sdk.egg-info/PKG-INFO +145 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/t2d2_sdk.py +131 -1
- t2d2_sdk-2.3.2/PKG-INFO +0 -67
- t2d2_sdk-2.3.2/README.md +0 -49
- t2d2_sdk-2.3.2/src/t2d2_sdk.egg-info/PKG-INFO +0 -67
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/.github/workflows/publish_pypi.yaml +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/.github/workflows/sphinx.yml +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/.gitignore +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/LICENSE +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/docs/Makefile +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/docs/make.bat +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/docs/requirements.txt +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/docs/source/conf.py +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/docs/source/index.rst +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/pyproject.toml +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/setup.cfg +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/t2d2_sdk.egg-info/SOURCES.txt +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/t2d2_sdk.egg-info/dependency_links.txt +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/t2d2_sdk.egg-info/requires.txt +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/src/t2d2_sdk.egg-info/top_level.txt +0 -0
- {t2d2_sdk-2.3.2 → t2d2_sdk-2.3.4}/tests/t2d2_test.py +0 -0
t2d2_sdk-2.3.4/PKG-INFO
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: t2d2-sdk
|
|
3
|
+
Version: 2.3.4
|
|
4
|
+
Summary: T2D2 SDK
|
|
5
|
+
Author-email: Badri Hiriyur <badri@t2d2.ai>
|
|
6
|
+
Project-URL: Homepage, https://t2d2.ai
|
|
7
|
+
Project-URL: Issues, https://github.com/t2d2-ai/t2d2-sdk/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: boto3
|
|
15
|
+
Requires-Dist: requests
|
|
16
|
+
Requires-Dist: sentry_sdk
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# T2D2 SDK
|
|
20
|
+
|
|
21
|
+
A Python SDK for seamless integration with the T2D2 platform.
|
|
22
|
+
|
|
23
|
+
Easily manage projects, assets, and AI-powered inspections for structural health monitoring.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
**T2D2 SDK** is a Python wrapper for the T2D2 API, enabling seamless integration with T2D2 projects and related assets for structural inspection data management.
|
|
28
|
+
|
|
29
|
+
- Manage projects, images, annotations, drawings, videos, reports, and more
|
|
30
|
+
- Upload, download, and organize assets
|
|
31
|
+
- Run AI inference and summarize inspection data
|
|
32
|
+
- Integrate with T2D2's web platform
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Full documentation is available at: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
37
|
+
|
|
38
|
+
## Table of Contents
|
|
39
|
+
- [Features](#features)
|
|
40
|
+
- [Installation](#installation)
|
|
41
|
+
- [Quickstart](#quickstart)
|
|
42
|
+
- [Usage](#usage)
|
|
43
|
+
- [Contributing](#contributing)
|
|
44
|
+
- [License](#license)
|
|
45
|
+
- [Support](#support)
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- **Authentication**: API key or email/password
|
|
50
|
+
- **Project Management**: Set, get, and summarize projects
|
|
51
|
+
- **Asset Management**: Upload/download images, drawings, videos, 3D models, and reports
|
|
52
|
+
- **Annotations**: Add, retrieve, and manage annotation classes and annotations
|
|
53
|
+
- **Regions & Tags**: Organize assets by regions and tags
|
|
54
|
+
- **AI Integration**: Run AI inference on images using project models
|
|
55
|
+
- **Summarization**: Summarize images and annotation conditions
|
|
56
|
+
- **Notifications**: Send notifications to users or Slack
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
Install the latest version from PyPI:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install --upgrade t2d2-sdk
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
1. **Sign up for a T2D2 account:** [Register here](https://app.t2d2.ai/auth/register)
|
|
69
|
+
2. **Get your API key** from the T2D2 web app
|
|
70
|
+
3. **Initialize the client:**
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from t2d2_sdk import T2D2
|
|
74
|
+
|
|
75
|
+
credentials = {'api_key': '<YOUR_API_KEY>'}
|
|
76
|
+
t2d2 = T2D2(credentials)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
### Set Project
|
|
82
|
+
```python
|
|
83
|
+
t2d2.set_project('<PROJECT_ID>')
|
|
84
|
+
project_info = t2d2.get_project_info()
|
|
85
|
+
print(project_info)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Upload Images
|
|
89
|
+
```python
|
|
90
|
+
image_paths = ['./images/img1.jpg', './images/img2.jpg']
|
|
91
|
+
response = t2d2.upload_images(image_paths)
|
|
92
|
+
print(response)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Get Images
|
|
96
|
+
```python
|
|
97
|
+
images = t2d2.get_images()
|
|
98
|
+
for img in images:
|
|
99
|
+
print(img['filename'], img['id'])
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Add Annotation Class
|
|
103
|
+
```python
|
|
104
|
+
result = t2d2.add_annotation_class('Crack', color='#FF0000', materials=['Concrete'])
|
|
105
|
+
print(result)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Add Annotations to an Image
|
|
109
|
+
```python
|
|
110
|
+
annotations = [
|
|
111
|
+
{
|
|
112
|
+
'annotation_class_id': 'class_id',
|
|
113
|
+
'coordinates': [[100, 100], [200, 100], [200, 200], [100, 200]],
|
|
114
|
+
'attributes': {'severity': 'high'}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
result = t2d2.add_annotations('image_id', annotations)
|
|
118
|
+
print(result)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Run AI Inference
|
|
122
|
+
```python
|
|
123
|
+
result = t2d2.run_ai_inferencer(
|
|
124
|
+
image_ids=['image_id1', 'image_id2'],
|
|
125
|
+
model_id='model_id',
|
|
126
|
+
confidence_threshold=0.6
|
|
127
|
+
)
|
|
128
|
+
print(result)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For more advanced usage, see the [full documentation](https://t2d2-ai.github.io/t2d2-sdk/).
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
Contributions are welcome! Please contact <bhiriyur@t2d2.ai> for more information.
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
See the LICENSE file for details.
|
|
140
|
+
|
|
141
|
+
## Support
|
|
142
|
+
|
|
143
|
+
- Documentation: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
144
|
+
- Email: <bhiriyur@t2d2.ai>
|
|
145
|
+
- T2D2 Web: [https://t2d2.ai](https://t2d2.ai)
|
t2d2_sdk-2.3.4/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# T2D2 SDK
|
|
2
|
+
|
|
3
|
+
A Python SDK for seamless integration with the T2D2 platform.
|
|
4
|
+
|
|
5
|
+
Easily manage projects, assets, and AI-powered inspections for structural health monitoring.
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
**T2D2 SDK** is a Python wrapper for the T2D2 API, enabling seamless integration with T2D2 projects and related assets for structural inspection data management.
|
|
10
|
+
|
|
11
|
+
- Manage projects, images, annotations, drawings, videos, reports, and more
|
|
12
|
+
- Upload, download, and organize assets
|
|
13
|
+
- Run AI inference and summarize inspection data
|
|
14
|
+
- Integrate with T2D2's web platform
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Full documentation is available at: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
19
|
+
|
|
20
|
+
## Table of Contents
|
|
21
|
+
- [Features](#features)
|
|
22
|
+
- [Installation](#installation)
|
|
23
|
+
- [Quickstart](#quickstart)
|
|
24
|
+
- [Usage](#usage)
|
|
25
|
+
- [Contributing](#contributing)
|
|
26
|
+
- [License](#license)
|
|
27
|
+
- [Support](#support)
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Authentication**: API key or email/password
|
|
32
|
+
- **Project Management**: Set, get, and summarize projects
|
|
33
|
+
- **Asset Management**: Upload/download images, drawings, videos, 3D models, and reports
|
|
34
|
+
- **Annotations**: Add, retrieve, and manage annotation classes and annotations
|
|
35
|
+
- **Regions & Tags**: Organize assets by regions and tags
|
|
36
|
+
- **AI Integration**: Run AI inference on images using project models
|
|
37
|
+
- **Summarization**: Summarize images and annotation conditions
|
|
38
|
+
- **Notifications**: Send notifications to users or Slack
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install the latest version from PyPI:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install --upgrade t2d2-sdk
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quickstart
|
|
49
|
+
|
|
50
|
+
1. **Sign up for a T2D2 account:** [Register here](https://app.t2d2.ai/auth/register)
|
|
51
|
+
2. **Get your API key** from the T2D2 web app
|
|
52
|
+
3. **Initialize the client:**
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from t2d2_sdk import T2D2
|
|
56
|
+
|
|
57
|
+
credentials = {'api_key': '<YOUR_API_KEY>'}
|
|
58
|
+
t2d2 = T2D2(credentials)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### Set Project
|
|
64
|
+
```python
|
|
65
|
+
t2d2.set_project('<PROJECT_ID>')
|
|
66
|
+
project_info = t2d2.get_project_info()
|
|
67
|
+
print(project_info)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Upload Images
|
|
71
|
+
```python
|
|
72
|
+
image_paths = ['./images/img1.jpg', './images/img2.jpg']
|
|
73
|
+
response = t2d2.upload_images(image_paths)
|
|
74
|
+
print(response)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Get Images
|
|
78
|
+
```python
|
|
79
|
+
images = t2d2.get_images()
|
|
80
|
+
for img in images:
|
|
81
|
+
print(img['filename'], img['id'])
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Add Annotation Class
|
|
85
|
+
```python
|
|
86
|
+
result = t2d2.add_annotation_class('Crack', color='#FF0000', materials=['Concrete'])
|
|
87
|
+
print(result)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Add Annotations to an Image
|
|
91
|
+
```python
|
|
92
|
+
annotations = [
|
|
93
|
+
{
|
|
94
|
+
'annotation_class_id': 'class_id',
|
|
95
|
+
'coordinates': [[100, 100], [200, 100], [200, 200], [100, 200]],
|
|
96
|
+
'attributes': {'severity': 'high'}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
result = t2d2.add_annotations('image_id', annotations)
|
|
100
|
+
print(result)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Run AI Inference
|
|
104
|
+
```python
|
|
105
|
+
result = t2d2.run_ai_inferencer(
|
|
106
|
+
image_ids=['image_id1', 'image_id2'],
|
|
107
|
+
model_id='model_id',
|
|
108
|
+
confidence_threshold=0.6
|
|
109
|
+
)
|
|
110
|
+
print(result)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For more advanced usage, see the [full documentation](https://t2d2-ai.github.io/t2d2-sdk/).
|
|
114
|
+
|
|
115
|
+
## Contributing
|
|
116
|
+
|
|
117
|
+
Contributions are welcome! Please contact <bhiriyur@t2d2.ai> for more information.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
See the LICENSE file for details.
|
|
122
|
+
|
|
123
|
+
## Support
|
|
124
|
+
|
|
125
|
+
- Documentation: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
126
|
+
- Email: <bhiriyur@t2d2.ai>
|
|
127
|
+
- T2D2 Web: [https://t2d2.ai](https://t2d2.ai)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: t2d2-sdk
|
|
3
|
+
Version: 2.3.4
|
|
4
|
+
Summary: T2D2 SDK
|
|
5
|
+
Author-email: Badri Hiriyur <badri@t2d2.ai>
|
|
6
|
+
Project-URL: Homepage, https://t2d2.ai
|
|
7
|
+
Project-URL: Issues, https://github.com/t2d2-ai/t2d2-sdk/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: boto3
|
|
15
|
+
Requires-Dist: requests
|
|
16
|
+
Requires-Dist: sentry_sdk
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# T2D2 SDK
|
|
20
|
+
|
|
21
|
+
A Python SDK for seamless integration with the T2D2 platform.
|
|
22
|
+
|
|
23
|
+
Easily manage projects, assets, and AI-powered inspections for structural health monitoring.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
**T2D2 SDK** is a Python wrapper for the T2D2 API, enabling seamless integration with T2D2 projects and related assets for structural inspection data management.
|
|
28
|
+
|
|
29
|
+
- Manage projects, images, annotations, drawings, videos, reports, and more
|
|
30
|
+
- Upload, download, and organize assets
|
|
31
|
+
- Run AI inference and summarize inspection data
|
|
32
|
+
- Integrate with T2D2's web platform
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Full documentation is available at: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
37
|
+
|
|
38
|
+
## Table of Contents
|
|
39
|
+
- [Features](#features)
|
|
40
|
+
- [Installation](#installation)
|
|
41
|
+
- [Quickstart](#quickstart)
|
|
42
|
+
- [Usage](#usage)
|
|
43
|
+
- [Contributing](#contributing)
|
|
44
|
+
- [License](#license)
|
|
45
|
+
- [Support](#support)
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- **Authentication**: API key or email/password
|
|
50
|
+
- **Project Management**: Set, get, and summarize projects
|
|
51
|
+
- **Asset Management**: Upload/download images, drawings, videos, 3D models, and reports
|
|
52
|
+
- **Annotations**: Add, retrieve, and manage annotation classes and annotations
|
|
53
|
+
- **Regions & Tags**: Organize assets by regions and tags
|
|
54
|
+
- **AI Integration**: Run AI inference on images using project models
|
|
55
|
+
- **Summarization**: Summarize images and annotation conditions
|
|
56
|
+
- **Notifications**: Send notifications to users or Slack
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
Install the latest version from PyPI:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install --upgrade t2d2-sdk
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
1. **Sign up for a T2D2 account:** [Register here](https://app.t2d2.ai/auth/register)
|
|
69
|
+
2. **Get your API key** from the T2D2 web app
|
|
70
|
+
3. **Initialize the client:**
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from t2d2_sdk import T2D2
|
|
74
|
+
|
|
75
|
+
credentials = {'api_key': '<YOUR_API_KEY>'}
|
|
76
|
+
t2d2 = T2D2(credentials)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
### Set Project
|
|
82
|
+
```python
|
|
83
|
+
t2d2.set_project('<PROJECT_ID>')
|
|
84
|
+
project_info = t2d2.get_project_info()
|
|
85
|
+
print(project_info)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Upload Images
|
|
89
|
+
```python
|
|
90
|
+
image_paths = ['./images/img1.jpg', './images/img2.jpg']
|
|
91
|
+
response = t2d2.upload_images(image_paths)
|
|
92
|
+
print(response)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Get Images
|
|
96
|
+
```python
|
|
97
|
+
images = t2d2.get_images()
|
|
98
|
+
for img in images:
|
|
99
|
+
print(img['filename'], img['id'])
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Add Annotation Class
|
|
103
|
+
```python
|
|
104
|
+
result = t2d2.add_annotation_class('Crack', color='#FF0000', materials=['Concrete'])
|
|
105
|
+
print(result)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Add Annotations to an Image
|
|
109
|
+
```python
|
|
110
|
+
annotations = [
|
|
111
|
+
{
|
|
112
|
+
'annotation_class_id': 'class_id',
|
|
113
|
+
'coordinates': [[100, 100], [200, 100], [200, 200], [100, 200]],
|
|
114
|
+
'attributes': {'severity': 'high'}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
result = t2d2.add_annotations('image_id', annotations)
|
|
118
|
+
print(result)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Run AI Inference
|
|
122
|
+
```python
|
|
123
|
+
result = t2d2.run_ai_inferencer(
|
|
124
|
+
image_ids=['image_id1', 'image_id2'],
|
|
125
|
+
model_id='model_id',
|
|
126
|
+
confidence_threshold=0.6
|
|
127
|
+
)
|
|
128
|
+
print(result)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For more advanced usage, see the [full documentation](https://t2d2-ai.github.io/t2d2-sdk/).
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
Contributions are welcome! Please contact <bhiriyur@t2d2.ai> for more information.
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
See the LICENSE file for details.
|
|
140
|
+
|
|
141
|
+
## Support
|
|
142
|
+
|
|
143
|
+
- Documentation: [https://t2d2-ai.github.io/t2d2-sdk/](https://t2d2-ai.github.io/t2d2-sdk/)
|
|
144
|
+
- Email: <bhiriyur@t2d2.ai>
|
|
145
|
+
- T2D2 Web: [https://t2d2.ai](https://t2d2.ai)
|
|
@@ -2461,4 +2461,134 @@ class T2D2(object):
|
|
|
2461
2461
|
|
|
2462
2462
|
|
|
2463
2463
|
url = "notifications/slack"
|
|
2464
|
-
return self.request(url, RequestType.POST, data=payload)
|
|
2464
|
+
return self.request(url, RequestType.POST, data=payload)
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
################################################################################################
|
|
2468
|
+
# AI Models
|
|
2469
|
+
################################################################################################
|
|
2470
|
+
|
|
2471
|
+
def get_ai_models(self):
|
|
2472
|
+
"""
|
|
2473
|
+
Retrieve all AI models available in the current project.
|
|
2474
|
+
|
|
2475
|
+
This method fetches all AI models associated with the current project from the T2D2 API.
|
|
2476
|
+
It returns a list of dictionaries containing details about each AI model.
|
|
2477
|
+
|
|
2478
|
+
:return: A list of dictionaries, each containing AI model details
|
|
2479
|
+
:rtype: list of dict
|
|
2480
|
+
|
|
2481
|
+
:raises ValueError: If no project is currently set
|
|
2482
|
+
:raises ConnectionError: If there is a problem connecting to the T2D2 API
|
|
2483
|
+
|
|
2484
|
+
:example:
|
|
2485
|
+
|
|
2486
|
+
>>> models = client.get_ai_models()
|
|
2487
|
+
>>> print(models)
|
|
2488
|
+
"""
|
|
2489
|
+
if not self.project:
|
|
2490
|
+
raise ValueError("Project not set")
|
|
2491
|
+
|
|
2492
|
+
url = f"{self.project['id']}/ai-models"
|
|
2493
|
+
return self.request(url, RequestType.GET)
|
|
2494
|
+
|
|
2495
|
+
def get_ai_model_by_id(self, model_id):
|
|
2496
|
+
"""
|
|
2497
|
+
Retrieve details of a specific AI model by its ID.
|
|
2498
|
+
|
|
2499
|
+
This method fetches detailed information about a specific AI model from the T2D2 API.
|
|
2500
|
+
It returns a dictionary containing all the information available for the specified AI model.
|
|
2501
|
+
|
|
2502
|
+
:param model_id: The ID of the AI model to retrieve
|
|
2503
|
+
:type model_id: str
|
|
2504
|
+
|
|
2505
|
+
:return: A dictionary containing AI model details
|
|
2506
|
+
:rtype: dict
|
|
2507
|
+
|
|
2508
|
+
"""
|
|
2509
|
+
|
|
2510
|
+
if not self.project:
|
|
2511
|
+
raise ValueError("Project not set")
|
|
2512
|
+
|
|
2513
|
+
url = f"{self.project['id']}/ai-models/{model_id}"
|
|
2514
|
+
return self.request(url, RequestType.GET)
|
|
2515
|
+
|
|
2516
|
+
def run_ai_inferencer(self, image_ids, model_id, confidence_threshold=0.5,
|
|
2517
|
+
replace_annotations=False, sliding_window=False,
|
|
2518
|
+
whole_image=True, batch_size=1):
|
|
2519
|
+
"""
|
|
2520
|
+
Run AI inference on specified images using a selected model.
|
|
2521
|
+
|
|
2522
|
+
This method initiates an AI inference process on a set of images using the specified
|
|
2523
|
+
model. It constructs the payload with model details and user parameters, then sends
|
|
2524
|
+
the request to start the inference process.
|
|
2525
|
+
|
|
2526
|
+
:param image_ids: List of image IDs to run inference on
|
|
2527
|
+
:type image_ids: list of int
|
|
2528
|
+
|
|
2529
|
+
:param model_id: ID of the AI model to use for inference
|
|
2530
|
+
:type model_id: int
|
|
2531
|
+
|
|
2532
|
+
:param confidence_threshold: Minimum confidence score for detections (0.0 to 1.0)
|
|
2533
|
+
:type confidence_threshold: float
|
|
2534
|
+
:default confidence_threshold: 0.5
|
|
2535
|
+
|
|
2536
|
+
:param replace_annotations: Whether to replace existing annotations
|
|
2537
|
+
:type replace_annotations: bool
|
|
2538
|
+
:default replace_annotations: False
|
|
2539
|
+
|
|
2540
|
+
:param sliding_window: Whether to use sliding window approach for inference
|
|
2541
|
+
:type sliding_window: bool
|
|
2542
|
+
:default sliding_window: False
|
|
2543
|
+
|
|
2544
|
+
:param whole_image: Whether to process the whole image at once
|
|
2545
|
+
:type whole_image: bool
|
|
2546
|
+
:default whole_image: True
|
|
2547
|
+
|
|
2548
|
+
:param batch_size: Number of images to process in each batch
|
|
2549
|
+
:type batch_size: int
|
|
2550
|
+
:default batch_size: 1
|
|
2551
|
+
|
|
2552
|
+
:return: Response from the API containing the inference job details
|
|
2553
|
+
:rtype: dict
|
|
2554
|
+
|
|
2555
|
+
:raises ValueError: If no project is set or if required parameters are invalid
|
|
2556
|
+
|
|
2557
|
+
:example:
|
|
2558
|
+
|
|
2559
|
+
>>> image_ids = [000000, 000000, 000000]
|
|
2560
|
+
>>> result = client.run_ai_inferencer(
|
|
2561
|
+
... image_ids=image_ids,
|
|
2562
|
+
... model_id=1,
|
|
2563
|
+
... confidence_threshold=0.6
|
|
2564
|
+
... )
|
|
2565
|
+
>>> print(result)
|
|
2566
|
+
"""
|
|
2567
|
+
if not self.project:
|
|
2568
|
+
raise ValueError("Project not set")
|
|
2569
|
+
|
|
2570
|
+
# Get model details
|
|
2571
|
+
model_details = self.get_ai_model_by_id(model_id)
|
|
2572
|
+
if not model_details["success"]:
|
|
2573
|
+
raise ValueError(f"Failed to get model details: {model_details.get('message', 'Unknown error')}")
|
|
2574
|
+
|
|
2575
|
+
model_data = model_details["data"]
|
|
2576
|
+
|
|
2577
|
+
# Construct payload
|
|
2578
|
+
payload = {
|
|
2579
|
+
"confidence_threshold": confidence_threshold,
|
|
2580
|
+
"replace_annotations": replace_annotations,
|
|
2581
|
+
"whole_image": whole_image,
|
|
2582
|
+
"batch_size": batch_size,
|
|
2583
|
+
"ai_model": model_id,
|
|
2584
|
+
"description": model_data["description"],
|
|
2585
|
+
"image_ids": image_ids,
|
|
2586
|
+
"labels": model_data["labels"],
|
|
2587
|
+
"sliding_window": sliding_window
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
# Make request to start inference
|
|
2591
|
+
url = f"{self.project['id']}/tools/6/start"
|
|
2592
|
+
return self.request(url, RequestType.POST, data=payload)
|
|
2593
|
+
|
|
2594
|
+
|
t2d2_sdk-2.3.2/PKG-INFO
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: t2d2-sdk
|
|
3
|
-
Version: 2.3.2
|
|
4
|
-
Summary: T2D2 SDK
|
|
5
|
-
Author-email: Badri Hiriyur <badri@t2d2.ai>
|
|
6
|
-
Project-URL: Homepage, https://t2d2.ai
|
|
7
|
-
Project-URL: Issues, https://github.com/t2d2-ai/t2d2-sdk/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: boto3
|
|
15
|
-
Requires-Dist: requests
|
|
16
|
-
Requires-Dist: sentry_sdk
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
## Description
|
|
20
|
-
|
|
21
|
-
T2D2 SDK python wrapper to API to interface with T2D2 projects and related assets.
|
|
22
|
-
|
|
23
|
-
## Table of Contents
|
|
24
|
-
|
|
25
|
-
- [Description](#description)
|
|
26
|
-
- [Table of Contents](#table-of-contents)
|
|
27
|
-
- [Installation](#installation)
|
|
28
|
-
- [Usage](#usage)
|
|
29
|
-
- [Contributing](#contributing)
|
|
30
|
-
- [License](#license)
|
|
31
|
-
|
|
32
|
-
## Installation
|
|
33
|
-
|
|
34
|
-
This SDK is published to PyPI and the latest version can be installed as follows:
|
|
35
|
-
`pip install --upgrade t2d2-sdk`
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
These instructions assume that you have an account at T2D2 (<https://t2d2.ai>). If you do not have an account, you can sign up here: (<https://app.t2d2.ai/auth/register>). Subscription pricing details may be found here: (<https://t2d2.ai/pricing>).
|
|
40
|
-
|
|
41
|
-
Once you have an account created, you can either use your email/password or an API KEY to instantiate the T2D2 client.
|
|
42
|
-
|
|
43
|
-
```python
|
|
44
|
-
from t2d2_sdk import T2D2
|
|
45
|
-
|
|
46
|
-
credentials = {'email': "my@email.com", 'password': "<MYPASSWORD>"}
|
|
47
|
-
credentials = {'api_key': "<MY_API_KEY>"}
|
|
48
|
-
|
|
49
|
-
t2d2 = T2D2(credentials)
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
With this client, you can interface with the app and get access to most of the features of the web interface. More documentation coming soon at <https://docs.t2d2.ai>.
|
|
53
|
-
|
|
54
|
-
```python
|
|
55
|
-
t2d2.set_project(PROJECT_ID)
|
|
56
|
-
project = t2d2.get_project()
|
|
57
|
-
data = t2d2.get_images()
|
|
58
|
-
...
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Contributing
|
|
62
|
-
|
|
63
|
-
Please contact <bhiriyur@t2d2.ai> for further information on contributing to this project.
|
|
64
|
-
|
|
65
|
-
## License
|
|
66
|
-
|
|
67
|
-
Information about the project's license.
|
t2d2_sdk-2.3.2/README.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
## Description
|
|
2
|
-
|
|
3
|
-
T2D2 SDK python wrapper to API to interface with T2D2 projects and related assets.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Description](#description)
|
|
8
|
-
- [Table of Contents](#table-of-contents)
|
|
9
|
-
- [Installation](#installation)
|
|
10
|
-
- [Usage](#usage)
|
|
11
|
-
- [Contributing](#contributing)
|
|
12
|
-
- [License](#license)
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
This SDK is published to PyPI and the latest version can be installed as follows:
|
|
17
|
-
`pip install --upgrade t2d2-sdk`
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
These instructions assume that you have an account at T2D2 (<https://t2d2.ai>). If you do not have an account, you can sign up here: (<https://app.t2d2.ai/auth/register>). Subscription pricing details may be found here: (<https://t2d2.ai/pricing>).
|
|
22
|
-
|
|
23
|
-
Once you have an account created, you can either use your email/password or an API KEY to instantiate the T2D2 client.
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
from t2d2_sdk import T2D2
|
|
27
|
-
|
|
28
|
-
credentials = {'email': "my@email.com", 'password': "<MYPASSWORD>"}
|
|
29
|
-
credentials = {'api_key': "<MY_API_KEY>"}
|
|
30
|
-
|
|
31
|
-
t2d2 = T2D2(credentials)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
With this client, you can interface with the app and get access to most of the features of the web interface. More documentation coming soon at <https://docs.t2d2.ai>.
|
|
35
|
-
|
|
36
|
-
```python
|
|
37
|
-
t2d2.set_project(PROJECT_ID)
|
|
38
|
-
project = t2d2.get_project()
|
|
39
|
-
data = t2d2.get_images()
|
|
40
|
-
...
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Contributing
|
|
44
|
-
|
|
45
|
-
Please contact <bhiriyur@t2d2.ai> for further information on contributing to this project.
|
|
46
|
-
|
|
47
|
-
## License
|
|
48
|
-
|
|
49
|
-
Information about the project's license.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: t2d2-sdk
|
|
3
|
-
Version: 2.3.2
|
|
4
|
-
Summary: T2D2 SDK
|
|
5
|
-
Author-email: Badri Hiriyur <badri@t2d2.ai>
|
|
6
|
-
Project-URL: Homepage, https://t2d2.ai
|
|
7
|
-
Project-URL: Issues, https://github.com/t2d2-ai/t2d2-sdk/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: boto3
|
|
15
|
-
Requires-Dist: requests
|
|
16
|
-
Requires-Dist: sentry_sdk
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
## Description
|
|
20
|
-
|
|
21
|
-
T2D2 SDK python wrapper to API to interface with T2D2 projects and related assets.
|
|
22
|
-
|
|
23
|
-
## Table of Contents
|
|
24
|
-
|
|
25
|
-
- [Description](#description)
|
|
26
|
-
- [Table of Contents](#table-of-contents)
|
|
27
|
-
- [Installation](#installation)
|
|
28
|
-
- [Usage](#usage)
|
|
29
|
-
- [Contributing](#contributing)
|
|
30
|
-
- [License](#license)
|
|
31
|
-
|
|
32
|
-
## Installation
|
|
33
|
-
|
|
34
|
-
This SDK is published to PyPI and the latest version can be installed as follows:
|
|
35
|
-
`pip install --upgrade t2d2-sdk`
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
These instructions assume that you have an account at T2D2 (<https://t2d2.ai>). If you do not have an account, you can sign up here: (<https://app.t2d2.ai/auth/register>). Subscription pricing details may be found here: (<https://t2d2.ai/pricing>).
|
|
40
|
-
|
|
41
|
-
Once you have an account created, you can either use your email/password or an API KEY to instantiate the T2D2 client.
|
|
42
|
-
|
|
43
|
-
```python
|
|
44
|
-
from t2d2_sdk import T2D2
|
|
45
|
-
|
|
46
|
-
credentials = {'email': "my@email.com", 'password': "<MYPASSWORD>"}
|
|
47
|
-
credentials = {'api_key': "<MY_API_KEY>"}
|
|
48
|
-
|
|
49
|
-
t2d2 = T2D2(credentials)
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
With this client, you can interface with the app and get access to most of the features of the web interface. More documentation coming soon at <https://docs.t2d2.ai>.
|
|
53
|
-
|
|
54
|
-
```python
|
|
55
|
-
t2d2.set_project(PROJECT_ID)
|
|
56
|
-
project = t2d2.get_project()
|
|
57
|
-
data = t2d2.get_images()
|
|
58
|
-
...
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Contributing
|
|
62
|
-
|
|
63
|
-
Please contact <bhiriyur@t2d2.ai> for further information on contributing to this project.
|
|
64
|
-
|
|
65
|
-
## License
|
|
66
|
-
|
|
67
|
-
Information about the project's license.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|