Skip to content

Commit

Permalink
date passing tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingFathead committed Dec 1, 2024
1 parent 4b0b89e commit 5121428
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Use `utils/batch_humdet_yolo8_opencv2.py` to run YOLOv8 batch detection on direc

## Changelog
- **v0.1614**
- More reactive log updates to webui
- More reactive detection aggregation updates to webui
- **v0.1613**
- Even more load balancing fixes; aggregation parsing improvements
- **v0.1612**
Expand Down
2 changes: 1 addition & 1 deletion config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ strip_local_path = true
# File send queuing options
max_retries = 10
retry_delay = 1
remote_sync_queue_maxsize = 1000
# Maximum number of worker threads for remote sync
remote_sync_queue_maxsize = 0
max_workers = 3
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# version.py

version_number = "0.1614 (Nov 29 2024)"
version_number = "0.1614.1 (Nov 29 2024)"
14 changes: 13 additions & 1 deletion web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,19 @@ def start_web_server(host='0.0.0.0', port=5000, detection_log_path=None,
app.config['config'] = config # Store config in Flask's config if needed

# Initialize SAVE_DIR_BASE within the web server process
SAVE_DIR_BASE = get_base_save_dir(config)
# SAVE_DIR_BASE = get_base_save_dir(config)
# app.config['SAVE_DIR_BASE'] = SAVE_DIR_BASE

if save_dir_base:
SAVE_DIR_BASE = save_dir_base
logger.info(f"Using SAVE_DIR_BASE passed from detection script: {SAVE_DIR_BASE}")
else:
# Initialize SAVE_DIR_BASE within the web server process
SAVE_DIR_BASE = get_base_save_dir(config)
logger.info(f"Initialized SAVE_DIR_BASE within web server: {SAVE_DIR_BASE}")

app.config['SAVE_DIR_BASE'] = SAVE_DIR_BASE

logger.info(f"SAVE_DIR_BASE is set to: {app.config['SAVE_DIR_BASE']}")

logger.info(f"Starting web server at http://{host}:{port}")
Expand Down Expand Up @@ -526,6 +537,7 @@ def serve_detection_image(filename):
# Use os.path.join and os.path.abspath
filepath = os.path.abspath(os.path.join(save_dir_base, filename))
logger.info(f"Computed filepath: {filepath}")

# Security check to prevent directory traversal
if not save_dir_base:
logger.error("save_dir_base is None. Cannot serve image.")
Expand Down
3 changes: 2 additions & 1 deletion yolov8_live_rtmp_stream_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,8 @@ def sanitize_detection_data(detection):
logs_list, # logs_list
detections_lock, # detections_lock
logs_lock, # logs_lock
config # config
config, # config
SAVE_DIR_BASE # Pass SAVE_DIR_BASE explicitly
# detection_timestamps, # Pass detection_timestamps
# timestamps_lock # Pass timestamps_lock
),
Expand Down

0 comments on commit 5121428

Please sign in to comment.