pandaset-devkit icon indicating copy to clipboard operation
pandaset-devkit copied to clipboard

Unloading fix

Open dkoguciuk opened this issue 4 years ago • 3 comments

Now unloading a sequence does not delete the information about the sequence from the dataset - it just release the loaded data.

dkoguciuk avatar Nov 23 '20 13:11 dkoguciuk

@ltriess could you have a look at it? It's related to #76

dkoguciuk avatar Nov 23 '20 13:11 dkoguciuk

Ah, and a use case:

Previously, this code gives first iteration over the whole dataset, then no iteration, since the information about the sequences was gone:

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

for sequence in dataset.sequences():     # Empty list of sequences
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

And now it's possible to iterate over the dataset multiple times, without reinitializing dataset variable:

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

dkoguciuk avatar Nov 23 '20 13:11 dkoguciuk

Looks like a better fix to me. I think @xpchuan-95 can merge it?

Still it would be better to not have to re-initialize the sequence or to not even need this unloading mechanism at all. But I guess this would require a new loading concept, therefore the solutions provided by this pull request and #76 are sufficient enough for a fix.

ltriess avatar Nov 23 '20 14:11 ltriess