Spaces:
Sleeping
Sleeping
Georg
commited on
Commit
·
e2be278
1
Parent(s):
7d85a56
Update test README with implementation status
Browse files- tests/README.md +51 -13
tests/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# FoundationPose Tests
|
| 2 |
|
| 3 |
-
This directory contains test scripts for the FoundationPose
|
| 4 |
|
| 5 |
## Test Data
|
| 6 |
|
|
@@ -8,26 +8,64 @@ Reference images for test objects are stored in `reference/target_cube/`.
|
|
| 8 |
|
| 9 |
## Running Tests
|
| 10 |
|
| 11 |
-
### Test
|
| 12 |
|
| 13 |
```bash
|
| 14 |
cd /path/to/foundationpose
|
| 15 |
-
python tests/test_estimator.py
|
| 16 |
```
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
Use the client script to test the deployed API:
|
| 21 |
-
|
| 22 |
-
```bash
|
| 23 |
-
python client.py
|
| 24 |
-
```
|
| 25 |
|
| 26 |
## Test Coverage
|
| 27 |
|
| 28 |
**test_estimator.py** tests:
|
| 29 |
-
1.
|
| 30 |
-
2. Object
|
| 31 |
3. Pose estimation on query images
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# FoundationPose Tests
|
| 2 |
|
| 3 |
+
This directory contains test scripts for the FoundationPose HuggingFace API.
|
| 4 |
|
| 5 |
## Test Data
|
| 6 |
|
|
|
|
| 8 |
|
| 9 |
## Running Tests
|
| 10 |
|
| 11 |
+
### Test Against HuggingFace Space
|
| 12 |
|
| 13 |
```bash
|
| 14 |
cd /path/to/foundationpose
|
| 15 |
+
/path/to/training/.venv/bin/python tests/test_estimator.py
|
| 16 |
```
|
| 17 |
|
| 18 |
+
The test uses the Gradio client to connect to the deployed API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
## Test Coverage
|
| 21 |
|
| 22 |
**test_estimator.py** tests:
|
| 23 |
+
1. API client initialization
|
| 24 |
+
2. Object initialization via API (reference-based)
|
| 25 |
3. Pose estimation on query images
|
| 26 |
|
| 27 |
+
## Current Status
|
| 28 |
+
|
| 29 |
+
**CAD-Based Mode**: ✅ Fully Implemented
|
| 30 |
+
- Requires a 3D mesh file (.obj, .stl, .ply)
|
| 31 |
+
- Provides accurate 6D pose estimation
|
| 32 |
+
- Use the CAD-Based initialization tab in the Gradio interface
|
| 33 |
+
|
| 34 |
+
**Model-Free Mode**: ⚠️ Not Yet Implemented
|
| 35 |
+
- Would require 3D reconstruction from reference images (photogrammetry)
|
| 36 |
+
- For now, use photogrammetry tools (Meshroom, COLMAP) to create a mesh first
|
| 37 |
+
- Then use CAD-Based mode with the generated mesh
|
| 38 |
+
|
| 39 |
+
## API Usage
|
| 40 |
+
|
| 41 |
+
The deployed Space provides two Gradio API endpoints:
|
| 42 |
+
|
| 43 |
+
### CAD-Based Initialization
|
| 44 |
+
```python
|
| 45 |
+
from gradio_client import Client, handle_file
|
| 46 |
+
|
| 47 |
+
client = Client("https://gpue-foundationpose.hf.space")
|
| 48 |
+
|
| 49 |
+
result = client.predict(
|
| 50 |
+
object_id="my_object",
|
| 51 |
+
mesh_file=handle_file("object.obj"),
|
| 52 |
+
reference_files=[handle_file(f) for f in image_files], # Optional
|
| 53 |
+
fx=500.0, fy=500.0, cx=320.0, cy=240.0,
|
| 54 |
+
api_name="/gradio_initialize_cad"
|
| 55 |
+
)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
### Pose Estimation
|
| 59 |
+
```python
|
| 60 |
+
result = client.predict(
|
| 61 |
+
object_id="my_object",
|
| 62 |
+
query_image=handle_file("query.jpg"),
|
| 63 |
+
fx=500.0, fy=500.0, cx=320.0, cy=240.0,
|
| 64 |
+
api_name="/gradio_estimate"
|
| 65 |
+
)
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## Known Issues
|
| 69 |
+
|
| 70 |
+
1. **Model-Free Mode**: Reference-only initialization is not yet supported. A 3D mesh is required.
|
| 71 |
+
2. **Test Results**: Current tests will return "No poses detected" because they don't provide a mesh file.
|