orient_express 2.3.0__tar.gz → 2.3.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.
- {orient_express-2.3.0 → orient_express-2.3.1}/PKG-INFO +2 -1
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/vector_index.py +24 -14
- {orient_express-2.3.0 → orient_express-2.3.1}/pyproject.toml +2 -1
- {orient_express-2.3.0 → orient_express-2.3.1}/README.md +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/__init__.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/deployment.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/model_wrapper.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/__init__.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/classification.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/feature_extraction.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/instance_segmentation.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/multi_label_classification.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/object_detection.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/predictor.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/semantic_segmentation.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/sklearn_pipeline.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/utils/colors.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/utils/gs.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/utils/image_processor.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/utils/paths.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/utils/retry.py +0 -0
- {orient_express-2.3.0 → orient_express-2.3.1}/orient_express/vertex.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: orient_express
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: A library to simplify model deployment to Vertex AI
|
|
5
5
|
Author: Alexey Zankevich
|
|
6
6
|
Author-email: alex.zankevich@shiftsmart.com
|
|
@@ -21,6 +21,7 @@ Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
|
21
21
|
Requires-Dist: scikit-learn (>=1.5.0,<2.0.0)
|
|
22
22
|
Requires-Dist: torch (>=2.5.0)
|
|
23
23
|
Requires-Dist: torchvision (>=0.20.0)
|
|
24
|
+
Requires-Dist: tqdm (>=4.67.1)
|
|
24
25
|
Requires-Dist: xgboost (>=2.0.0,<3.0.0)
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
26
27
|
|
|
@@ -86,38 +86,48 @@ class VectorIndex(Predictor):
|
|
|
86
86
|
)
|
|
87
87
|
return all_results
|
|
88
88
|
|
|
89
|
-
def aggregate(self) -> "VectorIndex":
|
|
89
|
+
def aggregate(self, per_label: bool = False) -> "VectorIndex":
|
|
90
90
|
"""
|
|
91
|
-
Aggregate the vectors into a single centroid per label.
|
|
91
|
+
Aggregate the vectors into a single centroid per unique label group.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
per_label: if True, create one centroid per individual label
|
|
95
|
+
(splitting label groups apart). If False (default), create
|
|
96
|
+
one centroid per unique label group.
|
|
92
97
|
"""
|
|
93
|
-
|
|
98
|
+
key_to_indices: dict = {}
|
|
94
99
|
for i, label_group in enumerate(self.labels):
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
if per_label:
|
|
101
|
+
keys = [label for label in label_group]
|
|
102
|
+
else:
|
|
103
|
+
keys = [tuple(sorted(label_group))]
|
|
104
|
+
for key in keys:
|
|
105
|
+
if key not in key_to_indices:
|
|
106
|
+
key_to_indices[key] = []
|
|
107
|
+
key_to_indices[key].append(i)
|
|
108
|
+
|
|
109
|
+
sorted_keys = sorted(key_to_indices.keys(), key=str)
|
|
101
110
|
centroids = np.empty(
|
|
102
|
-
(len(
|
|
111
|
+
(len(sorted_keys), self.vectors.shape[1]), dtype=self.vectors.dtype
|
|
103
112
|
)
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
new_labels = []
|
|
115
|
+
for i, key in enumerate(sorted_keys):
|
|
116
|
+
indices = key_to_indices[key]
|
|
107
117
|
centroid = self.vectors[indices].mean(axis=0)
|
|
108
118
|
norm = np.linalg.norm(centroid)
|
|
109
119
|
if norm > 0:
|
|
110
120
|
centroid = centroid / norm
|
|
111
121
|
centroids[i] = centroid
|
|
122
|
+
new_labels.append([key] if per_label else list(key))
|
|
112
123
|
|
|
113
|
-
new_labels = [[label] for label in unique_labels]
|
|
114
124
|
return VectorIndex(vectors=centroids, labels=new_labels)
|
|
115
125
|
|
|
116
126
|
def get_serving_container_image_uri(self) -> str:
|
|
117
127
|
warnings.warn(
|
|
118
128
|
"VectorIndex does not support serving via a container. Returning incompatible image URI."
|
|
119
129
|
)
|
|
120
|
-
return "us-west1-docker.pkg.dev/
|
|
130
|
+
return "us-west1-docker.pkg.dev/shiftsmart-api/orient-express/image-onnx:v2.1.2"
|
|
121
131
|
|
|
122
132
|
def get_serving_container_health_route(self, model_name) -> str:
|
|
123
133
|
return f"/v1/models/{model_name}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "orient_express"
|
|
3
|
-
version = "2.3.
|
|
3
|
+
version = "2.3.1"
|
|
4
4
|
description = "A library to simplify model deployment to Vertex AI"
|
|
5
5
|
authors = ["Alexey Zankevich <alex.zankevich@shiftsmart.com>", "Ian Myers <ian.myers@shiftsmart.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -18,6 +18,7 @@ Pillow = ">=10.0.1"
|
|
|
18
18
|
gcsfs = "^2024.10.0"
|
|
19
19
|
scikit-learn = "^1.5.0"
|
|
20
20
|
xgboost = "^2.0.0"
|
|
21
|
+
tqdm = ">=4.67.1"
|
|
21
22
|
onnxruntime-gpu = {version = "^1.20", markers = "sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64'"}
|
|
22
23
|
onnxruntime = {version = "^1.20", markers = "sys_platform == 'darwin' or platform_machine == 'aarch64' or platform_machine == 'arm64' or sys_platform == 'win32' and platform_machine == 'ARM64'"}
|
|
23
24
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/feature_extraction.py
RENAMED
|
File without changes
|
{orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/instance_segmentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{orient_express-2.3.0 → orient_express-2.3.1}/orient_express/predictors/semantic_segmentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|