Skip to content

[Cleanup] Remove unused Polygon3 dependency (#1528)#1548

Closed
SHAI-Akshay-Tripathi wants to merge 4 commits into
open-compass:mainfrom
SHAI-Akshay-Tripathi:fix/remove-unused-polygon3-dependency
Closed

[Cleanup] Remove unused Polygon3 dependency (#1528)#1548
SHAI-Akshay-Tripathi wants to merge 4 commits into
open-compass:mainfrom
SHAI-Akshay-Tripathi:fix/remove-unused-polygon3-dependency

Conversation

@SHAI-Akshay-Tripathi

Copy link
Copy Markdown
Contributor

Summary

Closes #1528.

Polygon3 was listed in two requirements files but is not imported or used
anywhere in the codebase. As noted in #1528, the package bundles the GPC
component which carries proprietary licensing terms (Other/Proprietary License on PyPI), which can create friction for commercial users.

Changes

  • Removed Polygon3 from requirements.txt
  • Removed Polygon3 from vlmeval/dataset/utils/Ocrbench_v2/requirements.txt

Verification

Searched the full codebase for any usage of Polygon3 / GPC:

SHAI-Akshay-Tripathi and others added 4 commits May 7, 2026 23:51
…licts

The generate_kwargs dict passed top_p, top_k, and temperature to
model.generate() without setting do_sample. HuggingFace defaults
do_sample to False, which silently ignores sampling parameters and
falls back to greedy decoding, causing evaluation results to not
reflect the configured sampling behavior.

This commit derives do_sample from temperature (do_sample=True when
temperature > 0) and only includes top_p, top_k, and temperature in
generate_kwargs when sampling is enabled, avoiding conflicting-flag
warnings in the greedy path. Users can override via kwargs.

Closes open-compass#1275
Removed polygon3 dependency from requirements.
Removed 'Polygon3' from the requirements.
@TianhaoLiang2000

Copy link
Copy Markdown
Collaborator

Thanks for the cleanup.

Could you please double-check this dependency before removing it? Polygon3 appears to be used by OCRBench v2: spotting_eval/script.py dynamically imports Polygon and uses plg.Polygon(...) for text spotting evaluation. This path is reached from OCRBench v2’s text spotting en metric, so removing the requirement may break that benchmark.

@SHAI-Akshay-Tripathi

Copy link
Copy Markdown
Contributor Author

You're right, thanks for catching this — my verification was flawed. I grepped for Polygon3, but the package imports as Polygon, and in spotting_eval/script.py it's loaded dynamically via importlib.import_module('Polygon') (from the evaluation_imports() dict), so there's no literal import line to find. It's then used in plg.Polygon(...) at lines 100 and 115, with no try/except fallback.
I confirmed the path is live: OCRBench_v2 → ocrbrnch_v2_eval.py → the "text spotting en" branch (line 344) → spotting_evaluation(...) → spotting_metric.py → script.py. So removing the dependency would break OCRBench v2 text spotting, exactly as you noted.
Closing this since the "unused" premise doesn't hold. Sorry for the noise!

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.

Confirm whether Polygon3 is still required

2 participants