diff --git a/.env.example b/.env.example index 34dfd27..fff5176 100644 --- a/.env.example +++ b/.env.example @@ -8,3 +8,8 @@ OPENROUTER_API_KEY=sk-or-v1-XXXX # Porta HTTP del servizio (default 8890). PRESA_MANO_PORT=8890 + +# Chiave API per Open3DModel (pose-fit 6DOF su STL). +# Generala con la procedura del README di Open3DModel; deve combaciare +# con OPEN3D_API_KEY in ./Open3DModel/.env. +OPEN3D_API_KEY= diff --git a/config.yaml b/config.yaml index 3e97770..af310eb 100644 --- a/config.yaml +++ b/config.yaml @@ -20,6 +20,11 @@ services: sam21: base_url: http://localhost:8002 timeout_s: 10.0 + open3dmodel: + base_url: http://localhost:8878 + timeout_s: 30.0 + api_key_env: OPEN3D_API_KEY + max_stl_bytes: 20000000 aruco: dictionary: DICT_4X4_50 wrist_marker: @@ -42,6 +47,10 @@ grasp: - 0 - 0 - 0 + find_model: + sample_points: 2000 + min_fitness: 0.5 + max_rmse_mm: 5.0 calibration: min_samples: 5 method: DANIILIDIS # sweep su 49 sample H1 sx: TSAI=62.5mm, DANIILIDIS=14.2mm trans residual diff --git a/pyproject.toml b/pyproject.toml index 17f8c45..49e9e10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ dependencies = [ "uvicorn[standard]>=0.27.0", "httpx>=0.27.0", "numpy>=1.24.0", + "numpy-stl>=3.1.0", "opencv-contrib-python-headless>=4.9.0.80", "pyyaml>=6.0", "pydantic>=2.5.0", diff --git a/uv.lock b/uv.lock index e0176d7..43ce174 100644 --- a/uv.lock +++ b/uv.lock @@ -341,6 +341,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/04/74/f4c001f4714c3ad9ce037e18cf2b9c64871a84951eaa0baf683a9ca9301c/numpy-2.4.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:f2cf083b324a467e1ab358c105f6cad5ea950f50524668a80c486ff1db24e119", size = 12509075, upload-time = "2026-03-29T13:21:57.644Z" }, ] +[[package]] +name = "numpy-stl" +version = "3.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "python-utils" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/80/96366d1b69223d4ca55fca30f158096df169b00aa6b4dd963025980e7ede/numpy_stl-3.2.0.tar.gz", hash = "sha256:5a20c3f79cddaa0abc6a4b99f5486aceed4f88152f29b19a57acc844e183fd4d", size = 824382, upload-time = "2024-11-25T17:15:43.227Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ea/2c/e17b8814050427929077639d35a42187a006922600d4840475bdc5f64ebb/numpy_stl-3.2.0-py3-none-any.whl", hash = "sha256:697c81b107231362460aaedf4647e81ba54f54f59c896772fea7904c9c439da5", size = 20775, upload-time = "2024-11-25T17:15:41.346Z" }, +] + [[package]] name = "opencv-contrib-python-headless" version = "4.13.0.92" @@ -387,6 +401,7 @@ dependencies = [ { name = "httpx" }, { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "numpy-stl" }, { name = "opencv-contrib-python-headless" }, { name = "pydantic" }, { name = "python-multipart" }, @@ -404,6 +419,7 @@ requires-dist = [ { name = "fastapi", specifier = ">=0.110.0" }, { name = "httpx", specifier = ">=0.27.0" }, { name = "numpy", specifier = ">=1.24.0" }, + { name = "numpy-stl", specifier = ">=3.1.0" }, { name = "opencv-contrib-python-headless", specifier = ">=4.9.0.80" }, { name = "pydantic", specifier = ">=2.5.0" }, { name = "python-multipart", specifier = ">=0.0.9" }, @@ -590,6 +606,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f3/a2/43bbc5860b5034e2af4ef99a0e04d726ff329c43e192ef3abaa8d7ecfce5/python_multipart-0.0.28-py3-none-any.whl", hash = "sha256:10faac07eb966c3f48dc415f9dee46c04cb10d58d30a35677db8027c825ed9b6", size = 29438, upload-time = "2026-05-10T11:05:15.052Z" }, ] +[[package]] +name = "python-utils" +version = "3.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/13/4c/ef8b7b1046d65c1f18ca31e5235c7d6627ca2b3f389ab1d44a74d22f5cc9/python_utils-3.9.1.tar.gz", hash = "sha256:eb574b4292415eb230f094cbf50ab5ef36e3579b8f09e9f2ba74af70891449a0", size = 35403, upload-time = "2024-11-26T00:38:58.736Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/69/31c82567719b34d8f6b41077732589104883771d182a9f4ff3e71430999a/python_utils-3.9.1-py2.py3-none-any.whl", hash = "sha256:0273d7363c7ad4b70999b2791d5ba6b55333d6f7a4e4c8b6b39fb82b5fab4613", size = 32078, upload-time = "2024-11-26T00:38:57.488Z" }, +] + [[package]] name = "pyyaml" version = "6.0.3"