Open lelouedec opened 5 years ago
you can use ipython and run v.get('selected') periodically. I made a annotation class for handyness..
class save_annotation():
def __init__(self, data, filename="hogehoge"):
self.v = pptk.viewer(data)
self.data = data
self.filename=filename
def check(self):
"""
check annotation
"""
color = []
ann = []
# check
for i, points in enumerate(self.annotation):
ann.extend(denoisedlidardata[points])
color.extend(i*10*np.ones(len(points)))
pptk.viewer(ann, color)
def save(self):
np.save(self.filename, self.annotation)
def add(self):
self.annotation.append(self.v.get("selected"))
annotater = save_annotation(data)
you can add annotations by
annotater.add()
after selecting stuff.
you can also check and save your annotations too.
It seems to be impossible to use the viewer and run an infinite loop in charge of getting selected points. I want to use pptk to annotate point clouds for segmentation, however when ever I start the viewer and try in a loop to get the selected points and adding them to an array when the number of points is greater than 0, the viewer freeze not allowing me to select anything and crashes. Any idea how to get a non blocking visualization where I can do somethings else while keeping the viewer up ? What I got until now :