Skip to content

Add image_count metadata field to dataset entries#274

Merged
haoranpb merged 7 commits intomainfrom
copilot/add-image-count-metadata
Dec 12, 2025
Merged

Add image_count metadata field to dataset entries#274
haoranpb merged 7 commits intomainfrom
copilot/add-image-count-metadata

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 12, 2025

Track the number of screenshot images in each dataset instance's problem statement directory as metadata.

Changes

  • EntryMetadata: Added image_count: int | None = None field
  • DatasetEntry.count_images(): Method to count images in problem statement dir
  • count_images_in_directory(): Utility function supporting .png, .jpg, .jpeg, .gif, .webp, .bmp, .svg
  • bcbench dataset update-metadata: CLI command to calculate and update image counts across all entries
  • Dataset: All 55 entries populated with actual image counts (0-20 range)

Usage

# Preview changes
bcbench dataset update-metadata --dry-run

# Apply updates
bcbench dataset update-metadata
entry = load_dataset_entries(path, entry_id="microsoftInternal__NAV-227219")[0]
entry.metadata.image_count  # 8
entry.count_images()  # Recalculate from disk
Original prompt

Calculate number of images (screenshots) included in each dataset instances. It should be included as another metadata field, with type int | None.

You tasks: calculate the existing ones programatically


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 12, 2025 17:14
Co-authored-by: haoranpb <27280733+haoranpb@users.noreply.github.com>
…d type annotation

Co-authored-by: haoranpb <27280733+haoranpb@users.noreply.github.com>
Copilot AI changed the title [WIP] Add image count metadata to dataset instances Add image_count metadata field to dataset entries Dec 12, 2025
Copilot AI requested a review from haoranpb December 12, 2025 17:20
@haoranpb haoranpb marked this pull request as ready for review December 12, 2025 19:29
@haoranpb haoranpb merged commit ac94316 into main Dec 12, 2025
65 of 69 checks passed
@haoranpb haoranpb deleted the copilot/add-image-count-metadata branch December 12, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants