Skip to content

Instantly share code, notes, and snippets.

@dilaragokay
Created December 18, 2020 13:03
Show Gist options
  • Save dilaragokay/34c40b0b41fe6d4207e3ea72ad043411 to your computer and use it in GitHub Desktop.
Save dilaragokay/34c40b0b41fe6d4207e3ea72ad043411 to your computer and use it in GitHub Desktop.
Analyze the flow of points in FlyingThings3D dataset
'''
Finds number of points which do not move for each point cloud in FlyingThings3D dataset.
'''
import numpy as np
import os
root = "./data_processed_maxcut_35_20k_2k_8192"
for file in os.listdir(root):
if file.endswith(".npz"):
path = os.path.join(root, file)
with open(path, 'rb') as fp:
data = np.load(fp)
flow = data['flow'].astype('float32')
stationary = [point for point in flow if np.linalg.norm(point) < 0.001]
if len(stationary) != 0:
print("{} points in {} are stationary.".format(len(stationary), file))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment