You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As long as this issue stays unresolved, you'd be able to read the GHA check-code result of my fork here.
# add this below the functional interface declaration (src/torchmetrics/functional/multimodal/clip_iqa.py)ifTYPE_CHECKING:
fromtypingimportAny, castimages=cast(Any, None)
fromfunctoolsimportpartialf=partial(clip_image_quality_assessment, images=images)
f(prompts=("colorfullness",))
f(prompts=("quality", "brightness", "noisiness"),)
f(prompts=("quality", "brightness", "noisiness", "colorfullness"),)
f(prompts=(("Photo of a cat", "Photo of a dog"), "quality", ("Colorful photo", "Black and white photo")))
# add this below the module interface declaration (src/torchmetrics/multimodal/clip_iqa.py)ifTYPE_CHECKING:
fromtypingimportcastimages=cast(Any, None)
f=CLIPImageQualityAssessmentf(prompts=("colorfullness",))
f(prompts=("quality", "brightness", "noisiness"),)
f(prompts=("quality", "brightness", "noisiness", "colorfullness"),)
f(prompts=(("Photo of a cat", "Photo of a dog"), "quality", ("Colorful photo", "Black and white photo")))
# run mypy command
mypy
Expected behavior
There should be no type error in the code above, as the arguments are directly pulled from the test code.
Environment
TorchMetrics version (if build from source, add commit SHA): d927909
Python & PyTorch Version (e.g., 1.0): Python 3.9, and Torch 2.5.1 if that matters
Any other relevant information such as OS (e.g., Linux): N/A
Additional context
I'm also submitting a PR for this.
The text was updated successfully, but these errors were encountered:
🐛 Bug
Currently, there are two diffrent interfaces for CLIP-IQA. One's a "module interface" or a Python
class
, and the other's functional. The problem is that, for the both interfaces,prompts
parameter is incorrectly typed. It is supposed to be atuple
, each item beingstr
ortuple[str, str]
. But the current type hint istuple[Union[str, tuple[str, str]]
, which indicates atuple
with a single item.To Reproduce
Steps to reproduce the behavior...
Code sample
As long as this issue stays unresolved, you'd be able to read the GHA
check-code
result of my fork here.# run mypy command mypy
Expected behavior
There should be no type error in the code above, as the arguments are directly pulled from the test code.
Environment
Additional context
I'm also submitting a PR for this.
The text was updated successfully, but these errors were encountered: