Upload folder using huggingface_hub
Browse files- README.md +24 -25
- config.yaml +2 -3
- main.py +1 -1
- requirements.txt +4 -1
README.md
CHANGED
@@ -61,12 +61,13 @@ project_root/
|
|
61 |
β βββ sliding_window.py # Core logic for windowed inference
|
62 |
β βββ export_logits.py # Export of softmax probabilities
|
63 |
βββ projection/
|
64 |
-
β
|
|
|
65 |
βββ utils/
|
66 |
β βββ logging_utils.py # Logging setup
|
67 |
β βββ metrics.py # Evaluation metrics (IoU, F1)
|
68 |
-
β βββ morton.py # Morton code utility
|
69 |
β βββ seed.py # Reproducibility utilities
|
|
|
70 |
βββ requirements.txt # Python dependencies
|
71 |
```
|
72 |
|
@@ -163,9 +164,9 @@ The following environment was used to train and evaluate the baseline model:
|
|
163 |
| Transformers | π€ Transformers 4.51 |
|
164 |
| JAX | jax==0.6.0 |
|
165 |
| laspy | >= 2.0 |
|
166 |
-
| RAM | β₯ 64 GB recommended
|
167 |
|
168 |
-
β οΈ For operations involving batch sliding-window inference and 3D projection with JAX on large scenes, high VRAM
|
169 |
|
170 |
```
|
171 |
val
|
@@ -180,7 +181,6 @@ val
|
|
180 |
The input data is structured by geographic zone, with RGB images, semantic masks, LiDAR scans, and camera pose files.
|
181 |
The structure of the GridNet-HD dataset remains the same (see [GridNet-HD dataset](https://huggingface.co/datasets/heig-vd-geo/GridNet-HD) for more information)
|
182 |
|
183 |
-
|
184 |
---
|
185 |
|
186 |
## Setup & Installation
|
@@ -227,28 +227,28 @@ Each mode is selected via the `--mode` argument in `main.py`.
|
|
227 |
|
228 |
### Results
|
229 |
|
230 |
-
The following table summarizes the per-class Intersection over Union (IoU) scores on the
|
231 |
-
|
232 |
-
| Class
|
233 |
-
|
234 |
-
| Pylon |
|
235 |
-
| Conductor cable |
|
236 |
-
| Structural cable |
|
237 |
-
| Insulator |
|
238 |
-
| High vegetation |
|
239 |
-
| Low vegetation |
|
240 |
-
| Herbaceous vegetation |
|
241 |
-
| Rock, gravel, soil |
|
242 |
-
| Impervious soil (Road) |
|
243 |
-
| Water |
|
244 |
-
| Building |
|
245 |
-
| **Mean IoU (mIoU)** | **
|
246 |
|
247 |
### Pretrained Weights
|
248 |
|
249 |
π **Pretrained weights** for the best performing model are available for download directly in this repo.
|
250 |
|
251 |
-
> This checkpoint corresponds to the model trained using the configuration in `config.yaml`, achieving a mean IoU of **
|
252 |
|
253 |
---
|
254 |
|
@@ -318,14 +318,13 @@ This project is open-sourced under the MIT License.
|
|
318 |
|
319 |
## Contact
|
320 |
|
321 |
-
For questions, issues, or contributions, please open an issue on the repository
|
322 |
-
|
323 |
|
324 |
---
|
325 |
|
326 |
## Citation
|
327 |
|
328 |
-
If you use this repo in research, please cite:
|
329 |
|
330 |
GridNet-HD: A High-Resolution Multi-Modal Dataset for LiDAR-Image Fusion on Power Line Infrastructure
|
331 |
Masked Authors
|
|
|
61 |
β βββ sliding_window.py # Core logic for windowed inference
|
62 |
β βββ export_logits.py # Export of softmax probabilities
|
63 |
βββ projection/
|
64 |
+
β βββ lidar_projection.py # Projection of predictions to LiDAR space
|
65 |
+
β βββ fast_proj.py # Utilities for projection (Agsoft conventions), accelerated with Jax
|
66 |
βββ utils/
|
67 |
β βββ logging_utils.py # Logging setup
|
68 |
β βββ metrics.py # Evaluation metrics (IoU, F1)
|
|
|
69 |
β βββ seed.py # Reproducibility utilities
|
70 |
+
βββ best_model.pth # Weights for best model
|
71 |
βββ requirements.txt # Python dependencies
|
72 |
```
|
73 |
|
|
|
164 |
| Transformers | π€ Transformers 4.51 |
|
165 |
| JAX | jax==0.6.0 |
|
166 |
| laspy | >= 2.0 |
|
167 |
+
| RAM | 256 GB (β₯ 64 GB recommended) |
|
168 |
|
169 |
+
β οΈ For operations involving batch sliding-window inference and 3D projection with JAX on large scenes, high VRAM is recommended, otherwise if CUDA OOM error, decrease:
|
170 |
|
171 |
```
|
172 |
val
|
|
|
181 |
The input data is structured by geographic zone, with RGB images, semantic masks, LiDAR scans, and camera pose files.
|
182 |
The structure of the GridNet-HD dataset remains the same (see [GridNet-HD dataset](https://huggingface.co/datasets/heig-vd-geo/GridNet-HD) for more information)
|
183 |
|
|
|
184 |
---
|
185 |
|
186 |
## Setup & Installation
|
|
|
227 |
|
228 |
### Results
|
229 |
|
230 |
+
The following table summarizes the per-class Intersection over Union (IoU) scores on the test set at 3D level. The model was trained using the configuration specified in `config.yaml`.
|
231 |
+
|
232 |
+
| Class | IoU (Test set) (%)|
|
233 |
+
|---------------------------|------------|
|
234 |
+
| Pylon | 85.09 |
|
235 |
+
| Conductor cable | 64.82 |
|
236 |
+
| Structural cable | 45.06 |
|
237 |
+
| Insulator | 71.07 |
|
238 |
+
| High vegetation | 83.86 |
|
239 |
+
| Low vegetation | 63.43 |
|
240 |
+
| Herbaceous vegetation | 84.45 |
|
241 |
+
| Rock, gravel, soil | 38.62 |
|
242 |
+
| Impervious soil (Road) | 80.69 |
|
243 |
+
| Water | 74.87 |
|
244 |
+
| Building | 68.09 |
|
245 |
+
| **Mean IoU (mIoU)** | **69.10** |
|
246 |
|
247 |
### Pretrained Weights
|
248 |
|
249 |
π **Pretrained weights** for the best performing model are available for download directly in this repo.
|
250 |
|
251 |
+
> This checkpoint corresponds to the model trained using the configuration in `config.yaml`, achieving a mean IoU of **69.10%** on test set.
|
252 |
|
253 |
---
|
254 |
|
|
|
318 |
|
319 |
## Contact
|
320 |
|
321 |
+
For questions, issues, or contributions, please open an issue on the repository.
|
|
|
322 |
|
323 |
---
|
324 |
|
325 |
## Citation
|
326 |
|
327 |
+
If you use this repo in research, please cite:
|
328 |
|
329 |
GridNet-HD: A High-Resolution Multi-Modal Dataset for LiDAR-Image Fusion on Power Line Infrastructure
|
330 |
Masked Authors
|
config.yaml
CHANGED
@@ -2,7 +2,7 @@ data:
|
|
2 |
# Root folder containing your sub-folders (t1z4, t2z5, etc.)
|
3 |
root_dir: "/path/to/GridNet-HD"
|
4 |
# JSON split file listing train/val/test folders
|
5 |
-
split_file: "/path/to/split.json"
|
6 |
# First resize each image+mask
|
7 |
resize_size: [1760, 1318] # PIL style (width, height)
|
8 |
# Then random-crop (train) or sliding-window (val/test) to this size (H, W)
|
@@ -54,7 +54,6 @@ model:
|
|
54 |
training:
|
55 |
# Where to save checkpoints & logs
|
56 |
output_dir: "./outputs/run"
|
57 |
-
# Random seed for reproducibility
|
58 |
seed: 42
|
59 |
# Batch size for training
|
60 |
batch_size: 32
|
@@ -73,7 +72,7 @@ training:
|
|
73 |
val:
|
74 |
batch_size: 8 # number of images per batch
|
75 |
num_workers: 8
|
76 |
-
batch_size_proj:
|
77 |
|
78 |
|
79 |
# =============================================================================
|
|
|
2 |
# Root folder containing your sub-folders (t1z4, t2z5, etc.)
|
3 |
root_dir: "/path/to/GridNet-HD"
|
4 |
# JSON split file listing train/val/test folders
|
5 |
+
split_file: "/path/to/GridNet-HD/split.json"
|
6 |
# First resize each image+mask
|
7 |
resize_size: [1760, 1318] # PIL style (width, height)
|
8 |
# Then random-crop (train) or sliding-window (val/test) to this size (H, W)
|
|
|
54 |
training:
|
55 |
# Where to save checkpoints & logs
|
56 |
output_dir: "./outputs/run"
|
|
|
57 |
seed: 42
|
58 |
# Batch size for training
|
59 |
batch_size: 32
|
|
|
72 |
val:
|
73 |
batch_size: 8 # number of images per batch
|
74 |
num_workers: 8
|
75 |
+
batch_size_proj: 5000000 # number of points per batch to project on images
|
76 |
|
77 |
|
78 |
# =============================================================================
|
main.py
CHANGED
@@ -153,7 +153,7 @@ def main():
|
|
153 |
model.load_state_dict(torch.load(args.weights_path))
|
154 |
inference(model, val_loader, device, ds_args["crop_size"], ds_args["crop_size"],
|
155 |
out_dir / "predictions")
|
156 |
-
|
157 |
conf_mat = np.zeros((cfg["model"]["num_classes"], cfg["model"]["num_classes"]), dtype=int)
|
158 |
for zone in sorted(os.listdir(out_dir / "predictions")):
|
159 |
output_las_path = out_dir / "predictions" / zone / f"{zone}_with_classif.las"
|
|
|
153 |
model.load_state_dict(torch.load(args.weights_path))
|
154 |
inference(model, val_loader, device, ds_args["crop_size"], ds_args["crop_size"],
|
155 |
out_dir / "predictions")
|
156 |
+
logging.info(f"Inference Image complete. Predictions saved to {out_dir/'predictions'}")
|
157 |
conf_mat = np.zeros((cfg["model"]["num_classes"], cfg["model"]["num_classes"]), dtype=int)
|
158 |
for zone in sorted(os.listdir(out_dir / "predictions")):
|
159 |
output_las_path = out_dir / "predictions" / zone / f"{zone}_with_classif.las"
|
requirements.txt
CHANGED
@@ -10,6 +10,8 @@ GitPython==3.1.44
|
|
10 |
huggingface-hub==0.30.2
|
11 |
idna==3.10
|
12 |
jax==0.6.0
|
|
|
|
|
13 |
jaxlib==0.6.0
|
14 |
Jinja2==3.1.6
|
15 |
joblib==1.5.0
|
@@ -21,9 +23,10 @@ networkx==3.4.2
|
|
21 |
numpy==2.2.5
|
22 |
nvidia-cublas-cu12==12.6.4.1
|
23 |
nvidia-cuda-cupti-cu12==12.6.80
|
|
|
24 |
nvidia-cuda-nvrtc-cu12==12.6.77
|
25 |
nvidia-cuda-runtime-cu12==12.6.77
|
26 |
-
nvidia-cudnn-cu12==9.
|
27 |
nvidia-cufft-cu12==11.3.0.4
|
28 |
nvidia-cufile-cu12==1.11.1.6
|
29 |
nvidia-curand-cu12==10.3.7.77
|
|
|
10 |
huggingface-hub==0.30.2
|
11 |
idna==3.10
|
12 |
jax==0.6.0
|
13 |
+
jax-cuda12-pjrt==0.6.0
|
14 |
+
jax-cuda12-plugin==0.6.0
|
15 |
jaxlib==0.6.0
|
16 |
Jinja2==3.1.6
|
17 |
joblib==1.5.0
|
|
|
23 |
numpy==2.2.5
|
24 |
nvidia-cublas-cu12==12.6.4.1
|
25 |
nvidia-cuda-cupti-cu12==12.6.80
|
26 |
+
nvidia-cuda-nvcc-cu12==12.9.41
|
27 |
nvidia-cuda-nvrtc-cu12==12.6.77
|
28 |
nvidia-cuda-runtime-cu12==12.6.77
|
29 |
+
nvidia-cudnn-cu12==9.10.0.56
|
30 |
nvidia-cufft-cu12==11.3.0.4
|
31 |
nvidia-cufile-cu12==1.11.1.6
|
32 |
nvidia-curand-cu12==10.3.7.77
|