neuromeka-vfm 0.1.2__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.
- {neuromeka_vfm-0.1.2/src/neuromeka_vfm.egg-info → neuromeka_vfm-0.1.3}/PKG-INFO +1 -1
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/pyproject.toml +1 -1
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/segmentation.py +22 -3
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3/src/neuromeka_vfm.egg-info}/PKG-INFO +1 -1
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/LICENSE +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/README.md +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/setup.cfg +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/__init__.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/compression.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/examples/__init__.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/examples/pose_demo.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/pickle_client.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/pose_estimation.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/upload_mesh.py +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/SOURCES.txt +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/dependency_links.txt +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/entry_points.txt +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/requires.txt +0 -0
- {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "neuromeka_vfm"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Client utilities for Neuromeka VFM FoundationPose RPC (upload meshes, call server)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -26,6 +26,25 @@ class Segmentation:
|
|
|
26
26
|
self.call_time = {"add_image_prompt": 0, "register_first_frame": 0, "get_next": 0}
|
|
27
27
|
self.call_count = {"add_image_prompt": 0, "register_first_frame": 0, "get_next": 0}
|
|
28
28
|
|
|
29
|
+
def _is_success(self, response):
|
|
30
|
+
"""
|
|
31
|
+
Normalize server success flag.
|
|
32
|
+
Some servers return {"result": "SUCCESS"}, others {"success": true}, and
|
|
33
|
+
the segmentation server returns {"status": "success"}.
|
|
34
|
+
"""
|
|
35
|
+
# Try known keys in order of common usage.
|
|
36
|
+
for key in ("result", "success", "status"):
|
|
37
|
+
flag = response.get(key)
|
|
38
|
+
if flag is None:
|
|
39
|
+
continue
|
|
40
|
+
if isinstance(flag, str):
|
|
41
|
+
return flag.lower() == "success"
|
|
42
|
+
if isinstance(flag, bool):
|
|
43
|
+
return flag
|
|
44
|
+
return bool(flag)
|
|
45
|
+
# Fallback: anything truthy counts as success.
|
|
46
|
+
return bool(response)
|
|
47
|
+
|
|
29
48
|
def switch_compression_strategy(self, compression_strategy):
|
|
30
49
|
if compression_strategy in STRATEGIES:
|
|
31
50
|
self.compression_strategy_name = compression_strategy
|
|
@@ -46,7 +65,7 @@ class Segmentation:
|
|
|
46
65
|
start = time.time()
|
|
47
66
|
data = {"operation": "add_image_prompt", "object_name": object_name, "object_image": object_image}
|
|
48
67
|
response = self.client.send_data(data)
|
|
49
|
-
if
|
|
68
|
+
if self._is_success(response):
|
|
50
69
|
self.image_prompt_names.add(object_name)
|
|
51
70
|
if self.benchmark:
|
|
52
71
|
self.call_time["add_image_prompt"] += time.time() - start
|
|
@@ -72,7 +91,7 @@ class Segmentation:
|
|
|
72
91
|
"compression_strategy": self.compression_strategy_name,
|
|
73
92
|
}
|
|
74
93
|
response = self.client.send_data(data)
|
|
75
|
-
if
|
|
94
|
+
if self._is_success(response):
|
|
76
95
|
self.first_frame_registered = True
|
|
77
96
|
self.tracking_object_ids = response["data"]["obj_ids"]
|
|
78
97
|
masks = {}
|
|
@@ -98,7 +117,7 @@ class Segmentation:
|
|
|
98
117
|
if self.benchmark:
|
|
99
118
|
start = time.time()
|
|
100
119
|
response = self.client.send_data({"operation": "get_next", "frame": self.compression_strategy.encode(frame)})
|
|
101
|
-
if
|
|
120
|
+
if self._is_success(response):
|
|
102
121
|
masks = {}
|
|
103
122
|
for i, obj_id in enumerate(self.tracking_object_ids):
|
|
104
123
|
mask = self.compression_strategy.decode(response["data"]["masks"][i])
|
|
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
|