FiberGate / tools /find_image_path.py
AzizMiladi's picture
chore: git mv scripts, UI, dev tools, docs into folders
70c46cc
Raw
History Blame
746 Bytes
#!/usr/bin/env python3
import json
from pathlib import Path
data = json.loads(Path('data_combined/combined_test_v2.json').read_text(encoding='utf-8'))
samples = [r for r in data if r.get('box_labels') and any('log' in b.lower() for b in r.get('box_labels',[]))]
if samples:
s = samples[0]
img_path = s.get('image_file')
print(f'Image path: {img_path}')
# Try to find it
p = Path(img_path)
if p.exists():
print(f'✓ File exists at: {p}')
else:
# Check with different bases
for base in ['DataSet', 'DataSet1', 'DataSet2', 'data', 'processed']:
candidate = Path(base) / Path(img_path).name
if candidate.exists():
print(f'✓ Found at: {candidate}')