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

Nacho/fix generic dataloader #139

Merged
merged 5 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions python/kiss_icp/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def available_dataloaders() -> List:
return [name for _, name, _ in pkgutil.iter_modules([pkgpath])]


def jumpable_dataloaders():
_jumpable_dataloaders = available_dataloaders()
_jumpable_dataloaders.remove("mcap")
_jumpable_dataloaders.remove("ouster")
_jumpable_dataloaders.remove("rosbag")
return _jumpable_dataloaders


def dataloader_types() -> Dict:
import ast
import importlib
Expand Down
7 changes: 6 additions & 1 deletion python/kiss_icp/tools/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from kiss_icp.datasets import (
available_dataloaders,
jumpable_dataloaders,
sequence_dataloaders,
supported_file_extensions,
)
Expand Down Expand Up @@ -56,7 +57,7 @@ def guess_dataloader(data: Path, default_dataloader: str):
bagfiles = [Path(path) for path in glob.glob(os.path.join(data, "*.bag"))]
if len(bagfiles) > 0:
return "rosbag", bagfiles
return default_dataloader
return default_dataloader, data


def version_callback(value: bool):
Expand Down Expand Up @@ -207,6 +208,10 @@ def kiss_icp_pipeline(
print('You must specify a sequence "--sequence"')
raise typer.Exit(code=1)

if jump != 0 and dataloader not in jumpable_dataloaders():
print(f"[WARNING] '{dataloader}' does not support '--jump', starting from first frame")
jump = 0

# Lazy-loading for faster CLI
from kiss_icp.datasets import dataset_factory
from kiss_icp.pipeline import OdometryPipeline
Expand Down