File size: 1,965 Bytes
527ed9f
 
 
2b3faac
527ed9f
2b3faac
527ed9f
 
 
ac88814
dc2301e
 
 
2b3faac
 
6b18df6
2b3faac
527ed9f
2b3faac
 
6b18df6
2b3faac
527ed9f
2b3faac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527ed9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
license: apache-2.0
---
# HoHo2025 Tools

Tools and utilities for the [S23DR-2025 competition](https://huggingface.co/spaces/usm3d/S23DR2025) and [HoHo25k Dataset](https://huggingface.co/datasets/usm3d/hoho25k)

## Installation 

```bash
pip install hoho2025
```

### pip install over http
```bash
pip install git+http://hf.co/usm3d/tools2025.git    
```

or editable 
```bash
git clone http://hf.co/usm3d/tools2025 
cd tools2025
pip install -e .
```

### Usage example

```python
from datasets import load_dataset
from hoho2025.vis import plot_all_modalities
from hoho2025.viz3d import *

def read_colmap_rec(colmap_data):
    import pycolmap
    import tempfile,zipfile
    import io
    with tempfile.TemporaryDirectory() as tmpdir:
        with zipfile.ZipFile(io.BytesIO(colmap_data), "r") as zf:
            zf.extractall(tmpdir)  # unpacks cameras.txt, images.txt, etc. to tmpdir
        # Now parse with pycolmap
        rec = pycolmap.Reconstruction(tmpdir)
        return rec

ds = load_dataset("usm3d/hoho25k", streaming=True, trust_remote_code=True)
for a in ds['train']:
    break

fig, ax = plot_all_modalities(a)

## Now 3d

fig3d = init_figure()
plot_reconstruction(fig3d, read_colmap_rec(a['colmap_binary']))
plot_wireframe(fig3d, a['wf_vertices'], a['wf_edges'], a['wf_classifications'])
plot_bpo_cameras_from_entry(fig3d, a)
fig3d
```

## Example wireframe estimation 

Look in [hoho2025/example_solution.py](hoho2025/example_solution.py)

```python
from hoho2025.example_solutions import predict_wireframe
pred_vertices, pred_connections = predict_wireframe(a)

fig3d = init_figure()
plot_reconstruction(fig3d, read_colmap_rec(a['colmap_binary']))
plot_wireframe(fig3d, pred_vertices, pred_connections, color='rgb(0, 0, 255)')
fig3d
```


And to get the metric

```python
from hoho2025.metric_helper import hss

score = hss(pred_vertices, pred_connections, a['wf_vertices'], a['wf_edges'], vert_thresh=0.5, edge_thresh=0.5)
print (score)
```