Prompting.py ; Miscs for Interro29
This commit is contained in:
@@ -183,9 +183,12 @@ for path_str in args.input_paths:
|
||||
|
||||
# 1. Determine which files to process
|
||||
if input_arg.is_file():
|
||||
INPUT_DIR = input_arg.parent.parent
|
||||
target_files = [input_arg]
|
||||
elif input_arg.is_dir():
|
||||
target_files = list(input_arg.glob("Copie*.pdf"))
|
||||
INPUT_DIR = input_arg
|
||||
COPIES_DIR = INPUT_DIR / "Copies"
|
||||
target_files = list(COPIES_DIR.glob("Copie*.pdf"))
|
||||
if not target_files:
|
||||
print(f"Warning: No Copie*.pdf files found in {input_arg}")
|
||||
else:
|
||||
@@ -194,7 +197,7 @@ for path_str in args.input_paths:
|
||||
|
||||
# 2. Run the logic for all collected files
|
||||
for target_file in target_files:
|
||||
INPUT_DIR = target_file.parent
|
||||
# INPUT_DIR = target_file.parent
|
||||
CUTLEFT_DIR = INPUT_DIR / 'Cutleft'
|
||||
|
||||
# Matches stem_01.jpg, stem_02.jpg, etc.
|
||||
@@ -306,7 +309,7 @@ def process_copy_group(group_key, files):
|
||||
accumulated_labels.append(box.label)
|
||||
break # exit retry loop
|
||||
except Exception as e:
|
||||
print(f"Error processing {image_file.name}: {e}")
|
||||
print(f"Error processing {image_file.name}: {e}\n\tIt will be retried.")
|
||||
|
||||
# Rate Limiting
|
||||
elapsed = time.time() - start_time
|
||||
|
||||
Reference in New Issue
Block a user