Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how was octree generated? #4

Open
junmeng6025 opened this issue Apr 3, 2024 · 2 comments
Open

how was octree generated? #4

junmeng6025 opened this issue Apr 3, 2024 · 2 comments

Comments

@junmeng6025
Copy link

junmeng6025 commented Apr 3, 2024

Hi, thanks for the brilliant work first!

I'm a bit confused about how was octree generated. In classification.py it seems that octree already exists in the batch dictionary,

def forward(self, batch):
    octree, label = batch['octree'].cuda(), batch['label'].cuda()
    data = self.get_input_feature(octree)
    logits = self.model(data, octree, octree.depth)
    log_softmax = F.log_softmax(logits, dim=1)
    loss = F.nll_loss(log_softmax, label)
    pred = torch.argmax(logits, dim=1)
    accu = pred.eq(label).float().mean()
    return loss, accu

which looks like something from dataset.

But logically octree is generated upon the input point cloud, rather than being provided along with dataset. Could you explain the origin outcoming of octree, i.e. when/in which script was it generated and written into batch dict? Thanks a lot!

@Aristo23333
Copy link
Collaborator

Hi, thanks for the brilliant work first!

I'm a bit confused about how was octree generated. In classification.py it seems that octree already exists in the batch dictionary,

def forward(self, batch):
    octree, label = batch['octree'].cuda(), batch['label'].cuda()
    data = self.get_input_feature(octree)
    logits = self.model(data, octree, octree.depth)
    log_softmax = F.log_softmax(logits, dim=1)
    loss = F.nll_loss(log_softmax, label)
    pred = torch.argmax(logits, dim=1)
    accu = pred.eq(label).float().mean()
    return loss, accu

which looks like something from dataset.

But logically octree is generated upon the input point cloud, rather than being provided along with dataset. Could you explain the origin outcoming of octree, i.e. when/in which script was it generated and written into batch dict? Thanks a lot!

Hello, thank you very much for your interest in our work! We have referenced the design of our baseline, Octformer (https://arxiv.org/abs/2305.03045), for the specific implementation of our octree. The specific implementation code can be found in the ocnn library mentioned in requirement.txt. Indeed, I think as you said, the octree is added to the batch as a static dictionary.

My understanding is that the octree is statically defined in the batch you mentioned, and then instantiated with the input point cloud features in the following part in classification.py:

  def get_input_feature(self, octree):
    flags = self.FLAGS.MODEL
    octree_feature = ocnn.modules.InputFeature(flags.feature, flags.nempty)
    data = octree_feature(octree)
    return data

For further understanding, perhaps you could refer to Octformer.

@BEFLIPPED
Copy link

Hello, I have a confused question as follows.
In this project, How is the static dictionary batch defined and where is it defined ?
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants