Reja1 Claude Opus 4.6 commited on
Commit
aee3e08
·
1 Parent(s): 51823a4

Move metadata.jsonl into images/ so ImageFolder picks up metadata

Browse files

ImageFolder only loads metadata.jsonl from within the data_files
directory tree. With metadata.jsonl at root and data_files pointing
to images/**, the metadata was ignored (all columns null except image).

Now metadata.jsonl lives alongside the images in images/, with
file_name paths relative to that directory (e.g. "NEET_2024_T3/...").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

.gitattributes CHANGED
@@ -1,4 +1,3 @@
1
  images/** filter=lfs diff=lfs merge=lfs -text
2
- metadata.jsonl filter=lfs diff=lfs merge=lfs -text
3
  images/**/*.png filter=lfs diff=lfs merge=lfs -text
4
  *.tar.gz filter=lfs diff=lfs merge=lfs -text
 
1
  images/** filter=lfs diff=lfs merge=lfs -text
 
2
  images/**/*.png filter=lfs diff=lfs merge=lfs -text
3
  *.tar.gz filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -19,7 +19,7 @@ configs:
19
  - config_name: default
20
  data_files:
21
  - split: test
22
- path: "images/**/*.png"
23
  drop_labels: true
24
  dataset_info:
25
  features:
 
19
  - config_name: default
20
  data_files:
21
  - split: test
22
+ path: "images/**"
23
  drop_labels: true
24
  dataset_info:
25
  features:
configs/benchmark_config.yaml CHANGED
@@ -15,8 +15,8 @@ openrouter_models:
15
  # - "anthropic/claude-3-haiku"
16
 
17
  # Path to the metadata JSONL file and base directory for image paths.
18
- metadata_path: "metadata.jsonl"
19
- images_base_dir: "."
20
 
21
  # Base directory where results for each model will be saved.
22
  results_base_dir: "results"
 
15
  # - "anthropic/claude-3-haiku"
16
 
17
  # Path to the metadata JSONL file and base directory for image paths.
18
+ metadata_path: "images/metadata.jsonl"
19
+ images_base_dir: "images"
20
 
21
  # Base directory where results for each model will be saved.
22
  results_base_dir: "results"
metadata.jsonl → images/metadata.jsonl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c08f97e33417afb8dd931439b1f4cb62aa30b8bf6e206accb5e12198b383a50c
3
- size 132878
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3cc68977d9f971da43d1fae98572a0600f2b9e67b8d815a22f15dce500202fd
3
+ size 128832
src/benchmark_runner.py CHANGED
@@ -476,8 +476,8 @@ def run_benchmark(
476
  os.makedirs(base_output_dir, exist_ok=True)
477
 
478
  # Load dataset directly from metadata.jsonl and images/
479
- metadata_path = config.get("metadata_path", "metadata.jsonl")
480
- images_base_dir = config.get("images_base_dir", ".")
481
  try:
482
  records = []
483
  with open(metadata_path, 'r', encoding='utf-8') as f:
@@ -734,9 +734,8 @@ def run_benchmark(
734
  if __name__ == "__main__":
735
  # Get available choices for arguments
736
  # Assuming benchmark_config.yaml is in a 'configs' directory relative to script or a fixed path
737
- # Assuming metadata.jsonl is in a 'data' directory relative to script or a fixed path
738
  default_config_path = "configs/benchmark_config.yaml"
739
- default_metadata_path = "metadata.jsonl"
740
 
741
  available_models = get_available_models(default_config_path)
742
  available_exam_names, available_exam_years = get_available_exam_details(default_metadata_path)
 
476
  os.makedirs(base_output_dir, exist_ok=True)
477
 
478
  # Load dataset directly from metadata.jsonl and images/
479
+ metadata_path = config.get("metadata_path", "images/metadata.jsonl")
480
+ images_base_dir = config.get("images_base_dir", "images")
481
  try:
482
  records = []
483
  with open(metadata_path, 'r', encoding='utf-8') as f:
 
734
  if __name__ == "__main__":
735
  # Get available choices for arguments
736
  # Assuming benchmark_config.yaml is in a 'configs' directory relative to script or a fixed path
 
737
  default_config_path = "configs/benchmark_config.yaml"
738
+ default_metadata_path = "images/metadata.jsonl"
739
 
740
  available_models = get_available_models(default_config_path)
741
  available_exam_names, available_exam_years = get_available_exam_details(default_metadata_path)