Skip to content

Commit

Permalink
refactor: some minor renaming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Oct 18, 2024
1 parent 5ebfa0c commit 08de98a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aipipeline/metrics/calc_accuracy_vss.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def calc_accuracy(config: dict, image_dir: str, password: str):
# Create a dictionary to encode the labels
label_encoder = LabelEncoder()
# Combine both the found labels and the database labels in case there are missing labels
combined = predicted_labels + [labels]
combined = predicted_labels + [labels_unique]
flattened = [item for sublist in combined for item in sublist]
unique_labels = list(set(flattened))
label_encoder.fit(unique_labels)
labels_unique_all = list(set(flattened))
label_encoder.fit(labels_unique_all)
label_dict = {label: i for i, label in enumerate(label_encoder.classes_)}
LABELS_VAL = ", ".join(unique_labels)
LABELS_VAL = ", ".join(labels_unique_all)

# Convert predictions to encoded labels
true_labels_encoded = [label_dict[label] for label in true_labels]
Expand Down

0 comments on commit 08de98a

Please sign in to comment.