mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
fix: temp directory is only created when there are review_items. (#21344)
This commit is contained in:
parent
ae009b9861
commit
074b060e9c
@ -355,8 +355,6 @@ def collect_state_classification_examples(
|
|||||||
cameras: Dict mapping camera names to normalized crop coordinates [x1, y1, x2, y2] (0-1)
|
cameras: Dict mapping camera names to normalized crop coordinates [x1, y1, x2, y2] (0-1)
|
||||||
"""
|
"""
|
||||||
dataset_dir = os.path.join(CLIPS_DIR, model_name, "dataset")
|
dataset_dir = os.path.join(CLIPS_DIR, model_name, "dataset")
|
||||||
temp_dir = os.path.join(dataset_dir, "temp")
|
|
||||||
os.makedirs(temp_dir, exist_ok=True)
|
|
||||||
|
|
||||||
# Step 1: Get review items for the cameras
|
# Step 1: Get review items for the cameras
|
||||||
camera_names = list(cameras.keys())
|
camera_names = list(cameras.keys())
|
||||||
@ -371,6 +369,10 @@ def collect_state_classification_examples(
|
|||||||
logger.warning(f"No review items found for cameras: {camera_names}")
|
logger.warning(f"No review items found for cameras: {camera_names}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# The temp directory is only created when there are review_items.
|
||||||
|
temp_dir = os.path.join(dataset_dir, "temp")
|
||||||
|
os.makedirs(temp_dir, exist_ok=True)
|
||||||
|
|
||||||
# Step 2: Create balanced timestamp selection (100 samples)
|
# Step 2: Create balanced timestamp selection (100 samples)
|
||||||
timestamps = _select_balanced_timestamps(review_items, target_count=100)
|
timestamps = _select_balanced_timestamps(review_items, target_count=100)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user