From 16a4842374dfd4873ac3cde63cfc850b74bfb99d Mon Sep 17 00:00:00 2001 From: Ben Lonnqvist Date: Wed, 8 May 2024 10:29:26 +0200 Subject: [PATCH] add scialom ImageNet mapping labels (#819) --- .../brain_transformation/behavior.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/brainscore_vision/model_helpers/brain_transformation/behavior.py b/brainscore_vision/model_helpers/brain_transformation/behavior.py index 35a55a1e6..17f02453d 100644 --- a/brainscore_vision/model_helpers/brain_transformation/behavior.py +++ b/brainscore_vision/model_helpers/brain_transformation/behavior.py @@ -139,8 +139,25 @@ class LabelToImagenetIndices: motorbike_indices = [670, 665] bus_indices = [779, 874, 654] + # added from the Scialom2024 benchmark: + banana_indices = [954] + beanie_indices = [439, 452, 515, 808] + binoculars_indices = [447] + boot_indices = [514] + bowl_indices = [659, 809] + cup_indices = [968] + glasses_indices = [837] + lamp_indices = [470, 607, 818, 846] + pan_indices = [567] + sewingmachine_indices = [786] + shovel_indices = [792] + # truck indices used as defined by Geirhos et al., 2021. + @classmethod def label_to_indices(cls, label): + # for handling multi-word labels given by models or benchmarks + label = label.lower().replace(" ", "") + synset_indices = getattr(cls, f"{label}_indices") return synset_indices