Skip to content

Commit

Permalink
fix: bug in image quality + prompt alignment metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
soumik12345 committed Oct 30, 2024
1 parent 342ba02 commit a2a4331
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hemm/metrics/image_quality/lpips.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def compute_metric(
}

@weave.op()
def evaluate(
def score(
self, prompt: str, ground_truth_image: Image.Image, model_output: Dict[str, Any]
) -> Union[float, Dict[str, float]]:
return super().evaluate(prompt, ground_truth_image, model_output)
2 changes: 1 addition & 1 deletion hemm/metrics/image_quality/psnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def compute_metric(
}

@weave.op()
def evaluate(
def score(
self, prompt: str, ground_truth_image: Image.Image, model_output: Dict[str, Any]
) -> Union[float, Dict[str, float]]:
_ = "PSNRMetric"
Expand Down
2 changes: 1 addition & 1 deletion hemm/metrics/image_quality/ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def compute_metric(
}

@weave.op()
def evaluate(
def score(
self, prompt: str, ground_truth_image: Image.Image, model_output: Dict[str, Any]
) -> Union[float, Dict[str, float]]:
return super().evaluate(prompt, ground_truth_image, model_output)
2 changes: 1 addition & 1 deletion hemm/metrics/prompt_alignment/blip_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def compute_metric(
)

@weave.op()
def evaluate(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
def score(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
return super().evaluate(prompt, model_output)
2 changes: 1 addition & 1 deletion hemm/metrics/prompt_alignment/clip_iqa_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ def compute_metric(
return score_dict

@weave.op()
def evaluate(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
def score(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
return super().evaluate(prompt, model_output)
2 changes: 1 addition & 1 deletion hemm/metrics/prompt_alignment/clip_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def compute_metric(
)

@weave.op()
def evaluate(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
def score(self, prompt: str, model_output: Dict[str, Any]) -> Dict[str, float]:
return super().evaluate(prompt, model_output)

0 comments on commit a2a4331

Please sign in to comment.