Spaces:
Build error
Build error
Ren Jiawei
commited on
Commit
·
1c55e0d
1
Parent(s):
07bc76b
update
Browse files
app.py
CHANGED
|
@@ -19,14 +19,14 @@ with open('shape_names.txt') as f:
|
|
| 19 |
|
| 20 |
model_gda = GDANET()
|
| 21 |
model_gda = nn.DataParallel(model_gda)
|
| 22 |
-
model_gda.load_state_dict(torch.load('./GDANet_WOLFMix.t7', map_location=torch.device('cpu')))
|
| 23 |
-
|
| 24 |
model_gda.eval()
|
| 25 |
|
| 26 |
model_dgcnn = DGCNN()
|
| 27 |
model_dgcnn = nn.DataParallel(model_dgcnn)
|
| 28 |
-
model_dgcnn.load_state_dict(torch.load('./dgcnn.t7', map_location=torch.device('cpu')))
|
| 29 |
-
|
| 30 |
model_dgcnn.eval()
|
| 31 |
|
| 32 |
def pyplot_draw_point_cloud(points, corruption):
|
|
@@ -68,11 +68,11 @@ def load_dataset(corruption_idx, severity):
|
|
| 68 |
]
|
| 69 |
corruption_type = corruptions[corruption_idx]
|
| 70 |
if corruption_type == 'clean':
|
| 71 |
-
f = h5py.File(osp.join('modelnet_c', corruption_type + '.h5'))
|
| 72 |
-
|
| 73 |
else:
|
| 74 |
-
f = h5py.File(osp.join('modelnet_c', corruption_type + '_{}'.format(severity-1) + '.h5'))
|
| 75 |
-
|
| 76 |
data = f['data'][:].astype('float32')
|
| 77 |
label = f['label'][:].astype('int64')
|
| 78 |
f.close()
|
|
@@ -98,16 +98,15 @@ def run(seed, corruption_idx, severity):
|
|
| 98 |
|
| 99 |
description = """
|
| 100 |
|
| 101 |
-
Welcome to the demo of PointCloud-C! PointCloud-C is
|
| 102 |
-
|
| 103 |
-
In this demo, you may:
|
| 104 |
|
| 105 |
- __Visualize__ various types of corrupted point clouds in [ModelNet-C](https://github.com/jiawei-ren/ModelNet-C).
|
| 106 |
|
| 107 |
- __Compare__ our proposed techniques to the baseline in terms of prediction robustness.
|
| 108 |
|
| 109 |
-
For more details, checkout our paper [Benchmarking and Analyzing Point Cloud Classification under Corruptions, __ICML 2022__](https://arxiv.org/abs/2202.03377)
|
| 110 |
|
|
|
|
| 111 |
"""
|
| 112 |
|
| 113 |
|
|
|
|
| 19 |
|
| 20 |
model_gda = GDANET()
|
| 21 |
model_gda = nn.DataParallel(model_gda)
|
| 22 |
+
# model_gda.load_state_dict(torch.load('./GDANet_WOLFMix.t7', map_location=torch.device('cpu')))
|
| 23 |
+
model_gda.load_state_dict(torch.load('/Users/renjiawei/Downloads/pretrained_models/GDANet_WOLFMix.t7', map_location=torch.device('cpu')))
|
| 24 |
model_gda.eval()
|
| 25 |
|
| 26 |
model_dgcnn = DGCNN()
|
| 27 |
model_dgcnn = nn.DataParallel(model_dgcnn)
|
| 28 |
+
# model_dgcnn.load_state_dict(torch.load('./dgcnn.t7', map_location=torch.device('cpu')))
|
| 29 |
+
model_dgcnn.load_state_dict(torch.load('/Users/renjiawei/Downloads/pretrained_models/dgcnn.t7', map_location=torch.device('cpu')))
|
| 30 |
model_dgcnn.eval()
|
| 31 |
|
| 32 |
def pyplot_draw_point_cloud(points, corruption):
|
|
|
|
| 68 |
]
|
| 69 |
corruption_type = corruptions[corruption_idx]
|
| 70 |
if corruption_type == 'clean':
|
| 71 |
+
# f = h5py.File(osp.join('modelnet_c', corruption_type + '.h5'))
|
| 72 |
+
f = h5py.File(osp.join('/Users/renjiawei/Downloads/modelnet_c', corruption_type + '.h5'))
|
| 73 |
else:
|
| 74 |
+
# f = h5py.File(osp.join('modelnet_c', corruption_type + '_{}'.format(severity-1) + '.h5'))
|
| 75 |
+
f = h5py.File(osp.join('/Users/renjiawei/Downloads/modelnet_c', corruption_type + '_{}'.format(severity - 1) + '.h5'))
|
| 76 |
data = f['data'][:].astype('float32')
|
| 77 |
label = f['label'][:].astype('int64')
|
| 78 |
f.close()
|
|
|
|
| 98 |
|
| 99 |
description = """
|
| 100 |
|
| 101 |
+
Welcome to the demo of PointCloud-C! [PointCloud-C](https://pointcloud-c.github.io/home.html) is a test-suite for point cloud robustness analysis under corruptions. In this demo, you may:
|
|
|
|
|
|
|
| 102 |
|
| 103 |
- __Visualize__ various types of corrupted point clouds in [ModelNet-C](https://github.com/jiawei-ren/ModelNet-C).
|
| 104 |
|
| 105 |
- __Compare__ our proposed techniques to the baseline in terms of prediction robustness.
|
| 106 |
|
| 107 |
+
For more details, checkout our paper [Benchmarking and Analyzing Point Cloud Classification under Corruptions, __ICML 2022__](https://arxiv.org/abs/2202.03377)!
|
| 108 |
|
| 109 |
+
📣 News: [The first PointCloud-C challenge](https://codalab.lisn.upsaclay.fr/competitions/6437) with Classification track and Part Segmentation track in [ECCV'22 SenseHuman workshop](https://sense-human.github.io/) is open for submission now!
|
| 110 |
"""
|
| 111 |
|
| 112 |
|