Spaces:
Build error
Build error
Download downsample.py from ICML2022/PointCloudC: direct link, hf CLI and curl.
- Browser
- Download file 328 Bytes
-
https://huggingface.co/spaces/ICML2022/PointCloudC/resolve/refs%2Fpr%2F1/downsample.py
- Command line
-
hf download hf://spaces/ICML2022/PointCloudC@refs/pr/1/downsample.py
-
curl -L -o downsample.py https://huggingface.co/spaces/ICML2022/PointCloudC/resolve/refs%2Fpr%2F1/downsample.py
328 Bytes
| import glob | |
| import h5py | |
| for fpath in glob.glob('modelnet_c/*.h5'): | |
| f = h5py.File(fpath) | |
| data = f['data'][:].astype('float32') | |
| label = f['label'][:].astype('int64') | |
| f.close() | |
| f = h5py.File(fpath, 'w') | |
| f.create_dataset('data', data=data[:100]) | |
| f.create_dataset('label', data=label[:100]) | |
| f.close() |