loki200519 commited on
Commit
7c1e6a1
·
verified ·
1 Parent(s): a0d42e7

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. config.json +42 -0
  2. inference_example.py +15 -0
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "Physics-Informed UNet++",
3
+ "task": "Disaster Risk Segmentation",
4
+ "architecture": {
5
+ "backbone": "UNet++",
6
+ "encoder": "resnet34",
7
+ "in_channels": 32,
8
+ "out_channels": 1,
9
+ "film_dim": 32,
10
+ "dropout_p": 0.016687189127500446
11
+ },
12
+ "training": {
13
+ "best_val_iou": 1.0,
14
+ "optimizer": "AdamW",
15
+ "learning_rate": 4.7031995111855064e-05,
16
+ "weight_decay": 0.00025303130757493825,
17
+ "batch_size": 8,
18
+ "epochs": 50,
19
+ "mixed_precision": "FP16"
20
+ },
21
+ "inference": {
22
+ "input_shape": [
23
+ 1,
24
+ 32,
25
+ 512,
26
+ 512
27
+ ],
28
+ "output": "probability_map",
29
+ "recommended_threshold": 0.000175
30
+ },
31
+ "framework": {
32
+ "library": "PyTorch",
33
+ "torch_version": "2.x",
34
+ "export_formats": [
35
+ "TorchScript",
36
+ "ONNX"
37
+ ]
38
+ },
39
+ "license": "Apache-2.0",
40
+ "author": "Lokesh Reddy Poreddy",
41
+ "repository": "https://huggingface.co/loki200519/urop"
42
+ }
inference_example.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ # Load TorchScript model
4
+ model = torch.jit.load("model_logits_traced.pt")
5
+ model.eval()
6
+
7
+ # Dummy input (B, C, H, W)
8
+ x = torch.randn(1, 32, 512, 512)
9
+
10
+ with torch.no_grad():
11
+ y = model(x)
12
+
13
+ print("Inference successful!")
14
+ print("Output shape:", y.shape)
15
+ print("Min/Max:", y.min().item(), y.max().item())