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.
Files changed (19) hide show
  1. {neuromeka_vfm-0.1.2/src/neuromeka_vfm.egg-info → neuromeka_vfm-0.1.3}/PKG-INFO +1 -1
  2. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/pyproject.toml +1 -1
  3. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/segmentation.py +22 -3
  4. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3/src/neuromeka_vfm.egg-info}/PKG-INFO +1 -1
  5. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/LICENSE +0 -0
  6. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/README.md +0 -0
  7. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/setup.cfg +0 -0
  8. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/__init__.py +0 -0
  9. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/compression.py +0 -0
  10. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/examples/__init__.py +0 -0
  11. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/examples/pose_demo.py +0 -0
  12. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/pickle_client.py +0 -0
  13. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/pose_estimation.py +0 -0
  14. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm/upload_mesh.py +0 -0
  15. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/SOURCES.txt +0 -0
  16. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/dependency_links.txt +0 -0
  17. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/entry_points.txt +0 -0
  18. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/requires.txt +0 -0
  19. {neuromeka_vfm-0.1.2 → neuromeka_vfm-0.1.3}/src/neuromeka_vfm.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuromeka_vfm
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Client utilities for Neuromeka VFM FoundationPose RPC (upload meshes, call server)
5
5
  Author: Neuromeka
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neuromeka_vfm"
7
- version = "0.1.2"
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 response.get("result") == "SUCCESS":
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 response.get("result") == "SUCCESS":
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 response.get("result") == "SUCCESS":
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])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuromeka_vfm
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Client utilities for Neuromeka VFM FoundationPose RPC (upload meshes, call server)
5
5
  Author: Neuromeka
6
6
  License: MIT License
File without changes
File without changes
File without changes