Skip to content

Commit

Permalink
version 0.12.1
Browse files Browse the repository at this point in the history
- "--out_csv_dir" and "--out_prefix" removed
- FCW_MIDDLEWARE_TASK_ID
- extended_measuring enabled with middleware client
- Measuring used in fcw_example.py
  • Loading branch information
klepo committed May 16, 2024
1 parent 656caa6 commit 7c4f287
Show file tree
Hide file tree
Showing 13 changed files with 414 additions and 366 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cd CollisionWarningService
docker build -f docker/fcw_service.Dockerfile -t but5gera/fcw_service:latest .
```
Download sample files:\
https://raw.githubusercontent.com/5G-ERA/CollisionWarningService/main/config/video3.mp4 \
https://raw.githubusercontent.com/5G-ERA/CollisionWarningService/main/videos/video3.mp4 \
https://raw.githubusercontent.com/5G-ERA/CollisionWarningService/main/config/video3.yaml \
https://raw.githubusercontent.com/5G-ERA/CollisionWarningService/main/config/config.yaml

Expand Down Expand Up @@ -121,7 +121,7 @@ docker run -p 5896:5896 -p 8554:8554 --network host --gpus all but5gera/fcw_serv

#### Local startup

The FCW service can also be started locally using [fcw-service/interface.py](fcw/service/interface.py),
The FCW service can also be started locally using [fcw-service/interface.py](fcw-service/fcw_service/interface.py),
but the fcw-service package must be installed and the NETAPP_PORT environment
variable should be set (default is 5896).
Run FCW service in same virtual environment as standalone example:
Expand Down
6 changes: 1 addition & 5 deletions fcw-client/examples/fcw_client_python/client_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
CAMERA_CONFIG_FILE = Path("../../../videos/video3.yaml")
# CAMERA_CONFIG_FILE = Path("../../../videos/bringauto.yaml")

# stopped flag for SIGTERM handler (stopping video frames sending).
# Stopped flag for SIGTERM handler (stopping video frames sending).
stopped = False
collision_warning_client: Optional[CollisionWarningClient] = None

Expand Down Expand Up @@ -66,10 +66,6 @@ def main() -> None:
)
parser.add_argument("-c", "--config", type=Path, help="Collision warning config", default=CONFIG_FILE)
parser.add_argument("--camera", type=Path, help="Camera settings", default=CAMERA_CONFIG_FILE)
parser.add_argument("-o", "--out_csv_dir", type=str, help="Output CSV dir", default=None)
parser.add_argument(
"-p", "--out_prefix", type=str, help="Prefix of output csv file with measurements", default=None
)
parser.add_argument("-t", "--play_time", type=int, help="Video play time in seconds", default=5000)
parser.add_argument("--fps", type=int, help="Video FPS", default=None)
parser.add_argument("source_video", type=str, help="Video stream (file or url)", nargs="?", default=TEST_VIDEO_FILE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Testing video file.
TEST_VIDEO_FILE = str("../../../videos/video3.mp4")
# TEST_VIDEO_FILE = str("rtsp://127.0.0.1:8554/webcam.h264")
# TEST_VIDEO_FILE = str("../../../videos/bringauto_2023-03-20.mp4")
# TEST_VIDEO_FILE = str("../../../videos/bringauto_2023-03-20_short.mp4")

# Testing configuration of the algorithm.
CONFIG_FILE = Path("../../../config/config.yaml")
Expand All @@ -46,7 +46,9 @@
# Middleware password.
MIDDLEWARE_PASSWORD = str(os.getenv("MIDDLEWARE_PASSWORD", "password"))
# Middleware Network Application ID (task ID).
MIDDLEWARE_TASK_ID = str(os.getenv("MIDDLEWARE_TASK_ID", "00000000-0000-0000-0000-000000000000"))
MIDDLEWARE_TASK_ID = str(
os.getenv("FCW_MIDDLEWARE_TASK_ID", str(os.getenv("MIDDLEWARE_TASK_ID", "00000000-0000-0000-0000-000000000000")))
)
# Middleware robot ID (robot ID).
MIDDLEWARE_ROBOT_ID = str(os.getenv("MIDDLEWARE_ROBOT_ID", "00000000-0000-0000-0000-000000000000"))

Expand Down Expand Up @@ -77,14 +79,10 @@ def main() -> None:
)
parser.add_argument("-c", "--config", type=Path, help="Collision warning config", default=CONFIG_FILE)
parser.add_argument("--camera", type=Path, help="Camera settings", default=CAMERA_CONFIG_FILE)
parser.add_argument("-o", "--out_csv_dir", type=str, help="Output CSV dir", default=None)
parser.add_argument(
"-p", "--out_prefix", type=str, help="Prefix of output csv file with measurements", default=None
)
parser.add_argument("-t", "--play_time", type=int, help="Video play time in seconds", default=5000)
parser.add_argument("--fps", type=int, help="Video FPS", default=None)
parser.add_argument("source_video", type=str, help="Video stream (file or url)", nargs="?", default=TEST_VIDEO_FILE)
parser.add_argument("-m", "--measuring", type=bool, help="Enable extended measuring logs", default=False)
parser.add_argument("-m", "--measuring", type=bool, help="Enable extended measuring logs", default=True)
parser.add_argument("--viz", type=bool, help="Whether to enable remote visualization", default=True)
parser.add_argument("--viz_zmq_port", type=int, help="Port of the ZMQ visualization server", default=5558)
parser.add_argument("--stats", type=bool, help="Store output data sizes", default=True)
Expand Down
1 change: 1 addition & 0 deletions fcw-client/fcw_client/client_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def __init__(
{"results": CallbackInfoClient(ChannelType.JSON, self.results_callback)},
logging_level=logging.getLogger().level,
stats=stats,
extended_measuring=extended_measuring,
)
logger.info(f"Register with netapp_info: {netapp_info}")
self.client.connect_to_middleware(netapp_info.middleware_info)
Expand Down
Loading

0 comments on commit 7c4f287

Please sign in to comment.