Skip to content

Commit

Permalink
log all images to one directory (#159)
Browse files Browse the repository at this point in the history
* log all images to one directory

* variable naming, spacing, and quotes

* changed string formatting

* double quotes

* Remove ZP input legacy code from 2022 competition (#161)

* Fix position and orientation usage in main_2024.py (#162)

---------

Co-authored-by: Xierumeng <[email protected]>
  • Loading branch information
TongguangZhang and Xierumeng authored Jan 30, 2024
1 parent ab2c310 commit e63b90e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 12 additions & 10 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

queue_max_size: 10

log_directory_path: "logs"

video_input:
camera_name: 0
worker_period: 1.0 # seconds
save_prefix: "log_image"
camera_name: 0
worker_period: 1.0 # seconds
save_prefix: "log_image"

detect_target:
worker_count: 1
device: 0
model_path: "tests/model_example/yolov8s_ultralytics_pretrained_default.pt" # TODO: update
save_prefix: "log_comp"
worker_count: 1
device: 0
model_path: "tests/model_example/yolov8s_ultralytics_pretrained_default.pt" # TODO: update
save_prefix: "log_comp"

flight_interface:
address: "tcp:127.0.0.1:14550"
timeout: 10.0 # seconds
worker_period: 0.1 # seconds
address: "tcp:127.0.0.1:14550"
timeout: 10.0 # seconds
worker_period: 0.1 # seconds
10 changes: 8 additions & 2 deletions main_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ def main() -> int:
try:
QUEUE_MAX_SIZE = config["queue_max_size"]

LOG_DIRECTORY_PATH = config["log_directory_path"]

VIDEO_INPUT_CAMERA_NAME = config["video_input"]["camera_name"]
VIDEO_INPUT_WORKER_PERIOD = config["video_input"]["worker_period"]
VIDEO_INPUT_SAVE_PREFIX = config["video_input"]["save_prefix"]
VIDEO_INPUT_SAVE_NAME_PREFIX = config["video_input"]["save_prefix"]
VIDEO_INPUT_SAVE_PREFIX = f"{LOG_DIRECTORY_PATH}/{VIDEO_INPUT_SAVE_NAME_PREFIX}"

DETECT_TARGET_WORKER_COUNT = config["detect_target"]["worker_count"]
DETECT_TARGET_DEVICE = "cpu" if args.cpu else config["detect_target"]["device"]
DETECT_TARGET_MODEL_PATH = config["detect_target"]["model_path"]
DETECT_TARGET_OVERRIDE_FULL_PRECISION = args.full
DETECT_TARGET_SAVE_PREFIX = config["detect_target"]["save_prefix"]
DETECT_TARGET_SAVE_NAME_PREFIX = config["detect_target"]["save_prefix"]
DETECT_TARGET_SAVE_PREFIX = f"{LOG_DIRECTORY_PATH}/{DETECT_TARGET_SAVE_NAME_PREFIX}"

FLIGHT_INTERFACE_ADDRESS = config["flight_interface"]["address"]
FLIGHT_INTERFACE_TIMEOUT = config["flight_interface"]["timeout"]
Expand All @@ -68,6 +72,8 @@ def main() -> int:
print("Config key(s) not found")
return -1

pathlib.Path(LOG_DIRECTORY_PATH).mkdir(exist_ok=True)

# Setup
controller = worker_controller.WorkerController()

Expand Down

0 comments on commit e63b90e

Please sign in to comment.