Skip to content

Commit

Permalink
Remove unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbradley committed Oct 3, 2024
1 parent 3e8b732 commit 02208e9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/bioclip/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,13 @@ def format_species_probs(self, image_path: str, probs: torch.Tensor, k: int = 5)
result.append(item)
return result

def create_name(self, classification_dict: dict[str, str]) -> str:
return " ".join(classification_dict.values())

def format_grouped_probs(self, image_path: str, probs: torch.Tensor, rank: Rank, min_prob: float = 1e-9, k: int = 5) -> List[dict[str, float]]:
output = collections.defaultdict(float)
class_dict_lookup = {}
name_to_class_dict = {}
for i in torch.nonzero(probs > min_prob).squeeze():
classification_dict = create_classification_dict(self.txt_names[i], rank)
name = self.create_name(classification_dict)
name = join_names(classification_dict)
class_dict_lookup[name] = classification_dict
output[name] += probs[i]
name_to_class_dict[name] = classification_dict
Expand Down

0 comments on commit 02208e9

Please sign in to comment.