generated from dopt-python/py311
add simple CLI directly to package, related to #8
This commit was merged in pull request #9.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"""main pipeline interface for external calls"""
|
||||
|
||||
from dopt_sensor_anomalies import detection
|
||||
|
||||
|
||||
33
src/dopt_sensor_anomalies/cli.py
Normal file
33
src/dopt_sensor_anomalies/cli.py
Normal 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,
|
||||
)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user