neuromeka-vfm 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
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/segmentation.py +22 -3
- neuromeka_vfm-0.1.4.dist-info/METADATA +186 -0
- {neuromeka_vfm-0.1.2.dist-info → neuromeka_vfm-0.1.4.dist-info}/RECORD +7 -7
- neuromeka_vfm-0.1.2.dist-info/METADATA +0 -159
- {neuromeka_vfm-0.1.2.dist-info → neuromeka_vfm-0.1.4.dist-info}/WHEEL +0 -0
- {neuromeka_vfm-0.1.2.dist-info → neuromeka_vfm-0.1.4.dist-info}/entry_points.txt +0 -0
- {neuromeka_vfm-0.1.2.dist-info → neuromeka_vfm-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {neuromeka_vfm-0.1.2.dist-info → neuromeka_vfm-0.1.4.dist-info}/top_level.txt +0 -0
neuromeka_vfm/segmentation.py
CHANGED
|
@@ -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])
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: neuromeka_vfm
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Client utilities for Neuromeka VFM FoundationPose RPC (upload meshes, call server)
|
|
5
|
+
Author: Neuromeka
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Neuromeka Co., Ltd.
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Classifier: Development Status :: 3 - Alpha
|
|
29
|
+
Classifier: Intended Audience :: Developers
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
37
|
+
Requires-Python: >=3.8
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Requires-Dist: numpy
|
|
41
|
+
Requires-Dist: pyzmq
|
|
42
|
+
Requires-Dist: paramiko
|
|
43
|
+
Requires-Dist: av
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# neuromeka_vfm
|
|
47
|
+
|
|
48
|
+
클라이언트 PC에서 Segmentation (SAM2, Grounding DINO), Pose Estimation (NVIDIA FoundationPose) 서버(RPC, ZeroMQ)와 통신하고, SSH/SFTP로 호스트에 mesh를 업로드하는 간단한 유틸 패키지입니다.
|
|
49
|
+
|
|
50
|
+
- Website: http://www.neuromeka.com
|
|
51
|
+
- Source code: https://github.com/neuromeka-robotics/neuromeka_vfm
|
|
52
|
+
- PyPI package: https://pypi.org/project/neuromeka_vfm/
|
|
53
|
+
- Documents: https://docs.neuromeka.com
|
|
54
|
+
|
|
55
|
+
## Web UI (VFM Tester)를 통해 사용 가능
|
|
56
|
+
|
|
57
|
+
- VFM Tester (Web UI): https://gitlab.com/neuromeka-group/nrmkq/nrmk_vfm_tester
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
```bash
|
|
62
|
+
pip install neuromeka_vfm
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Python API (예제로 보는 사용법)
|
|
66
|
+
|
|
67
|
+
* 내 PC: 어플리케이션을 구현하고 이 패키지 (neuromeka_vfm)이 설치된 PC
|
|
68
|
+
* 서버PC (Host): Segmentation, Pose Estimation 도커 서버가 설치된 PC. 내 PC에 도커를 설치할 경우 localhost 사용.
|
|
69
|
+
|
|
70
|
+
### Segmentation
|
|
71
|
+
```python
|
|
72
|
+
from neuromeka_vfm import Segmentation
|
|
73
|
+
|
|
74
|
+
seg = Segmentation(
|
|
75
|
+
hostname="192.168.10.63",
|
|
76
|
+
port=5432,
|
|
77
|
+
compression_strategy="png", # none | png | jpeg | h264
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# Image Prompt를 이용한 등록
|
|
81
|
+
seg.add_image_prompt("drug_box", ref_rgb)
|
|
82
|
+
seg.register_first_frame(frame=first_rgb,
|
|
83
|
+
prompt="drug_box", # ID str
|
|
84
|
+
use_image_prompt=True)
|
|
85
|
+
|
|
86
|
+
# Text Prompt를 이용한 등록
|
|
87
|
+
seg.register_first_frame(frame=first_rgb,
|
|
88
|
+
prompt="box .", # Text prompt (끝에 띄어쓰기 . 필수)
|
|
89
|
+
use_image_prompt=False)
|
|
90
|
+
|
|
91
|
+
# 등록된 mask에 대한 SAM2 tracking
|
|
92
|
+
masks = seg.get_next(next_rgb)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
seg.close()
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Pose Estimation
|
|
99
|
+
|
|
100
|
+
**Mesh 파일 업로드**: 등록/인식하고자 하는 mesh 파일 (stl)을 호스트PC의 '/opt/meshes/' 경로에 업로드 (직접 SSH 통해 파일을 옮겨도 됨)
|
|
101
|
+
```python
|
|
102
|
+
from neuromeka_vfm import upload_mesh
|
|
103
|
+
upload_mesh(
|
|
104
|
+
host="192.168.10.63",
|
|
105
|
+
user="user",
|
|
106
|
+
password="pass",
|
|
107
|
+
local="mesh/my_mesh.stl", # 내 PC mesh 경로
|
|
108
|
+
remote="/opt/meshes/my_mesh.stl", # 호스트PC mesh 경로 (도커 볼륨마운트)
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
초기화
|
|
113
|
+
```python
|
|
114
|
+
from neuromeka_vfm import PoseEstimation
|
|
115
|
+
|
|
116
|
+
pose = PoseEstimation(host="192.168.10.72", port=5557)
|
|
117
|
+
|
|
118
|
+
pose.init(
|
|
119
|
+
mesh_path="/app/modules/foundation_pose/mesh/my_mesh.stl",
|
|
120
|
+
apply_scale=1.0,
|
|
121
|
+
track_refine_iter=3,
|
|
122
|
+
min_n_views=40,
|
|
123
|
+
inplane_step=60
|
|
124
|
+
)
|
|
125
|
+
```
|
|
126
|
+
- mesh_path: 사용할 물체 메시 파일(STL/OBJ 등) 경로. 없으면 초기화 실패.
|
|
127
|
+
- apply_scale: 메시를 로드한 뒤 전체를 배율 조정하는 스케일 값. 단위 없는 곱셈 계수.
|
|
128
|
+
- STL 모델이 미터 단위라면 1.0 (스케일 없음)
|
|
129
|
+
- STL 모델이 센티미터 단위라면 0.01 (1 cm → 0.01 m)
|
|
130
|
+
- STL 모델이 밀리미터 단위라면 0.001 (1 mm → 0.001 m)
|
|
131
|
+
- force_apply_color: True일 때 메시에 단색 텍스처를 강제로 입힘. 메시가 색상을 안 가졌을 때 시각화 안정성을 위해 사용.
|
|
132
|
+
- apply_color: force_apply_color가 True일 때 적용할 RGB 색상값(0~255) 튜플.
|
|
133
|
+
- est_refine_iter: 초기 등록(register) 단계에서 포즈를 반복 정련하는 횟수. 값이 클수록 정확도 ↑, 연산 시간 ↑.
|
|
134
|
+
- track_refine_iter: 추적(track) 단계에서 한 프레임당 포즈 정련 반복 횟수.
|
|
135
|
+
- min_n_views: 초기 뷰 샘플링 시 생성할 최소 카메라 뷰 수(회전 후보 수에 영향).
|
|
136
|
+
- inplane_step: in-plane 회전 샘플링 간격(도 단위). 값이 작을수록 더 많은 회전 후보를 생성.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
인식 및 추적
|
|
140
|
+
```python
|
|
141
|
+
# 초기 등록 (iteration 생략 시 서버 기본값, check_vram=True로 VRAM 사전 체크)
|
|
142
|
+
register_resp = pose.register(rgb=rgb0, depth=depth0, mask=mask0, K=cam_K, check_vram=True)
|
|
143
|
+
|
|
144
|
+
# 추적 (bbox_xywh로 탐색 범위 제한 가능)
|
|
145
|
+
track_resp = pose.track(rgb=rgb1, depth=depth1, K=cam_K, bbox_xywh=bbox_xywh)
|
|
146
|
+
pose.close()
|
|
147
|
+
```
|
|
148
|
+
- cam_K: camera intrinsic
|
|
149
|
+
- RGB resolution이 크거나, min_n_views 값이 크거나, inplane_step이 작을 경우 GPU VRAM 초과 에러 발생.
|
|
150
|
+
- register check_vram=True 일 경우 VRAM 초과 사전 검사하여 shutdown 방지.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## VFM (Vision Foundation Model) latency benchmark
|
|
154
|
+
로컬 서버 구동 시 측정. 빈칸은 아직 미측정 항목입니다.
|
|
155
|
+
|
|
156
|
+
**RTX 5060**
|
|
157
|
+
| Task | Prompt | None (s) | JPEG (s) | PNG (s) | h264 (s) |
|
|
158
|
+
| --- | --- | --- | --- | --- | --- |
|
|
159
|
+
| Grounding DINO | text (human . cup .) | 0.86 | 0.35 | 0.50 | 0.52 |
|
|
160
|
+
| DINOv2 | image prompt | 0.85 | 0.49 | 0.65 | 0.63 |
|
|
161
|
+
| SAM2 | - | | | | |
|
|
162
|
+
| FoundationPose registration | - | | | | |
|
|
163
|
+
| FoundationPose track | - | | | | |
|
|
164
|
+
|
|
165
|
+
**RTX 5090**
|
|
166
|
+
| Task | Prompt | None (s) | JPEG (s) | PNG (s) | h264 (s) |
|
|
167
|
+
| --- | --- | --- | --- | --- | --- |
|
|
168
|
+
| Grounding DINO | text (human . cup .) | | | | |
|
|
169
|
+
| DINOv2 | image prompt | | | | |
|
|
170
|
+
| SAM2 | - | | | | |
|
|
171
|
+
| FoundationPose registration | - | 0.4 | - | | |
|
|
172
|
+
| FoundationPose track | - | 0.03 | | | |
|
|
173
|
+
|
|
174
|
+
**Jetson Orin**
|
|
175
|
+
| Task | Prompt | None (s) | JPEG (s) | PNG (s) | h264 (s) |
|
|
176
|
+
| --- | --- | --- | --- | --- | --- |
|
|
177
|
+
| Grounding DINO | text (human . cup .) | | | | |
|
|
178
|
+
| DINOv2 | image prompt | | | | |
|
|
179
|
+
| SAM2 | - | | | | |
|
|
180
|
+
| FoundationPose registration | - | 0.4 | - | | |
|
|
181
|
+
| FoundationPose track | - | 0.03 | | | |
|
|
182
|
+
|
|
183
|
+
## 릴리스 노트
|
|
184
|
+
- 0.1.2: Segmentation 응답 성공 판정 개선(`result`/`success`/`status` 모두 지원), image prompt 등록/사용 오류 수정, PoseEstimation `register`에 `check_vram` 옵션 반영.
|
|
185
|
+
- 0.1.1: PoseEstimation/Segmentation에서 리소스 정리 개선, iteration 미전달 시 서버 기본값 사용, pose 데모 예제 추가.
|
|
186
|
+
- 0.1.0: 초기 공개 버전. FoundationPose RPC 클라이언트, 실시간 세그멘테이션 클라이언트, SSH 기반 mesh 업로드 CLI/API 포함.
|
|
@@ -2,13 +2,13 @@ neuromeka_vfm/__init__.py,sha256=h5ODdWFgN7a9TBzF6Qfdyx5VxUr2hG0pFTwq57jEvDo,422
|
|
|
2
2
|
neuromeka_vfm/compression.py,sha256=d2xOz4XBJZ60pPSXwQ5LPYwhpsaNORvNoY_0CUiAvt0,5191
|
|
3
3
|
neuromeka_vfm/pickle_client.py,sha256=Iw2fpxdnKB20oEUgsd0rJlvzOd5JhetphpKkF9qQcX0,591
|
|
4
4
|
neuromeka_vfm/pose_estimation.py,sha256=3MUVhL0nMcpHApZDAzutS7fINPHcb-tu_WoXvNGU33E,2625
|
|
5
|
-
neuromeka_vfm/segmentation.py,sha256=
|
|
5
|
+
neuromeka_vfm/segmentation.py,sha256=wae0_m225DUMD8Nm2A7iQm49QWeUas17B8PaoGGFt5w,6311
|
|
6
6
|
neuromeka_vfm/upload_mesh.py,sha256=aW5G9aE5OeiDN5pEVKDzMeV538U-I2iRYZvVZTfGsr4,2728
|
|
7
7
|
neuromeka_vfm/examples/__init__.py,sha256=dEhb0FqhpEGNmg0pMunmrTlViIcxvd95fYEjZ49IOTQ,37
|
|
8
8
|
neuromeka_vfm/examples/pose_demo.py,sha256=zq1Z0_kxQc4CB-ltfwm_oMoC7JLoN5GyeE3C6jKGQKw,13658
|
|
9
|
-
neuromeka_vfm-0.1.
|
|
10
|
-
neuromeka_vfm-0.1.
|
|
11
|
-
neuromeka_vfm-0.1.
|
|
12
|
-
neuromeka_vfm-0.1.
|
|
13
|
-
neuromeka_vfm-0.1.
|
|
14
|
-
neuromeka_vfm-0.1.
|
|
9
|
+
neuromeka_vfm-0.1.4.dist-info/licenses/LICENSE,sha256=40cBWxFahhu0p_EB0GhU8oVIifVNmH1o2fZtx0bIif8,1076
|
|
10
|
+
neuromeka_vfm-0.1.4.dist-info/METADATA,sha256=EPZ5Y6uuSz00whHesar6bKAqrUDNpGAfquZq9Pvd24U,7829
|
|
11
|
+
neuromeka_vfm-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
neuromeka_vfm-0.1.4.dist-info/entry_points.txt,sha256=Wl4XqiUt_GLQ08oTJtsYjLW0iYxZ52ysVd1-cN0kYP4,72
|
|
13
|
+
neuromeka_vfm-0.1.4.dist-info/top_level.txt,sha256=uAH_yXikUvxXTSEnUC0M8Zl5ggxbnkYtXlmTfEG8MUk,14
|
|
14
|
+
neuromeka_vfm-0.1.4.dist-info/RECORD,,
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: neuromeka_vfm
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: Client utilities for Neuromeka VFM FoundationPose RPC (upload meshes, call server)
|
|
5
|
-
Author: Neuromeka
|
|
6
|
-
License: MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2025 Neuromeka Co., Ltd.
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
27
|
-
|
|
28
|
-
Classifier: Development Status :: 3 - Alpha
|
|
29
|
-
Classifier: Intended Audience :: Developers
|
|
30
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
-
Classifier: Programming Language :: Python :: 3
|
|
32
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
33
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
35
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
36
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
37
|
-
Requires-Python: >=3.8
|
|
38
|
-
Description-Content-Type: text/markdown
|
|
39
|
-
License-File: LICENSE
|
|
40
|
-
Requires-Dist: numpy
|
|
41
|
-
Requires-Dist: pyzmq
|
|
42
|
-
Requires-Dist: paramiko
|
|
43
|
-
Requires-Dist: av
|
|
44
|
-
Requires-Dist: opencv-python-headless
|
|
45
|
-
Dynamic: license-file
|
|
46
|
-
|
|
47
|
-
# neuromeka_vfm
|
|
48
|
-
|
|
49
|
-
클라이언트 PC에서 Segmentation (SAM2, Grounding DINO), Pose Estimation (NVIDIA FoundationPose) 서버(RPC, ZeroMQ)와 통신하고, SSH/SFTP로 호스트에 mesh를 업로드하는 간단한 유틸 패키지입니다.
|
|
50
|
-
|
|
51
|
-
- Website: http://www.neuromeka.com
|
|
52
|
-
- Source code: https://github.com/neuromeka-robotics/neuromeka_vfm
|
|
53
|
-
- PyPI package: https://pypi.org/project/neuromeka_vfm/
|
|
54
|
-
- Documents: https://docs.neuromeka.com
|
|
55
|
-
|
|
56
|
-
## VFM (Vision Foundation Model) latency benchmark
|
|
57
|
-
로컬 서버 구동 시 측정. 빈칸은 아직 미측정 항목입니다.
|
|
58
|
-
|
|
59
|
-
**RTX 5060**
|
|
60
|
-
| Task | Prompt | None (s) | JPEG (s) | PNG (s) | h264 (s) |
|
|
61
|
-
| --- | --- | --- | --- | --- | --- |
|
|
62
|
-
| Grounding DINO | text (human . cup .) | 0.86 | 0.35 | 0.50 | 0.52 |
|
|
63
|
-
| DINOv2 | image prompt | 0.85 | 0.49 | 0.65 | 0.63 |
|
|
64
|
-
| SAM2 | - | | | | |
|
|
65
|
-
| FoundationPose registration | - | | | | |
|
|
66
|
-
| FoundationPose track | - | | | | |
|
|
67
|
-
|
|
68
|
-
**RTX 5090**
|
|
69
|
-
| Task | Prompt | None (s) | JPEG (s) | PNG (s) | h264 (s) |
|
|
70
|
-
| --- | --- | --- | --- | --- | --- |
|
|
71
|
-
| Grounding DINO | text (human . cup .) | | | | |
|
|
72
|
-
| DINOv2 | image prompt | | | | |
|
|
73
|
-
| SAM2 | - | | | | |
|
|
74
|
-
| FoundationPose registration | - | | | | |
|
|
75
|
-
| FoundationPose track | - | | | | |
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## Installation
|
|
79
|
-
```bash
|
|
80
|
-
pip install neuromeka_vfm
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## 사용 예
|
|
84
|
-
### Python API
|
|
85
|
-
```python
|
|
86
|
-
from neuromeka_vfm import PoseEstimation, upload_mesh
|
|
87
|
-
# (옵션) Realtime segmentation client도 포함됩니다.
|
|
88
|
-
|
|
89
|
-
# 1) 서버로 mesh 업로드 (호스트 경로는 컨테이너에 -v로 마운트된 곳)
|
|
90
|
-
upload_mesh(
|
|
91
|
-
host="192.168.10.72",
|
|
92
|
-
user="user",
|
|
93
|
-
password="pass", # 또는 key="~/.ssh/id_rsa"
|
|
94
|
-
local="mesh/123.stl",
|
|
95
|
-
remote="/home/user/meshes/123.stl",
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
# 2) PoseEstimation 클라이언트
|
|
99
|
-
pose = PoseEstimation(host="192.168.10.72", port=5557)
|
|
100
|
-
pose.init(mesh_path="/app/modules/foundation_pose/mesh/123.stl")
|
|
101
|
-
# ...
|
|
102
|
-
pose.close()
|
|
103
|
-
|
|
104
|
-
# 3) Realtime segmentation client (예)
|
|
105
|
-
from neuromeka_vfm import Segmentation
|
|
106
|
-
seg = Segmentation(
|
|
107
|
-
hostname="192.168.10.63",
|
|
108
|
-
port=5432, # 해당 도커/서버 포트
|
|
109
|
-
compression_strategy="png", # none | png | jpeg | h264
|
|
110
|
-
benchmark=False,
|
|
111
|
-
)
|
|
112
|
-
# seg.register_first_frame(...)
|
|
113
|
-
# seg.get_next(...)
|
|
114
|
-
# seg.reset()
|
|
115
|
-
# seg.finish()
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## 주의
|
|
119
|
-
- `remote`는 **호스트** 경로입니다. 컨테이너 실행 시 `-v /home/user/meshes:/app/modules/foundation_pose/mesh`처럼 마운트하면, 업로드 직후 컨테이너에서 접근 가능합니다.
|
|
120
|
-
- RPC 포트(기본 5557)는 서버가 `-p 5557:5557`으로 노출되어 있어야 합니다.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## API 레퍼런스 (Python)
|
|
125
|
-
|
|
126
|
-
### PoseEstimation (FoundationPose RPC)
|
|
127
|
-
- `PoseEstimation(host=None, port=None)`
|
|
128
|
-
- `host`: FoundationPose 도커 서버가 구동 중인 PC의 IP.
|
|
129
|
-
- `port`: 5557
|
|
130
|
-
- `init(mesh_path, apply_scale=1.0, force_apply_color=False, apply_color=(160,160,160), est_refine_iter=10, track_refine_iter=3, min_n_views=40, inplane_step=60)`: 서버에 메쉬 등록 및 초기화.
|
|
131
|
-
- `register(rgb, depth, mask, K, iteration=None, check_vram=True)`: 첫 프레임 등록. `iteration`을 생략하면 서버 기본 반복 횟수를 사용하며, `check_vram=False`로 두면 GPU 메모리 사전 체크를 건너뜁니다.
|
|
132
|
-
- `track(rgb, depth, K, iteration=None, bbox_xywh=None)`: 추적/갱신. `bbox_xywh` 제공 시 해당 영역으로 탐색 범위를 좁힙니다.
|
|
133
|
-
- `reset()`: 세션 리셋.
|
|
134
|
-
- `reset_object()`: 캐시된 메쉬로 서버 측 `reset_object` 재호출.
|
|
135
|
-
- `close()`: ZeroMQ 소켓/컨텍스트 정리 (사용 후 필수 호출 권장).
|
|
136
|
-
|
|
137
|
-
### Segmentation (실시간 SAM2/GroundingDINO)
|
|
138
|
-
- `Segmentation(hostname, port, compression_strategy="none", benchmark=False)`:
|
|
139
|
-
- `compression_strategy`: `none|png|jpeg|h264`
|
|
140
|
-
- `hostname`: 세그멘테이션 도커 서버가 구동 중인 PC의 IP.
|
|
141
|
-
- `add_image_prompt(object_name, object_image)`: 이미지 프롬프트 등록.
|
|
142
|
-
- `register_first_frame(frame, prompt, use_image_prompt=False) -> bool`: 첫 프레임 등록, 성공 시 `True` 반환. `use_image_prompt=True`면 모든 이름을 사전에 `add_image_prompt`로 등록해야 합니다(누락 시 `ValueError`).
|
|
143
|
-
- `get_next(frame) -> dict[obj_id, mask] | None`: 다음 프레임 세그멘테이션/트래킹 결과.
|
|
144
|
-
- `switch_compression_strategy(compression_strategy)`: 런타임 압축 방식 교체.
|
|
145
|
-
- `reset()`: 내부 상태 및 벤치마크 타이머 리셋.
|
|
146
|
-
- `finish()`: 로컬 상태 초기화.
|
|
147
|
-
- `close()`: ZeroMQ 소켓/컨텍스트 정리 (사용 후 필수 호출 권장).
|
|
148
|
-
|
|
149
|
-
### 업로드 CLI/API
|
|
150
|
-
- `upload_mesh(host, user, port=22, password=None, key=None, local=None, remote=None)`: SSH/SFTP로 메쉬 전송, 비밀번호 또는 키 중 하나 필수.
|
|
151
|
-
- CLI: `neuromeka-upload-mesh --host ... --user ... (--password ... | --key ...) --local ... --remote ...`
|
|
152
|
-
|
|
153
|
-
### 예제
|
|
154
|
-
- 실시간 Pose + Segmentation 데모: `python -m neuromeka_vfm.examples.pose_demo` (RealSense 필요, 서버 실행 상태에서 사용).
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
## 릴리스 노트
|
|
158
|
-
- 0.1.1: PoseEstimation/Segmentation에서 리소스 정리 개선, iteration 미전달 시 서버 기본값 사용, pose 데모 예제 추가.
|
|
159
|
-
- 0.1.0: 초기 공개 버전. FoundationPose RPC 클라이언트, 실시간 세그멘테이션 클라이언트, SSH 기반 mesh 업로드 CLI/API 포함.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|