diff --git a/packages/child-lab-cli/hello.py b/packages/child-lab-cli/hello.py deleted file mode 100644 index 8b137891..00000000 --- a/packages/child-lab-cli/hello.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/child-lab-cli/pyproject.toml b/packages/child-lab-cli/pyproject.toml index 4c545b82..1508742d 100644 --- a/packages/child-lab-cli/pyproject.toml +++ b/packages/child-lab-cli/pyproject.toml @@ -4,4 +4,31 @@ version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12.7" -dependencies = [] +dependencies = [ + "click>=8.1.8", + "pyserde>=0.23.0", + "torch>=2.6.0", + "tqdm>=4.67.1", + "viser>=0.2.23", + "child-lab-visualization", + "child-lab-procedures", + "depth-estimation", + "marker-detection", + "transformation-buffer", + "video-io", +] + +[tool.uv.sources] +child-lab-procedures = { workspace = true } +child-lab-visualization = { workspace = true } +depth-estimation = { workspace = true } +marker-detection = { workspace = true } +transformation-buffer = { workspace = true } +video-io = { workspace = true } + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project.scripts] +child-lab = "child_lab_cli:child_lab" diff --git a/packages/child-lab-cli/src/child_lab_cli/__init__.py b/packages/child-lab-cli/src/child_lab_cli/__init__.py new file mode 100644 index 00000000..8e4b122a --- /dev/null +++ b/packages/child-lab-cli/src/child_lab_cli/__init__.py @@ -0,0 +1,28 @@ +import click + +from .commands import ( + calibrate_camera, + estimate_transformations, + generate_pointcloud, + process, + video, + visualize, + workspace, +) + + +@click.group('child-lab') +def cli() -> None: ... + + +cli.add_command(calibrate_camera) +cli.add_command(estimate_transformations) +cli.add_command(generate_pointcloud) +cli.add_command(process) +cli.add_command(video) +cli.add_command(visualize) +cli.add_command(workspace) + + +def child_lab() -> None: + cli(max_content_width=120) diff --git a/packages/child-lab-cli/src/child_lab_cli/commands/__init__.py b/packages/child-lab-cli/src/child_lab_cli/commands/__init__.py new file mode 100644 index 00000000..33f10391 --- /dev/null +++ b/packages/child-lab-cli/src/child_lab_cli/commands/__init__.py @@ -0,0 +1,17 @@ +from .calibrate_camera import calibrate_camera +from .estimate_transformations import estimate_transformations +from .generate_pointcloud import generate_pointcloud +from .process import process +from .video import video +from .visualize import visualize +from .workspace import workspace + +__all__ = [ + 'calibrate_camera', + 'estimate_transformations', + 'generate_pointcloud', + 'process', + 'video', + 'visualize', + 'workspace', +] diff --git a/packages/child-lab-cli/src/child_lab_cli/commands/calibrate_camera.py b/packages/child-lab-cli/src/child_lab_cli/commands/calibrate_camera.py new file mode 100644 index 00000000..8ae551c4 --- /dev/null +++ b/packages/child-lab-cli/src/child_lab_cli/commands/calibrate_camera.py @@ -0,0 +1,110 @@ +from pathlib import Path + +import click +from child_lab_procedures.calibrate_camera import Configuration, Procedure, VideoIoContext +from marker_detection.chessboard import BoardProperties, VisualizationContext +from serde.yaml import to_yaml +from tqdm import trange +from video_io import Reader, Visualizer, Writer + +from child_lab_cli.workspace.model import Workspace + + +@click.command('calibrate-camera', options_metavar='') +@click.argument('workspace-root', type=Path, metavar='') +@click.argument('video-name', type=str, metavar='