Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
panly2003 committed May 20, 2024
1 parent e08b0de commit 8eaab70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ __pycache__/

# Test
test.py
detectability.py
robustness.py
quality.py
script.sh
evaluation/examples/tools.py

# Model
watermark/sir/model/compositional-bert-large-uncased/
Expand Down
4 changes: 2 additions & 2 deletions evaluation/tools/success_rate_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def _compute_metrics(self, inputs: List[DetectionResult]) -> Dict[str, float]:

def calculate(self, watermarked_result: List[bool], non_watermarked_result: List[bool]) -> Dict[str, float]:
"""calculate success rates of watermark detection based on provided results."""
self.check_instance(watermarked_result, bool)
self.check_instance(non_watermarked_result, bool)
self._check_instance(watermarked_result, bool)
self._check_instance(non_watermarked_result, bool)

inputs = [DetectionResult(True, x) for x in watermarked_result] + [DetectionResult(False, x) for x in non_watermarked_result]
metrics = self._compute_metrics(inputs)
Expand Down

0 comments on commit 8eaab70

Please sign in to comment.