Skip to content

[Fix] Detect MIME types for extensionless images - #1643

Open
reacher-z wants to merge 1 commit into
open-compass:mainfrom
reacher-z:fix/sitebench-extensionless-images
Open

[Fix] Detect MIME types for extensionless images#1643
reacher-z wants to merge 1 commit into
open-compass:mainfrom
reacher-z:fix/sitebench-extensionless-images

Conversation

@reacher-z

Copy link
Copy Markdown

Summary

  • detect the MIME type of local files with unknown or missing extensions using Pillow
  • keep the existing extension-based fast path unchanged
  • return unknown for non-image files instead of raising
  • add regression coverage for a real extensionless PNG and an extensionless non-image

This fixes the remaining SiteBenchImage failure reported in #1485. The 3DSRBench name_str problem from the same issue was already fixed by #1428.

Why

Some SiteBenchImage assets have no filename extension. parse_file currently maps an empty suffix to unknown, so API and model adapters cannot treat those paths as images even though Pillow can identify their encoded format.

Tests

  • python3 -m pytest -q tests/test_smp_file.py (2 passed)
  • uvx pre-commit run --files vlmeval/smp/file.py tests/test_smp_file.py (all passed)
  • git diff --check

AI assistance disclosure

I used OpenAI Codex to inspect the issue and repository, implement the change, and draft tests and this description. I reviewed the code and personally ran the tests and checks above.

Closes #1485

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.

3DSRBench和SiteBenchImage两个数据集评测的bug麻烦修复下,修复方式文中给出。

1 participant