add simple CLI directly to package, related to #8

This commit was merged in pull request #9.
This commit is contained in:
2025-10-24 13:03:27 +02:00
parent 1920d01607
commit dd40440843
5 changed files with 51 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
"""main pipeline interface for external calls"""
from dopt_sensor_anomalies import detection

View File

@@ -0,0 +1,33 @@
import argparse
from typing import cast
from dopt_sensor_anomalies import _interface
from dopt_sensor_anomalies.types import CliArgs
def main() -> None:
parser = argparse.ArgumentParser(
description=("simple CLI tool to analyse single sensor images for anomalies")
)
parser.add_argument(
"img_path",
help="file path to the image which is to be analysed",
type=str,
)
parser.add_argument(
"calib_value_x",
help="calibration value in pixels per mcm for x axis",
type=float,
)
parser.add_argument(
"calib_value_y",
help="calibration value in pixels per mcm for y axis",
type=float,
)
args = cast(CliArgs, parser.parse_args())
_interface.sensor_anomalies_detection(
args.img_path,
args.calib_value_x,
args.calib_value_y,
)

View File

@@ -25,3 +25,10 @@ class SensorImages(TypedDict):
class DetectionModels(TypedDict):
left: Path
right: Path
@dc.dataclass()
class CliArgs:
img_path: str
calib_value_x: float
calib_value_y: float