Skip OP/ED files by default (--all-files to include)
Real-run evidence: the transformation-emblem false positive (frame 1583 of the OP, 717x857, aspect 0.84) is geometrically face-shaped and passes every box gate; OP/ED music videos are dominated by exactly that kind of stylized graphics. Episodes carry the character close-ups a grounding dataset needs. Verified on the second run: feather storm (frame 29, area .64) now correctly rejected by the area cap.
This commit is contained in:
+21
-5
@@ -132,6 +132,15 @@ def parse_arguments():
|
||||
help="Inference image size. The model was trained at 1280; lower "
|
||||
"it (640) for speed at some recall cost.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--all-files",
|
||||
action="store_true",
|
||||
help="Also scan OP/ED files (name matches 'opening'/'ending'). "
|
||||
"Skipped by default: music-video files are dominated by "
|
||||
"stylized graphics (feather storms, transformation "
|
||||
"emblems) that false-positive face detectors; character "
|
||||
"close-ups for training datasets come from episodes.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--preview-dir",
|
||||
default=None,
|
||||
@@ -367,11 +376,18 @@ def main():
|
||||
video_extensions = ('.mp4', '.avi', '.mov', '.mkv')
|
||||
grand_total = 0
|
||||
for filename in sorted(os.listdir(args.input_dir)):
|
||||
if filename.lower().endswith(video_extensions):
|
||||
video_path = os.path.join(args.input_dir, filename)
|
||||
print(f"Processing video: {video_path}")
|
||||
grand_total += process_video(
|
||||
video_path, args.output_dir, args, model, device, draw)
|
||||
if not filename.lower().endswith(video_extensions):
|
||||
continue
|
||||
if (not args.all_files
|
||||
and any(k in filename.lower()
|
||||
for k in ("opening", "ending", " op", " ed"))):
|
||||
print(f"Skipping OP/ED file (use --all-files to include): "
|
||||
f"{filename}")
|
||||
continue
|
||||
video_path = os.path.join(args.input_dir, filename)
|
||||
print(f"Processing video: {video_path}")
|
||||
grand_total += process_video(
|
||||
video_path, args.output_dir, args, model, device, draw)
|
||||
|
||||
print(f"Done. {grand_total} stills saved to {args.output_dir}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user