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

easier to modify processing mode with command line args #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
20 changes: 17 additions & 3 deletions rta2_cv2visual.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import os
"""Main Visualization Program for RTA2 Project.

Flags: -v, --video_mode: process video file (default)
-f, --frame_mode: process frames in directory
"""
import cv2
import json
import os
import time
from typing import Tuple
import yaml
import sys
from radar_points import RadarData, StaticPoints
from preprocess import *
from radar_clustering import *

# -------------- SET VISUALIZATION MODE --------------- #

mode = "frame_mode" # process live image frames
# mode = "frame_mode" # process live image frames
# mode = "video_mode" # process video file
if len(sys.argv) > 1:
if sys.argv[1] == "-v" or sys.argv[1] == "--video_mode":
mode = "video_mode"
elif sys.argv[1] == "-f" or sys.argv[1] == "--frame_mode":
mode = "frame_mode"
else:
raise ValueError(f"Invalid argument: {sys.argv[1]}")
else:
mode = "video_mode"

# ------------------ DATA PREPROCESS ------------------ #
# load configuration
Expand Down