50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Shim for the Orisys finger Qt dashboard (see examples/gui/)."""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
os.environ.setdefault("OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS", "0")
|
|
|
|
_EXAMPLES_DIR = Path(__file__).resolve().parents[1] / "examples"
|
|
if str(_EXAMPLES_DIR) not in sys.path:
|
|
sys.path.insert(0, str(_EXAMPLES_DIR))
|
|
|
|
from argparse import Namespace
|
|
|
|
from gui import run_dashboard
|
|
from pipeline import PipelineConfig
|
|
|
|
|
|
def main():
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser(description="Orisys finger Qt dashboard")
|
|
parser.add_argument("--video", "-v", type=str, default="0")
|
|
parser.add_argument("--config", "-c", type=str, default="./config/dd02-ov.json")
|
|
parser.add_argument("--cal", type=str, default="")
|
|
parser.add_argument("--verbose", action="store_true")
|
|
parser.add_argument("--cutoff", type=float, default=10.0)
|
|
parser.add_argument("--no-3d", action="store_true")
|
|
args = parser.parse_args()
|
|
|
|
config = PipelineConfig.from_args(
|
|
Namespace(
|
|
video=args.video,
|
|
config=args.config,
|
|
cal=args.cal,
|
|
verbose=args.verbose,
|
|
mesh_map="depth",
|
|
threshold=None,
|
|
viz_pose="assets/finger/visualization/world_to_cam.npy",
|
|
no_3d=args.no_3d,
|
|
cutoff=args.cutoff,
|
|
)
|
|
)
|
|
sys.exit(run_dashboard(config))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|