├── .gitignore
├── GPR1200_categoryNumber_to_text.json
├── README.md
├── eval
├── GPR1200.py
├── eval_notebook.ipynb
├── evaluate.py
└── utils.py
└── images
├── GPR_main_pic.jpg
├── result_table.JPG
└── result_table_description.JPG
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/GPR1200_categoryNumber_to_text.json:
--------------------------------------------------------------------------------
1 | {"0": "Eldorado National Forest", "1": "Buckingham Fountain", "2": "Lake Maggiore", "3": "Francis Scott Key Monument (Baltimore)", "4": "Fort Des Moines Historic Complex", "5": "Naturschutzgebiet Brachenleite bei Tauberbischofsheim", "6": "Bubanj Memorial Park", "7": "Brooklyn Bridge", "8": "Palace of Culture and Science", "9": "Löderups kyrka", "10": "Kingston Flyer", "11": "Mikkeli Cathedral", "12": "Anıtkabir", "13": "Château de Vaux-le-Vicomte", "14": "Castello Estense (Ferrara)", "15": "Scheveningse pier", "16": "Hermitage and chapel of Saint-Thibaut", "17": "Zhongshan Hall, Taipei", "18": "Střekov (castle)", "19": "USS Texas (BB-35)", "20": "Torre Glòries", "21": "Llenroc (Cornell University)", "22": "Kila kyrka, Värmland", "23": "Albrechtsburg", "24": "Puente Rio Hondo", "25": "Saint Michael the Archangel Parish Church (Bacnotan, La Union)", "26": "Elisabeth Bridge, Budapest", "27": "Airborne War Cemetery", "28": "USS Arizona Memorial", "29": "Fort Washakie", "30": "Lake Louise", "31": "Ganns ödekyrka", "32": "Providence Canyon State Park", "33": "Los Angeles City Hall", "34": "Ljungsarps kyrka", "35": "Zimmerman House, Manchester, New Hampshire", "36": "Selångers kyrkoruin", "37": "Farstorps kyrka", "38": "National World War II Memorial", "39": "Colt Armory", "40": "Fisherman's Bastion", "41": "Ave Maria Grotto", "42": "Glomdalsmuseet", "43": "Old Government House, Brisbane", "44": "Bingham Canyon Mine", "45": "Nā Pali Coast State Park", "46": "Andenes fyr", "47": "Smith Memorial Arch", "48": "Adršpašsko-teplické skály", "49": "Walls of Jerusalem National Park", "50": "Robert William Roper House", "51": "Strada delle 52 gallerie", "52": "Łuczniczka Bydgoszcz", "53": "Pont Nou de Sant Pere de Riudebitlles", "54": "Minnewaska State Park Preserve", "55": "Bryce Canyon Lodge and Deluxe Cabins", "56": "St. Bartholomäus (Rödinghausen)", "57": "Caloocan Sports Complex", "58": "Thomas Jefferson Building", "59": "Canyon de Chelly National Monument", "60": "San Francisco Peaks", "61": "St. Verena (Rot an der Rot)", "62": "Briarcliff Manor Public Library", "63": "Boylston Street", "64": "Zion Narrows", "65": "John P. Grace Memorial Bridge", "66": "Soroca Fort", "67": "USS New Jersey (BB-62)", "68": "Jablanica Reservoir", "69": "Promenade des Anglais (Nice)", "70": "Saint Michael's Cathedral (Sitka, Alaska)", "71": "Stadsschouwburg Amsterdam", "72": "Nu‘uanu Pali", "73": "Santa Caterina del Sasso", "74": "Gathright Dam", "75": "Prudential Building (Buffalo, New York)", "76": "Sutton House (McCook, Nebraska)", "77": "USS North Carolina (BB-55)", "78": "Marienkirche (Zwickau)", "79": "Dadiani Palaces Museum", "80": "Field Museum", "81": "Dayton Street Historic District", "82": "El Torcal", "83": "Bustos Dam", "84": "Falowiec", "85": "Reguliersgracht, Amsterdam", "86": "Hampton National Cemetery", "87": "Craters of the Moon National Monument", "88": "Rödbo kyrka", "89": "Throgs Neck Bridge", "90": "Sutter's Fort", "91": "Holyland Model of Jerusalem", "92": "Sand Lake National Wildlife Refuge", "93": "Alnö gamla kyrka", "94": "Pikmar", "95": "Montpelier Mansion", "96": "Södra Råda gamla kyrka", "97": "Jäders kyrka", "98": "Starrucca Viaduct", "99": "Petit train d'Artouste", "100": "Roebling Suspension Bridge", "101": "Saint Catherine Cathedral (Kherson)", "102": "Confederate Monument (Arlington National Cemetery)", "103": "Vittoriano (Rome)", "104": "Sawtooth National Forest", "105": "Kasteel Neubourg", "106": "St. Michael's Episcopal Church (Charleston, South Carolina)", "107": "Ekeby kyrka, Gotland", "108": "Multihalle", "109": "Winterstein (Sächsische Schweiz)", "110": "Sidney Lanier Bridge", "111": "Niagara Falls", "112": "Hortus Palatinus", "113": "Stadhuis Middelburg", "114": "Ananta Samakhom Throne Hall", "115": "Eurobodalla National Park", "116": "Tempel Synagogue in Chernivtsi (Czernowitz)", "117": "Uspenski Cathedral", "118": "Eccles Building", "119": "Bath Bridge (Bath, New Hampshire)", "120": "Weishan Guanyin", "121": "Westergasfabriek", "122": "Ignaberga gamla kyrka", "123": "Amazonehaven", "124": "Santa Faz Monastery, Alicante", "125": "Sherbourne Common", "126": "Bara ödekyrka", "127": "Jewish cemetery in Klatovy", "128": "Royal New Zealand Air Force Museum", "129": "Socorro Mission", "130": "Lindholm Høje", "131": "Jewish cemetery in Miroslav", "132": "Titov park (Pula)", "133": "Bottnaryds kyrka", "134": "Oval Office", "135": "Jewish cemetery in Březnice", "136": "Aragon River", "137": "Justizvollzugsanstalt Glasmoor", "138": "The Woodlands Cemetery", "139": "Rotunda (University of Virginia)", "140": "Presidential Building (Taiwan)", "141": "Hotel Imperial (Karlovy Vary)", "142": "Saint Vincent Ferrer Parish Church (Dupax del Sur, Nueva Vizcaya)", "143": "Sunnersbergs kyrka", "144": "Budapest Museum of Fine Arts", "145": "Tower of Mendoza", "146": "Loggia (Koper)", "147": "Camden (Port Royal, Virginia)", "148": "Écomusée d'Alsace", "149": "Haus Werburg", "150": "Lövstabruks kyrka", "151": "Xcambo", "152": "Great Sand Dunes National Park", "153": "Eriksbergs gamla kyrka", "154": "Oosterscheldekering", "155": "Børsen", "156": "Cirque de Troumouse", "157": "Parliament House, Brisbane", "158": "Bollman Truss Railroad Bridge", "159": "French Opera House, New Orleans", "160": "Schloss Ruhethal", "161": "Bouzov Castle", "162": "Vermilion Cliffs National Monument", "163": "Ontario Legislative Building", "164": "Maccabiah Stadium", "165": "Kalmar domkyrka", "166": "Zámek Dobříš", "167": "Our Lady of the Abandoned Parish Church (Marikina, Metro Manila)", "168": "House-Museum of Adam Mickievič", "169": "Église Saint-Gilles, Chamalières-sur-Loire", "170": "Suntaks gamla kyrka", "171": "Shwedagon pagoda", "172": "Navahradak Castle", "173": "Poplar Forest", "174": "Jewish cemetery in Břeclav", "175": "Tunkhannock Viaduct", "176": "Jardim Botânico de São Paulo", "177": "Schloss Rochsburg", "178": "Fortified church in Prejmer, Brașov", "179": "Breviks kyrka, Karlsborg", "180": "Saint Nicholas church in Bydgoszcz-Fordon", "181": "Basilique Sainte-Maxellende de Caudry", "182": "Fontanna Potop", "183": "Ormøya", "184": "Sommerresidenz (Eichstätt)", "185": "Plaza Mayor, Chinchón", "186": "Museum Dr Guislain", "187": "Town Hall Tower in Kraków", "188": "Stadtkirche St. Wenzel (Lommatzsch)", "189": "Hell Gate Bridge", "190": "Mesa Verde National Park", "191": "Ponte di Rialto", "192": "Burg Anholt", "193": "East Room (White House)", "194": "Schloss Siebeneichen", "195": "Quezon City Experience", "196": "Frankfurter Tor (Berlin-Friedrichshain)", "197": "Gökhems kyrka", "198": "Jüdischer Friedhof Berlichingen", "199": "Mont Orgueil", "200": "Fungi, Amanitaceae, Amanita flavoconia", "201": "Animalia, Papilionidae, Papilio machaon", "202": "Animalia, Papilionidae, Papilio demodocus", "203": "Animalia, Papilionidae, Papilio zelicaon", "204": "Animalia, Papilionidae, Papilio anchisiades", "205": "Animalia, Papilionidae, Papilio thoas", "206": "Animalia, Papilionidae, Papilio rumiko", "207": "Animalia, Papilionidae, Papilio xuthus", "208": "Animalia, Papilionidae, Papilio polytes", "209": "Animalia, Papilionidae, Papilio helenus", "210": "Animalia, Papilionidae, Papilio memnon", "211": "Animalia, Papilionidae, Papilio paris", "212": "Animalia, Apidae, Bombus californicus", "213": "Animalia, Apidae, Bombus pascuorum", "214": "Animalia, Carabidae, Cicindela aurulenta", "215": "Animalia, Apidae, Bombus sonorus", "216": "Animalia, Apidae, Bombus vosnesenskii", "217": "Animalia, Apidae, Bombus mixtus", "218": "Animalia, Apidae, Bombus bifarius", "219": "Animalia, Apidae, Bombus hypnorum", "220": "Animalia, Apidae, Bombus auricomus", "221": "Animalia, Apidae, Bombus nevadensis", "222": "Animalia, Apidae, Bombus citrinus", "223": "Animalia, Carabidae, Cicindela ocellata", "224": "Animalia, Vespidae, Polistes exclamans", "225": "Animalia, Vespidae, Polistes instabilis", "226": "Animalia, Vespidae, Polistes annularis", "227": "Animalia, Vespidae, Polistes dominula", "228": "Animalia, Vespidae, Polistes major", "229": "Animalia, Vespidae, Polistes rubiginosus", "230": "Animalia, Vespidae, Polistes fuscatus", "231": "Animalia, Vespidae, Polistes carolina", "232": "Animalia, Vespidae, Polistes metricus", "233": "Animalia, Vespidae, Polistes aurifer", "234": "Animalia, Ranidae, Lithobates grylio", "235": "Animalia, Ranidae, Lithobates clamitans", "236": "Animalia, Ranidae, Lithobates berlandieri", "237": "Animalia, Ranidae, Lithobates septentrionalis", "238": "Animalia, Ranidae, Lithobates pipiens", "239": "Animalia, Ranidae, Lithobates palustris", "240": "Animalia, Carabidae, Cicindela oregona", "241": "Animalia, Ranidae, Lithobates sylvaticus", "242": "Animalia, Phrynosomatidae, Sceloporus olivaceus", "243": "Animalia, Phrynosomatidae, Sceloporus cowlesi", "244": "Animalia, Phrynosomatidae, Sceloporus magister", "245": "Animalia, Phrynosomatidae, Sceloporus tristichus", "246": "Animalia, Carabidae, Cicindela tranquebarica", "247": "Animalia, Phrynosomatidae, Sceloporus spinosus", "248": "Animalia, Phrynosomatidae, Sceloporus variabilis", "249": "Animalia, Phrynosomatidae, Sceloporus undulatus", "250": "Animalia, Phrynosomatidae, Sceloporus torquatus", "251": "Animalia, Phrynosomatidae, Sceloporus grammicus", "252": "Animalia, Phrynosomatidae, Sceloporus clarkii", "253": "Animalia, Phrynosomatidae, Sceloporus uniformis", "254": "Animalia, Carabidae, Cicindela formosa", "255": "Animalia, Viperidae, Crotalus oreganus", "256": "Animalia, Viperidae, Crotalus adamanteus", "257": "Animalia, Viperidae, Crotalus lepidus", "258": "Animalia, Viperidae, Crotalus cerastes", "259": "Animalia, Viperidae, Crotalus horridus", "260": "Animalia, Viperidae, Crotalus scutulatus", "261": "Animalia, Colubridae, Thamnophis cyrtopsis", "262": "Animalia, Colubridae, Thamnophis marcianus", "263": "Animalia, Colubridae, Thamnophis saurita", "264": "Animalia, Colubridae, Thamnophis ordinoides", "265": "Animalia, Colubridae, Thamnophis atratus", "266": "Animalia, Colubridae, Thamnophis radix", "267": "Animalia, Colubridae, Thamnophis hammondii", "268": "Animalia, Icteridae, Icterus bullockii", "269": "Animalia, Icteridae, Icterus gularis", "270": "Animalia, Icteridae, Icterus cucullatus", "271": "Animalia, Icteridae, Icterus parisorum", "272": "Animalia, Icteridae, Icterus wagleri", "273": "Animalia, Icteridae, Icterus abeillei", "274": "Animalia, Icteridae, Icterus galbula", "275": "Animalia, Carabidae, Cicindela sexguttata", "276": "Animalia, Icteridae, Icterus spurius", "277": "Animalia, Corvidae, Corvus corax", "278": "Animalia, Corvidae, Corvus ossifragus", "279": "Animalia, Corvidae, Corvus cryptoleucus", "280": "Animalia, Corvidae, Corvus cornix", "281": "Animalia, Corvidae, Corvus corone", "282": "Animalia, Carabidae, Cicindela repanda", "283": "Animalia, Corvidae, Corvus caurinus", "284": "Animalia, Corvidae, Corvus frugilegus", "285": "Animalia, Corvidae, Corvus macrorhynchos", "286": "Animalia, Turdidae, Turdus iliacus", "287": "Animalia, Turdidae, Turdus philomelos", "288": "Animalia, Turdidae, Turdus pilaris", "289": "Animalia, Turdidae, Turdus fuscater", "290": "Animalia, Turdidae, Turdus viscivorus", "291": "Animalia, Coenagrionidae, Argia sedula", "292": "Animalia, Turdidae, Turdus ignobilis", "293": "Animalia, Turdidae, Turdus grayi", "294": "Animalia, Turdidae, Turdus merula", "295": "Animalia, Turdidae, Turdus migratorius", "296": "Animalia, Parulidae, Setophaga petechia", "297": "Animalia, Parulidae, Setophaga americana", "298": "Animalia, Parulidae, Setophaga cerulea", "299": "Animalia, Coenagrionidae, Argia tibialis", "300": "Animalia, Parulidae, Setophaga castanea", "301": "Animalia, Parulidae, Setophaga virens", "302": "Animalia, Parulidae, Setophaga occidentalis", "303": "Animalia, Parulidae, Setophaga townsendi", "304": "Animalia, Parulidae, Setophaga nigrescens", "305": "Animalia, Parulidae, Setophaga ruticilla", "306": "Animalia, Parulidae, Setophaga palmarum", "307": "Animalia, Coenagrionidae, Argia plana", "308": "Animalia, Parulidae, Setophaga discolor", "309": "Animalia, Parulidae, Setophaga caerulescens", "310": "Animalia, Parulidae, Setophaga citrina", "311": "Animalia, Parulidae, Setophaga striata", "312": "Animalia, Parulidae, Setophaga coronata", "313": "Animalia, Parulidae, Setophaga dominica", "314": "Animalia, Vireonidae, Vireo philadelphicus", "315": "Animalia, Vireonidae, Vireo olivaceus", "316": "Animalia, Vireonidae, Vireo plumbeus", "317": "Animalia, Vireonidae, Vireo bellii", "318": "Animalia, Vireonidae, Vireo griseus", "319": "Animalia, Vireonidae, Vireo solitarius", "320": "Animalia, Vireonidae, Vireo cassinii", "321": "Animalia, Vireonidae, Vireo huttoni", "322": "Animalia, Laridae, Larus glaucoides", "323": "Animalia, Laridae, Larus marinus", "324": "Animalia, Laridae, Larus hyperboreus", "325": "Animalia, Laridae, Larus occidentalis", "326": "Animalia, Laridae, Larus michahellis", "327": "Animalia, Laridae, Larus canus", "328": "Animalia, Laridae, Larus fuscus", "329": "Animalia, Laridae, Larus delawarensis", "330": "Animalia, Laridae, Larus californicus", "331": "Animalia, Scolopacidae, Calidris minutilla", "332": "Animalia, Scolopacidae, Calidris alpina", "333": "Animalia, Scolopacidae, Calidris fuscicollis", "334": "Animalia, Scolopacidae, Calidris himantopus", "335": "Animalia, Scolopacidae, Calidris bairdii", "336": "Animalia, Scolopacidae, Calidris melanotos", "337": "Animalia, Scolopacidae, Calidris maritima", "338": "Animalia, Scolopacidae, Tringa flavipes", "339": "Animalia, Scolopacidae, Tringa incana", "340": "Fungi, Amanitaceae, Amanita jacksonii", "341": "Animalia, Scolopacidae, Tringa melanoleuca", "342": "Animalia, Charadriidae, Charadrius obscurus", "343": "Animalia, Charadriidae, Charadrius melodus", "344": "Animalia, Charadriidae, Charadrius alexandrinus", "345": "Animalia, Charadriidae, Charadrius hiaticula", "346": "Animalia, Charadriidae, Charadrius semipalmatus", "347": "Animalia, Charadriidae, Charadrius wilsonia", "348": "Animalia, Charadriidae, Charadrius nivosus", "349": "Animalia, Charadriidae, Charadrius tricollaris", "350": "Animalia, Accipitridae, Buteo jamaicensis", "351": "Animalia, Accipitridae, Buteo swainsoni", "352": "Animalia, Accipitridae, Buteo lagopus", "353": "Animalia, Accipitridae, Buteo plagiatus", "354": "Animalia, Accipitridae, Buteo albonotatus", "355": "Animalia, Accipitridae, Buteo platypterus", "356": "Animalia, Coenagrionidae, Enallagma carunculatum", "357": "Animalia, Coenagrionidae, Enallagma exsulans", "358": "Fungi, Amanitaceae, Amanita phalloides", "359": "Animalia, Coenagrionidae, Enallagma vesperum", "360": "Animalia, Coenagrionidae, Enallagma cyathigerum", "361": "Animalia, Libellulidae, Libellula luctuosa", "362": "Plantae, Grossulariaceae, Ribes aureum", "363": "Animalia, Libellulidae, Libellula needhami", "364": "Animalia, Libellulidae, Libellula croceipennis", "365": "Animalia, Libellulidae, Libellula auripennis", "366": "Fungi, Amanitaceae, Amanita muscaria", "367": "Animalia, Libellulidae, Libellula semifasciata", "368": "Animalia, Libellulidae, Libellula forensis", "369": "Plantae, Apocynaceae, Asclepias perennis", "370": "Animalia, Libellulidae, Libellula pulchella", "371": "Animalia, Libellulidae, Orthetrum caledonicum", "372": "Fungi, Amanitaceae, Amanita bisporigera", "373": "Animalia, Libellulidae, Orthetrum triangulare", "374": "Animalia, Libellulidae, Orthetrum chrysis", "375": "Animalia, Libellulidae, Orthetrum coerulescens", "376": "Plantae, Violaceae, Viola pubescens", "377": "Animalia, Libellulidae, Orthetrum brunneum", "378": "Animalia, Libellulidae, Sympetrum corruptum", "379": "Fungi, Amanitaceae, Amanita gemmata", "380": "Animalia, Libellulidae, Sympetrum costiferum", "381": "Animalia, Libellulidae, Sympetrum pallipes", "382": "Animalia, Libellulidae, Sympetrum semicinctum", "383": "Animalia, Libellulidae, Sympetrum ambiguum", "384": "Plantae, Lamiaceae, Salvia dorrii", "385": "Animalia, Libellulidae, Sympetrum obtrusum", "386": "Fungi, Amanitaceae, Amanita pantherina", "387": "Animalia, Nymphalidae, Junonia orithya", "388": "Animalia, Nymphalidae, Junonia coenia", "389": "Animalia, Nymphalidae, Junonia oenone", "390": "Animalia, Nymphalidae, Junonia hierta", "391": "Animalia, Nymphalidae, Junonia evarete", "392": "Animalia, Nymphalidae, Junonia almana", "393": "Animalia, Nymphalidae, Junonia genoveva", "394": "Animalia, Nymphalidae, Junonia iphita", "395": "Animalia, Nymphalidae, Junonia hedonia", "396": "Fungi, Amanitaceae, Amanita velosa", "397": "Animalia, Nymphalidae, Junonia lemonias", "398": "Animalia, Papilionidae, Papilio garamas", "399": "Animalia, Papilionidae, Papilio canadensis", "400": "goldfish, Carassius auratus", "401": "electric, ray, crampfish, numbfish, torpedo", "402": "cock", "403": "ostrich, Struthio camelus", "404": "goldfinch, Carduelis carduelis", "405": "magpie", "406": "kite", "407": "spotted, salamander, Ambystoma maculatum", "408": "tailed, frog, bell toad, ribbed toad, tailed toad, Ascaphus trui", "409": "banded, gecko", "410": "common, iguana, iguana, Iguana iguana", "411": "whiptail, whiptail lizard", "412": "frilled, lizard, Chlamydosaurus kingi", "413": "triceratops", "414": "hognose, snake, puff adder, sand viper", "415": "harvestman, daddy longlegs, Phalangium opilio", "416": "scorpion", "417": "wolf, spider, hunting spider", "418": "tick", "419": "prairie, chicken, prairie grouse, prairie fowl", "420": "quail", "421": "macaw", "422": "lorikeet", "423": "goose", "424": "black, swan, Cygnus atratus", "425": "platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus", "426": "brain, coral", "427": "hermit, crab", "428": "spoonbill", "429": "oystercatcher, oyster catcher", "430": "pelican", "431": "albatross, mollymawk", "432": "grey, whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus", "433": "killer, whale, killer, orca, grampus, sea wolf, Orcinus orca", "434": "Blenheim, spaniel", "435": "Kerry, blue, terrier", "436": "Boston, bull, Boston terrier", "437": "miniature, schnauzer", "438": "Tibetan, terrier, chrysanthemum dog", "439": "Labrador, retriever", "440": "Brittany, spaniel", "441": "malinois", "442": "komondor", "443": "Doberman, Doberman pinscher", "444": "Samoyed, Samoyede", "445": "standard, poodle", "446": "white, wolf, Arctic wolf, Canis lupus tundrarum", "447": "African, hunting, dog, hyena dog, Cape hunting dog, Lycaon pictus", "448": "hyena, hyaena", "449": "tabby, tabby cat", "450": "leopard, Panthera pardus", "451": "tiger, Panthera tigris", "452": "brown, bear, bruin, Ursus arctos", "453": "ice, bear, polar bear, Ursus Maritimus, Thalarctos maritimus", "454": "mongoose", "455": "leaf, beetle, chrysomelid", "456": "dung, beetle", "457": "grasshopper, hopper", "458": "mantis, mantid", "459": "cicada, cicala", "460": "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk", "461": "damselfly", "462": "ringlet, ringlet butterfly", "463": "sea, cucumber, holothurian", "464": "Angora, Angora rabbit", "465": "guinea, pig, Cavia cobaya", "466": "zebra", "467": "warthog", "468": "hippopotamus, hippo, river horse, Hippopotamus amphibius", "469": "bison", "470": "ram, tup", "471": "impala, Aepyceros melampus", "472": "weasel", "473": "mink", "474": "skunk, polecat, wood pussy", "475": "badger", "476": "armadillo", "477": "gibbon, Hylobates lar", "478": "baboon", "479": "capuchin, ringtail, Cebus capucinus", "480": "howler, monkey, howler", "481": "squirrel, monkey, Saimiri sciureus", "482": "indri, indris, Indri indri, Indri brevicaudatus", "483": "African, elephant, Loxodonta africana", "484": "anemone, fish", "485": "puffer, pufferfish, blowfish, globefish", "486": "airliner", "487": "airship, dirigible", "488": "assault, rifle, assault gun", "489": "banjo", "490": "baseball", "491": "bassoon", "492": "bathtub, bathing tub, bath, tub", "493": "beacon, lighthouse, beacon light, pharos", "494": "beer, glass", "495": "binder, ring-binder", "496": "bolo, tie, bolo, bola tie, bola", "497": "bow, tie, bow-tie, bowtie", "498": "caldron, cauldron", "499": "candle, taper, wax light", "500": "cannon", "501": "canoe", "502": "carousel, carrousel, merry-go-round, roundabout, whirligig", "503": "cello, violoncello", "504": "chain", "505": "chainlink, fence", "506": "chain, saw, chainsaw", "507": "convertible", "508": "cornet, horn, trumpet, trump", "509": "cradle", "510": "crane", "511": "desktop, computer", "512": "digital, clock", "513": "drum, membranophone, tympan", "514": "dumbbell", "515": "Dutch, oven", "516": "electric, fan, blower", "517": "fireboat", "518": "French, horn, horn", "519": "go-kart", "520": "gong, tam-tam", "521": "hammer", "522": "hard, disc, hard disk, fixed disk", "523": "harmonica, mouth organ, harp, mouth harp", "524": "hatchet", "525": "horse, cart, horse-cart", "526": "hourglass", "527": "iron, smoothing iron", "528": "jack-o'-lantern", "529": "jean, blue jean, denim", "530": "jersey, T-shirt, tee shirt", "531": "jigsaw, puzzle", "532": "jinrikisha, ricksha, rickshaw", "533": "lawn, mower, mower", "534": "lipstick, lip rouge", "535": "loudspeaker, speaker, speaker unit, loudspeaker system, speaker system", "536": "mailbox, letter box", "537": "maillot", "538": "maraca", "539": "measuring, cup", "540": "minibus", "541": "mitten", "542": "Model, T", "543": "modem", "544": "mortarboard", "545": "mountain, bike, all-terrain bike, off-roader", "546": "mouse, computer mouse", "547": "muzzle", "548": "necklace", "549": "obelisk", "550": "organ, pipe organ", "551": "oscilloscope, scope, cathode-ray oscilloscope, CRO", "552": "parachute, chute", "553": "pay-phone, pay-station", "554": "pillow", "555": "pirate, pirate ship", "556": "plane, carpenter's plane, woodworking plane", "557": "Polaroid, camera, Polaroid Land camera", "558": "pool, table, billiard table, snooker table", "559": "power, drill", "560": "puck, hockey puck", "561": "racer, race car, racing car", "562": "radio, wireless", "563": "recreational, vehicle, RV, R.V.", "564": "reflex, camera", "565": "revolver, six-gun, six-shooter", "566": "sax, saxophone", "567": "scale, weighing machine", "568": "snorkel", "569": "soccer, ball", "570": "spider, web, spider's web", "571": "stethoscope", "572": "strainer", "573": "streetcar, tram, tramcar, trolley, trolley car", "574": "submarine, pigboat, sub, U-boat", "575": "sweatshirt", "576": "table, lamp", "577": "tank, army tank, armored combat vehicle, armoured combat vehicle", "578": "tennis, ball", "579": "toilet, seat", "580": "torch", "581": "totem, pole", "582": "trailer, truck, tractor trailer, trucking rig, rig, articulated lorry, semi", "583": "umbrella", "584": "volleyball", "585": "waffle, iron", "586": "wall, clock", "587": "wallet, billfold, notecase, pocketbook", "588": "water, tower", "589": "wig", "590": "plate", "591": "cheeseburger", "592": "acorn, squash", "593": "bell, pepper", "594": "banana", "595": "pizza, pizza pie", "596": "cup", "597": "alp", "598": "agaric", "599": "earthstar", "600": "canada book", "601": "panda book", "602": "parchis", "603": "plate", "604": "toy oldman", "605": "toy taobao", "606": "matryoshka", "607": "toy youth", "608": "foxtoy", "609": "notebook", "610": "caterpillar", "611": "red car", "612": "toy phone", "613": "toy cow", "614": "crab", "615": "DDog", "616": "toy deer", "617": "clay figurine", "618": "hello kitty", "619": "prince book", "620": "crunch", "621": "postcard", "622": "poker", "623": "mizimizi", "624": "toy car", "625": "toy man", "626": "pocky", "627": "Nestle", "628": "dwarf", "629": "porcelain cat", "630": "toy woman", "631": "taiwan101", "632": "flowerpot", "633": "toy cat", "634": "Doraemon", "635": "toy dog", "636": "correction tape", "637": "dog sharpener", "638": "coconut juice", "639": "pechoin", "640": "deli penguin", "641": "crest", "642": "Linden honey", "643": "Oreo cookies", "644": "Yunnan Baiyao Aerosol", "645": "Verbatim", "646": "huiyuan juice", "647": "fish sticker", "648": "Six walnut", "649": "nescafe", "650": "hersheys", "651": "run hou tang", "652": "china unicom card", "653": "china mobile card", "654": "Thermometer", "655": "TopStrong Cup", "656": "Extra Chewing Gum", "657": "Pretz", "658": "Nutrient Book", "659": "Corn Shape Pothook", "660": "Aodiao Chocolate Roll", "661": "Blue notebook", "662": "Glue stick", "663": "bus card", "664": "Alice Guitar String Packaging", "665": "Pills package", "666": "Caculator", "667": "Chips Ahoy", "668": "toy jeep", "669": "toy tractor", "670": "disney mat", "671": "Lycium chinensis", "672": "crazybird notes", "673": "zhangjunya", "674": "new year pic", "675": "stamp", "676": "CRISPY", "677": "yuji", "678": "toy carman", "679": "oldman candle", "680": "SevenUp", "681": "mrbrown coffee", "682": "Luffy", "683": "Chopper", "684": "opera face", "685": "garden expo", "686": "red army", "687": "tiny girl", "688": "5yuan", "689": "1yuan", "690": "god of fortune", "691": "smiling boy", "692": "toy golden fish", "693": "wierd fish", "694": "502", "695": "pear book", "696": "AstickMini", "697": "HelloPanda", "698": "toy snowman", "699": "sprike", "700": "Adidas Originals", "701": "Ali", "702": "Autoland", "703": "BarcelonaFC", "704": "BenQ remote", "705": "Boston Celtics", "706": "Burger King", "707": "Chairman Mao Statue", "708": "Che Guevara", "709": "Cheese Peanuts", "710": "Chick Fil A", "711": "Colosseum", "712": "Crown Biscuit", "713": "Donald Duck", "714": "Doublemint", "715": "Dunkin Donuts", "716": "Eiffel", "717": "Elizabeth Tower", "718": "FUJIYA", "719": "FedEX", "720": "Goofy", "721": "JDB", "722": "Jose Carioca", "723": "KFC", "724": "Korean flag", "725": "Kung Fu Panda", "726": "LingLong Pagoda", "727": "Malaysia flag", "728": "Manneken Pis", "729": "Mickey Mouse", "730": "Moominvalley Biscuit", "731": "Mount Rushmore", "732": "National Stadium", "733": "Notre Dame de Paris", "734": "Obama", "735": "Olympic rings", "736": "Paul Frank Julius", "737": "Peking Univ Boya Tower", "738": "Putuo Mountain Avalokitesvara", "739": "R2D2 mailbox", "740": "Renren bookmark", "741": "Smart Milk", "742": "SpongeBob", "743": "Statue of Liberty", "744": "Steven Jobs", "745": "Sunflower", "746": "Suntory Caffe Latte", "747": "Taco Bell", "748": "Taiwan EasyCard", "749": "Taj Mahal", "750": "Temple of Heaven", "751": "Tencent Penguin", "752": "Tiananmen", "753": "Torre di Pisa", "754": "Triumphal Arch", "755": "Tsinghua old gate", "756": "UK flag", "757": "V4Vendetta mask", "758": "Yeale", "759": "akropoli", "760": "baidu", "761": "chelsea", "762": "clapperboard", "763": "coca cola", "764": "costa coffee", "765": "dancing house", "766": "darlie", "767": "einstein bros", "768": "glice superman", "769": "iced black tea", "770": "intel", "771": "iphone", "772": "madrid bear", "773": "mario", "774": "mastermind JAPAN", "775": "may wind", "776": "mooncake box", "777": "navvy", "778": "nice soap", "779": "panda calendar", "780": "pangaoshou", "781": "pooh", "782": "pringles", "783": "road sign school", "784": "rubber duck", "785": "seven eleven", "786": "starbucks", "787": "stop sign", "788": "subway food", "789": "toy girl", "790": "toy m man", "791": "toy snake", "792": "toy tiger", "793": "toy whale", "794": "turinng torso", "795": "u loveit", "796": "walle", "797": "wangzai", "798": "worldCup2010 logo", "799": "zooland", "800": "sofa 4", "801": "coffee_maker 3", "802": "sofa 11", "803": "table 18", "804": "table 4", "805": "stapler 1", "806": "table 7", "807": "chair 28", "808": "lamp 46", "809": "chair 22", "810": "table 13", "811": "coffee_maker 4", "812": "fan 2", "813": "lamp 40", "814": "toaster 6", "815": "stapler 4", "816": "fan 6", "817": "lamp 29", "818": "stapler 2", "819": "kettle 9", "820": "sofa 13", "821": "kettle 10", "822": "cabinet 16", "823": "cabinet 7", "824": "sofa 8", "825": "lamp 43", "826": "coffee_maker 2", "827": "fan 13", "828": "chair 25", "829": "chair 9", "830": "chair 11", "831": "sofa 12", "832": "chair 18", "833": "table 14", "834": "sofa 10", "835": "stapler 5", "836": "lamp 1", "837": "lamp 18", "838": "sofa 2", "839": "lamp 39", "840": "lamp 41", "841": "lamp 35", "842": "stapler 6", "843": "cabinet 2", "844": "mug 6", "845": "bicycle 3", "846": "lamp 7", "847": "fan 16", "848": "fan 10", "849": "kettle 2", "850": "lamp 17", "851": "kettle 5", "852": "kettle 6", "853": "chair 1", "854": "chair 3", "855": "chair 6", "856": "chair 13", "857": "lamp 42", "858": "kettle 8", "859": "lamp 21", "860": "lamp 2", "861": "bicycle 5", "862": "lamp 24", "863": "lamp 16", "864": "cabinet 14", "865": "cabinet 13", "866": "lamp 12", "867": "fan 11", "868": "lamp 9", "869": "sofa 6", "870": "toaster 3", "871": "fan 15", "872": "kettle 7", "873": "coffee_maker 1", "874": "lamp 28", "875": "chair 14", "876": "table 3", "877": "chair 10", "878": "cabinet 9", "879": "mug 9", "880": "lamp 23", "881": "fan 3", "882": "fan 7", "883": "mug 2", "884": "chair 5", "885": "kettle 4", "886": "lamp 15", "887": "mug 10", "888": "lamp 6", "889": "table 10", "890": "chair 29", "891": "chair 24", "892": "chair 15", "893": "coffee_maker 6", "894": "stapler 8", "895": "cabinet 21", "896": "lamp 45", "897": "bicycle 4", "898": "cabinet 6", "899": "cabinet 18", "900": "lamp 48", "901": "chair 27", "902": "table 8", "903": "toaster 2", "904": "lamp 30", "905": "fan 5", "906": "fan 17", "907": "fan 1", "908": "sofa 7", "909": "bicycle 2", "910": "sofa 15", "911": "sofa 14", "912": "cabinet 12", "913": "bicycle 1", "914": "lamp 26", "915": "kettle 11", "916": "mug 3", "917": "chair 16", "918": "chair 17", "919": "chair 2", "920": "table 2", "921": "table 19", "922": "lamp 31", "923": "mug 8", "924": "cabinet 5", "925": "sofa 5", "926": "table 20", "927": "lamp 34", "928": "cabinet 1", "929": "sofa 9", "930": "lamp 47", "931": "mug 7", "932": "toaster 5", "933": "fan 4", "934": "chair 12", "935": "table 6", "936": "chair 7", "937": "chair 26", "938": "stapler 3", "939": "cabinet 19", "940": "lamp 32", "941": "lamp 33", "942": "coffee_maker 5", "943": "lamp 13", "944": "stapler 7", "945": "cabinet 8", "946": "mug 13", "947": "chair 19", "948": "chair 21", "949": "table 1", "950": "table 16", "951": "sofa 16", "952": "cabinet 11", "953": "fan 12", "954": "mug 5", "955": "cabinet 4", "956": "chair 20", "957": "chair 23", "958": "table 17", "959": "kettle 3", "960": "lamp 4", "961": "lamp 10", "962": "fan 9", "963": "fan 8", "964": "cabinet 3", "965": "cabinet 15", "966": "mug 11", "967": "toaster 1", "968": "lamp 14", "969": "cabinet 20", "970": "sofa 1", "971": "lamp 19", "972": "lamp 37", "973": "chair 4", "974": "table 11", "975": "lamp 25", "976": "toaster 4", "977": "lamp 44", "978": "mug 1", "979": "lamp 22", "980": "lamp 5", "981": "lamp 36", "982": "lamp 11", "983": "lamp 27", "984": "lamp 38", "985": "table 15", "986": "lamp 8", "987": "mug 12", "988": "table 9", "989": "chair 8", "990": "mug 4", "991": "lamp 20", "992": "lamp 3", "993": "cabinet 10", "994": "sofa 3", "995": "cabinet 17", "996": "fan 14", "997": "kettle 1", "998": "table 5", "999": "table 12", "1000": "50 Cent", "1001": "A.J. Buckley", "1002": "AJ Michalka", "1003": "Adam Scott", "1004": "Adam Shankman", "1005": "Adèle Exarchopoulos", "1006": "Al Gore", "1007": "Alexa Davalos", "1008": "Alexie Gilmore", "1009": "Alice Braga", "1010": "Alicia Witt", "1011": "Amber Tamblyn", "1012": "Amy Davidson", "1013": "Anaïs Demoustier", "1014": "Andie MacDowell", "1015": "Andy Richter", "1016": "Anne Hathaway", "1017": "Annie Ilonzeh", "1018": "Anthony Michael Hall", "1019": "Antonio Banderas", "1020": "Archie Panjabi", "1021": "Arielle Kebbel", "1022": "Asia Argento", "1023": "Ayelet Zurer", "1024": "Barry Pepper", "1025": "Ben Chaplin", "1026": "Bindi Irwin", "1027": "Brad Grey", "1028": "Brad William Henke", "1029": "Bruce Springsteen", "1030": "Bryce Dallas Howard", "1031": "Cameron Diaz", "1032": "Candice King", "1033": "Cara Buono", "1034": "Carol Alt", "1035": "Celia Imrie", "1036": "Cerina Vincent", "1037": "Channing Tatum", "1038": "Charisma Carpenter", "1039": "Christine Ebersole", "1040": "Christopher Reeve", "1041": "Cicely Tyson", "1042": "Cindy Crawford", "1043": "Claire Danes", "1044": "Clifton Collins Jr.", "1045": "Cody Horn", "1046": "Common", "1047": "Dan Byrd", "1048": "Dan Fogler", "1049": "Dana Delany", "1050": "Daniel Day-Lewis", "1051": "Daniel Sunjata", "1052": "Danny Boyle", "1053": "Darby Stanchfield", "1054": "Dave Chappelle", "1055": "Dave Franco", "1056": "Deborah Ann Woll", "1057": "Dennis Quaid", "1058": "Donald Glover", "1059": "Dreama Walker", "1060": "Dylan Baker", "1061": "Dylan Minnette", "1062": "Eddie Griffin", "1063": "Eddie Izzard", "1064": "Ellar Coltrane", "1065": "Emily Kinney", "1066": "Emily Procter", "1067": "Eriq La Salle", "1068": "Filippo Timi", "1069": "Frank Langella", "1070": "Gilles Marini", "1071": "Helena Mattsson", "1072": "Hilary Swank", "1073": "Holt McCallany", "1074": "Ian Harding", "1075": "Ian McShane", "1076": "Imogen Poots", "1077": "Irrfan Khan", "1078": "Isabelle Huppert", "1079": "Isaiah Washington", "1080": "Jack Nicholson", "1081": "Jacki Weaver", "1082": "James Cameron", "1083": "James Frain", "1084": "James Purefoy", "1085": "James Wolk", "1086": "Jamie Dornan", "1087": "Jamie-Lynn Sigler", "1088": "Jane Adams", "1089": "Jason Behr", "1090": "Jay Harrington", "1091": "Jeffrey Donovan", "1092": "Jenifer Lewis", "1093": "Jeremy Davies", "1094": "Jeri Ryan", "1095": "Joe Mantegna", "1096": "Joey Fatone", "1097": "Johnny Simmons", "1098": "Judd Hirsch", "1099": "Jude Law", "1100": "Kara DioGuardi", "1101": "Kari Matchett", "1102": "Karl Urban", "1103": "Kate Flannery", "1104": "Katheryn Winnick", "1105": "Kathleen Quinlan", "1106": "Kathryn Morris", "1107": "Kayla Ewell", "1108": "Keith David", "1109": "Kelly Clarkson", "1110": "Keri Russell", "1111": "Kirsten Vangsness", "1112": "Kit Harington", "1113": "Kris Kristofferson", "1114": "Kunal Nayyar", "1115": "Kyle Gallner", "1116": "Lana Parrilla", "1117": "Lea Michele", "1118": "Lena Dunham", "1119": "Lena Headey", "1120": "Lily James", "1121": "Lisa Cholodenko", "1122": "Lisa Edelstein", "1123": "LisaRaye McCoy", "1124": "Liza Weil", "1125": "Logan Marshall-Green", "1126": "Loretta Devine", "1127": "Louis C.K.", "1128": "Luciana Pedraza", "1129": "Lyndie Greenwood", "1130": "M. Night Shyamalan", "1131": "Magic Johnson", "1132": "Maisie Williams", "1133": "Malcolm McDowell", "1134": "Malin Akerman", "1135": "Mark Moses", "1136": "Mary-Kate Olsen", "1137": "Matthew Fox", "1138": "Max von Sydow", "1139": "Megalyn Echikunwoke", "1140": "Megan Fox", "1141": "Melissa Rauch", "1142": "Michael Gambon", "1143": "Michael Pitt", "1144": "Michelle Borth", "1145": "Miranda Cosgrove", "1146": "Missy Peregrym", "1147": "Molly Parker", "1148": "Monet Mazur", "1149": "Mélanie Laurent", "1150": "Nadia Bjorlin", "1151": "Naomi Campbell", "1152": "Nat Wolff", "1153": "Neil LaBute", "1154": "Nicollette Sheridan", "1155": "Noomi Rapace", "1156": "Oksana Baiul", "1157": "Olga Kurylenko", "1158": "Olivia Wilde", "1159": "Oprah Winfrey", "1160": "Paige Turco", "1161": "Parminder Nagra", "1162": "Patricia Arquette", "1163": "Penn Badgley", "1164": "Phylicia Rashad", "1165": "Q'orianka Kilcher", "1166": "Rachael Taylor", "1167": "Rachel Roberts", "1168": "Ralph Fiennes", "1169": "Ramon Rodriguez", "1170": "Rene Russo", "1171": "Richard Kind", "1172": "Rick Gonzalez", "1173": "Riki Lindhome", "1174": "Robert Forster", "1175": "Roman Polanski", "1176": "Ron Livingston", "1177": "Rufus Wainwright", "1178": "Ryan Reynolds", "1179": "Sarah Roemer", "1180": "Sasha Pieterse", "1181": "Schuyler Fisk", "1182": "Scott Cooper", "1183": "Shanica Knowles", "1184": "Shannyn Sossamon", "1185": "Shawn Levy", "1186": "Steve Guttenberg", "1187": "Steve Martin", "1188": "Svetlana Metkina", "1189": "Tamara Taylor", "1190": "Taylor Hicks", "1191": "Teri Polo", "1192": "Tim Allen", "1193": "Tom Hiddleston", "1194": "Trevor Donovan", "1195": "Tye Sheridan", "1196": "Vanessa Williams", "1197": "Victor Webster", "1198": "Vin Diesel", "1199": "Whitney Cummings"}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GPR1200 Dataset
2 |
3 | **GPR1200: A Benchmark for General-Purpose Content-Based Image Retrieval** ([ArXiv](https://arxiv.org/abs/2111.13122))
4 |
5 | **Konstantin Schall, Kai Uwe Barthel, Nico Hezel, Klaus Jung**
6 |
7 | [Visual Computing Group HTW Berlin](https://visual-computing.com/)
8 |
9 |
10 |
11 |
12 |
13 |
14 | Similar to most vision related tasks, deep learning models have taken over in the field of content-based image retrieval (CBIR) over the course of the last decade. However, most publications that aim to optimise neural networks for CBIR, train and test their models on domain specific datasets. It is therefore unclear, if those networks can be used as a general-purpose image feature extractor. After analyzing popular image retrieval test sets we decided to manually curate GPR1200, an easy to use and accessible but challenging benchmark dataset with 1200 categories and 10 class examples. Classes and images were manually selected from six publicly available datasets of different image areas, ensuring high class diversity and clean class boundaries.
15 |
16 | ### Results:
17 |
18 |
19 |
20 | ## Download Instructions:
21 |
22 | The images are available under this [link](https://visual-computing.com/files/GPR1200/GPR1200.zip). Unziping the content will result in an "images" folder, which contains all 12000 images. Each filename consists of a combination of the GPR1200 category ID and the original name: \
23 | **"{category ID}_{original name}.jpg**
24 |
25 | #### Update:
26 | We now added a [JSON document](GPR1200_categoryNumber_to_text.json) that provides textual information for each of the GPR1200 categories. Please note, however, that the quality and granularity of the textual description varies greatly between subsets, since this information was obtained from the original dataset sources.
27 |
28 | ## Evaluation Protocol:
29 |
30 | Images are not devided into query and index sets for evaluation and the full mean average precision value is used as the metric. Instructions and evalution code can be found in this repository.
31 |
32 | [This notebook](eval/eval_notebook.ipynb) contains evaluation code for several models with Pytorch and the awesome [timm](https://github.com/rwightman/pytorch-image-models) library.
33 |
34 | If you have precomputed embeddings for the dataset, you can run the eval script with the following command:
35 |
36 | ```bash
37 | python ./eval/evaluate.py --evalfile-path '/path/to/embeddings' \
38 | --mode 'embeddings' \
39 | --dataset-path '/path/to/GPR1200/images'
40 | ```
41 |
42 | In this case an evaluation file has to be provided that contains embeddings in the order created by the GPR1200 dataset object. This can be a npy file or a pickable python list.
43 |
44 | ```python
45 | GPR1200_dataset = GPR1200('/path/to/GPR1200/images')
46 | ```
47 |
48 | If you work with local features, it is best to provide nearest neighbours indices. For this case run the evaluation script in the indices mode:
49 |
50 | ```bash
51 | python ./eval/evaluate.py --evalfile-path='/path/to/indices' \
52 | --mode='indices' \
53 | --dataset-path='/path/to/GPR1200/images'
54 | ```
55 |
56 | ## License Informations:
57 |
58 | This dataset is available for for non-commercial research and educational purposes only and the copyright belongs to the original owners. If any of the images belongs to you and you would like it removed, please kindly inform us, we will remove it from our dataset immediately. Since all images were curated from other publicly available datasets, please visit the respective dataset websites for additional license informations.
59 |
60 | * [Google Landmarks v2](https://github.com/cvdfoundation/google-landmark)
61 | * [iNaturalist](https://www.inaturalist.org/pages/developers)
62 | * [ImageNet Sketch](https://github.com/HaohanWang/ImageNet-Sketch)
63 | * [INSTRE](http://123.57.42.89/instre/home.html)
64 | * [Stanford Online Products](https://cvgl.stanford.edu/projects/lifted_struct/)
65 | * [IMDB-WIKI](https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/)
66 |
67 |
68 | ## Reference
69 |
70 | Reference to cite when you use the GPR1200 dataset in a research paper:
71 | ```
72 | @inproceedings{GPR1200,
73 | author = {Schall, Konstantin and Barthel, Kai Uwe and Hezel, Nico and Jung, Klaus},
74 | title = {GPR1200: A Benchmark for General-Purpose Content-Based Image Retrieval},
75 | year = {2022},
76 | isbn = {978-3-030-98357-4},
77 | publisher = {Springer-Verlag},
78 | address = {Berlin, Heidelberg},
79 | url = {https://doi.org/10.1007/978-3-030-98358-1_17},
80 | doi = {10.1007/978-3-030-98358-1_17},
81 | booktitle = {MultiMedia Modeling: 28th International Conference, MMM 2022, Phu Quoc, Vietnam, June 6–10, 2022, Proceedings, Part I},
82 | pages = {205–216},
83 | numpages = {12},
84 | location = {Phu Quoc, Vietnam}
85 | }
86 | ```
--------------------------------------------------------------------------------
/eval/GPR1200.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import os
3 | from utils import *
4 |
5 |
6 | class GPR1200:
7 |
8 | """GPR1200 class
9 |
10 | The dataset contains 12k images from 1200 diverse categories.
11 | """
12 |
13 | _base_dir = None
14 |
15 | _image_data = None
16 | _ground_truth = None
17 |
18 | _iterator_index = 0
19 |
20 | def __init__(self, base_dir):
21 | """
22 | Load the image information from the drive
23 |
24 | Parameters
25 | ----------
26 | base_dir : string
27 | GPR1200 base directory path
28 | """
29 | self._base_dir = base_dir
30 |
31 | gpr10x1200_cats, gpr10x1200_files = [], []
32 |
33 | data = sorted(os.listdir(base_dir), key=lambda a: int(os.path.basename(a).split("_")[0]))
34 | for file in data:
35 | file_path = os.path.join(base_dir, file)
36 | cat = os.path.basename(file).split("_")[0]
37 | gpr10x1200_cats.append(cat)
38 | gpr10x1200_files.append(file_path)
39 |
40 | gpr10x1200_cats, gpr10x1200_files = np.array(gpr10x1200_cats), np.array(gpr10x1200_files)
41 |
42 | #sorted_indx = np.argsort(ur10x1000_files)
43 | self._image_files = gpr10x1200_files#[sorted_indx]
44 | self._image_categories = gpr10x1200_cats#[sorted_indx]
45 |
46 | @staticmethod
47 | def __name__():
48 | """
49 | Name of the dataset
50 | """
51 | return "GPR1200"
52 |
53 | def __str__(self):
54 | """
55 | Readable string representation
56 | """
57 | return "" + self.__name__() + "(" + str(self.__len__()) + ") in " + self.base_dir
58 |
59 | def __len__(self):
60 | """
61 | Amount of elements
62 | """
63 | return len(self._image_data)
64 |
65 | @property
66 | def base_dir(self):
67 | """
68 | Path to the base directory
69 |
70 | Returns
71 | -------
72 | path : str
73 | Path to the base directory
74 | """
75 | return self._base_dir
76 |
77 | @property
78 | def image_dir(self):
79 | """
80 | Path to the image directory
81 |
82 | Returns
83 | -------
84 | path : str
85 | Path to the image directory
86 | """
87 | return self._base_dir + "images/"
88 |
89 | @property
90 | def image_files(self):
91 | """
92 | List of image files. The order of the list is important for other methods.
93 |
94 | Returns
95 | -------
96 | file_list : list(str)
97 | List of file names
98 | """
99 | return self._image_files
100 |
101 |
102 | def evaluate(self, features=None, indices=None, compute_partial=False, float_n=4, metric="cosine"):
103 | """
104 | Compute the mean average precision of each part of this combined data set.
105 | Providing just the 'features' will assume the manhatten distance between all images will be computed
106 | before calculating the mean average precision. This metric can
107 | be changed with any scikit learn 'distance_metric'.
108 |
109 |
110 | Parameters
111 | ----------
112 | features : ndarray
113 | matrix representing the embeddings of all the images in the dataset
114 | indices: array-lile, shape = [n_samples_Q, n_samples_DB]
115 | Nearest neighbours indices
116 |
117 | """
118 |
119 | cats = self._image_categories
120 |
121 | if (indices is None) & (features is None):
122 | raise ValueError("Either indices or features_DB has to be provided ")
123 |
124 | if indices is None:
125 | aps = compute_mean_average_precision(cats, features_DB=features, metric=metric)
126 | if features is None:
127 | aps = compute_mean_average_precision(cats, indices=indices, metric=metric)
128 |
129 | all_map = np.round(np.mean(aps), decimals=float_n)
130 |
131 | if compute_partial:
132 |
133 | cl_map = np.round(np.mean(aps[:2000]), decimals=float_n)
134 | iNat_map = np.round(np.mean(aps[2000:4000]), decimals=float_n)
135 | sketch_map = np.round(np.mean(aps[4000:6000]), decimals=float_n)
136 | instre_map = np.round(np.mean(aps[6000:8000]), decimals=float_n)
137 | sop_map = np.round(np.mean(aps[8000:10000]), decimals=float_n)
138 | faces_map = np.round(np.mean(aps[10000:]), decimals=float_n)
139 |
140 | return all_map, cl_map, iNat_map, sketch_map, instre_map, sop_map, faces_map
141 |
142 | return all_map
--------------------------------------------------------------------------------
/eval/eval_notebook.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "import torch\n",
10 | "import torch.nn as nn\n",
11 | "import torch.nn.functional as F\n",
12 | "import torchvision\n",
13 | "from torchvision import transforms as pth_transforms\n",
14 | "\n",
15 | "import numpy as np\n",
16 | "from PIL import Image\n",
17 | "\n",
18 | "from tqdm import *\n",
19 | "\n",
20 | "import time\n",
21 | "import timm\n",
22 | "\n",
23 | "from timm.data import resolve_data_config\n",
24 | "from timm.data.transforms_factory import create_transform\n",
25 | "\n",
26 | "from GPR1200 import GPR1200"
27 | ]
28 | },
29 | {
30 | "cell_type": "markdown",
31 | "metadata": {},
32 | "source": [
33 | "### Define models that should be evaluated with timm"
34 | ]
35 | },
36 | {
37 | "cell_type": "code",
38 | "execution_count": 2,
39 | "metadata": {},
40 | "outputs": [],
41 | "source": [
42 | "model_list = [\n",
43 | " \"resnetv2_101x1_bitm\",\n",
44 | " \"resnetv2_101x1_bitm_in21k\",\n",
45 | " \"resnetv2_101x3_bitm\",\n",
46 | " \"resnetv2_101x3_bitm_in21k\",\n",
47 | " \"tf_efficientnetv2_l\",\n",
48 | " \"tf_efficientnetv2_l_in21ft1k\",\n",
49 | " \"tf_efficientnetv2_l_in21k\",\n",
50 | " \"vit_base_patch16_224\",\n",
51 | " \"vit_base_patch16_224_in21k\",\n",
52 | " \"vit_large_patch16_224\",\n",
53 | " \"vit_large_patch16_224_in21k\",\n",
54 | " \"deit_base_patch16_224\",\n",
55 | " \"deit_base_distilled_patch16_224\",\n",
56 | " \"swin_base_patch4_window7_224\",\n",
57 | " \"swin_base_patch4_window7_224_in22k\",\n",
58 | " \"swin_large_patch4_window7_224\",\n",
59 | " \"swin_large_patch4_window7_224_in22k\"\n",
60 | " ]"
61 | ]
62 | },
63 | {
64 | "cell_type": "markdown",
65 | "metadata": {},
66 | "source": [
67 | "### Create Dataset Class and GPR1200 Dataset Object"
68 | ]
69 | },
70 | {
71 | "cell_type": "code",
72 | "execution_count": 3,
73 | "metadata": {},
74 | "outputs": [],
75 | "source": [
76 | "class TestDataset(torch.utils.data.Dataset):\n",
77 | " 'Characterizes a dataset for PyTorch'\n",
78 | " def __init__(self, file_paths):\n",
79 | " 'Initialization'\n",
80 | " self.file_paths = file_paths\n",
81 | " \n",
82 | " def __len__(self):\n",
83 | " 'Denotes the total number of samples'\n",
84 | " return len(self.file_paths)\n",
85 | "\n",
86 | " def __getitem__(self, index):\n",
87 | " 'Generates one sample of data'\n",
88 | " # Select sample\n",
89 | " return ppc_image(self.file_paths[index])"
90 | ]
91 | },
92 | {
93 | "cell_type": "code",
94 | "execution_count": 4,
95 | "metadata": {},
96 | "outputs": [],
97 | "source": [
98 | "GPR1200_dataset = GPR1200(\"/media/Data/images/GPR10x1200/images\")\n",
99 | "image_filepaths = GPR1200_dataset.image_files"
100 | ]
101 | },
102 | {
103 | "cell_type": "markdown",
104 | "metadata": {},
105 | "source": [
106 | "### Start Evaluation of selected models"
107 | ]
108 | },
109 | {
110 | "cell_type": "code",
111 | "execution_count": null,
112 | "metadata": {},
113 | "outputs": [
114 | {
115 | "name": "stderr",
116 | "output_type": "stream",
117 | "text": [
118 | "100%|██████████| 375/375 [01:41<00:00, 3.70it/s]\n"
119 | ]
120 | },
121 | {
122 | "name": "stdout",
123 | "output_type": "stream",
124 | "text": [
125 | "torch.Size([32, 2048])\n",
126 | "---------name: resnetv2_101x1_bitm -- dim: (12000, 2048)---------\n",
127 | "GPR1200 mAP: 0.5559\n",
128 | "Landmarks: 0.8221, IMSketch: 0.4709, iNat: 0.4298, Instre: 0.5292, SOP: 0.861, faces: 0.2227\n",
129 | "\n"
130 | ]
131 | },
132 | {
133 | "name": "stderr",
134 | "output_type": "stream",
135 | "text": [
136 | "100%|██████████| 375/375 [00:24<00:00, 15.01it/s]\n"
137 | ]
138 | },
139 | {
140 | "name": "stdout",
141 | "output_type": "stream",
142 | "text": [
143 | "torch.Size([32, 2048])\n",
144 | "---------name: resnetv2_101x1_bitm_in21k -- dim: (12000, 2048)---------\n",
145 | "GPR1200 mAP: 0.5494\n",
146 | "Landmarks: 0.8112, IMSketch: 0.4113, iNat: 0.4197, Instre: 0.5181, SOP: 0.8695, faces: 0.2668\n",
147 | "\n"
148 | ]
149 | },
150 | {
151 | "name": "stderr",
152 | "output_type": "stream",
153 | "text": [
154 | "100%|██████████| 375/375 [08:01<00:00, 1.28s/it]\n"
155 | ]
156 | },
157 | {
158 | "name": "stdout",
159 | "output_type": "stream",
160 | "text": [
161 | "torch.Size([32, 6144])\n",
162 | "---------name: resnetv2_101x3_bitm -- dim: (12000, 6144)---------\n",
163 | "GPR1200 mAP: 0.5694\n",
164 | "Landmarks: 0.8297, IMSketch: 0.5292, iNat: 0.4012, Instre: 0.5564, SOP: 0.8722, faces: 0.2273\n",
165 | "\n"
166 | ]
167 | },
168 | {
169 | "name": "stderr",
170 | "output_type": "stream",
171 | "text": [
172 | "100%|██████████| 375/375 [02:14<00:00, 2.79it/s]\n"
173 | ]
174 | },
175 | {
176 | "name": "stdout",
177 | "output_type": "stream",
178 | "text": [
179 | "torch.Size([32, 6144])\n",
180 | "---------name: resnetv2_101x3_bitm_in21k -- dim: (12000, 6144)---------\n"
181 | ]
182 | }
183 | ],
184 | "source": [
185 | "# CUDA for PyTorch\n",
186 | "use_cuda = torch.cuda.is_available()\n",
187 | "device = torch.device(\"cuda:0\" if use_cuda else \"cpu\")\n",
188 | "\n",
189 | "\n",
190 | "for m_name in model_list:\n",
191 | " \n",
192 | " # create models and their respective preprocessing chain\n",
193 | " bb_model = timm.create_model(m_name, pretrained=True, num_classes=0)\n",
194 | " data_config = resolve_data_config({}, model=bb_model)\n",
195 | " transform = create_transform(**data_config)\n",
196 | " \n",
197 | " bb_model.to(device)\n",
198 | " bb_model.eval()\n",
199 | " \n",
200 | " \n",
201 | " # Preprocessing that will be run on each individuall test image\n",
202 | " def ppc_image(path):\n",
203 | " \n",
204 | " with open(path, 'rb') as f:\n",
205 | " img = Image.open(f)\n",
206 | " img = img.convert('RGB')\n",
207 | "\n",
208 | " img = transform(img)\n",
209 | "\n",
210 | " return img\n",
211 | " \n",
212 | " # dataloader parameters\n",
213 | " batch_size = 32\n",
214 | " params = {'batch_size': batch_size,\n",
215 | " 'shuffle': False,\n",
216 | " 'num_workers': 6}\n",
217 | "\n",
218 | " gpr1200_loader = torch.utils.data.DataLoader(TestDataset(image_filepaths), **params)\n",
219 | " \n",
220 | " \n",
221 | " # some addtional info\n",
222 | " time_start = time.time()\n",
223 | " fv_list = []\n",
224 | " \n",
225 | " pbar = tqdm(enumerate(gpr1200_loader), position=0, leave=True, total=(int(len(image_filepaths) / batch_size)))\n",
226 | " \n",
227 | " with torch.set_grad_enabled(False):\n",
228 | " for i, local_batch in pbar:\n",
229 | "\n",
230 | " local_batch = local_batch.to(device)\n",
231 | " fv = bb_model(local_batch)\n",
232 | " \n",
233 | " fv = fv / torch.norm(fv, dim=-1, keepdim=True)\n",
234 | " \n",
235 | " fv_list += list(fv.cpu().numpy())\n",
236 | " pbar.update()\n",
237 | " \n",
238 | " print(fv.shape)\n",
239 | " \n",
240 | " # display some addtional info\n",
241 | " fv_list = np.array(fv_list).astype(float)\n",
242 | " print(\"---------name: {} -- dim: {}---------\".format(m_name, fv_list.shape))\n",
243 | " time_needed = np.round((time.time() - time_start) / len(image_filepaths) * 1000, 2)\n",
244 | " dim = fv_list.shape[-1]\n",
245 | " input_size = data_config[\"input_size\"]\n",
246 | " \n",
247 | " \n",
248 | " # run this line to evaluate dataset embeddings\n",
249 | " gpr, lm, iNat, ims, instre, sop, faces = GPR1200_dataset.evaluate(fv_list, compute_partial=True)\n",
250 | " print(\"GPR1200 mAP: {}\".format(gpr))\n",
251 | " print(\"Landmarks: {}, IMSketch: {}, iNat: {}, Instre: {}, SOP: {}, faces: {}\".format(lm, ims, iNat, instre, sop, faces))\n",
252 | " print()\n",
253 | " \n",
254 | " del bb_model"
255 | ]
256 | }
257 | ],
258 | "metadata": {
259 | "kernelspec": {
260 | "display_name": "Python [conda env:pytorch]",
261 | "language": "python",
262 | "name": "conda-env-pytorch-py"
263 | },
264 | "language_info": {
265 | "codemirror_mode": {
266 | "name": "ipython",
267 | "version": 3
268 | },
269 | "file_extension": ".py",
270 | "mimetype": "text/x-python",
271 | "name": "python",
272 | "nbconvert_exporter": "python",
273 | "pygments_lexer": "ipython3",
274 | "version": "3.8.5"
275 | },
276 | "varInspector": {
277 | "cols": {
278 | "lenName": 16,
279 | "lenType": 16,
280 | "lenVar": 40
281 | },
282 | "kernels_config": {
283 | "python": {
284 | "delete_cmd_postfix": "",
285 | "delete_cmd_prefix": "del ",
286 | "library": "var_list.py",
287 | "varRefreshCmd": "print(var_dic_list())"
288 | },
289 | "r": {
290 | "delete_cmd_postfix": ") ",
291 | "delete_cmd_prefix": "rm(",
292 | "library": "var_list.r",
293 | "varRefreshCmd": "cat(var_dic_list()) "
294 | }
295 | },
296 | "types_to_exclude": [
297 | "module",
298 | "function",
299 | "builtin_function_or_method",
300 | "instance",
301 | "_Feature"
302 | ],
303 | "window_display": false
304 | }
305 | },
306 | "nbformat": 4,
307 | "nbformat_minor": 4
308 | }
309 |
--------------------------------------------------------------------------------
/eval/evaluate.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import numpy as np
3 | import pickle
4 | from GPR1200 import GPR1200
5 |
6 |
7 | def add_parser_arguments(parser):
8 |
9 | parser.add_argument(
10 | "--evalfile-path",
11 | metavar="EVALFILE",
12 | help="Path to embeddings or indices file"
13 | )
14 |
15 | parser.add_argument(
16 | "--dataset-path",
17 | metavar="DSFILEPATH",
18 | help="Path to the GPR1200 images folder"
19 | )
20 |
21 | parser.add_argument(
22 | "--mode",
23 | metavar="MODE",
24 | default="embeddings",
25 | choices=["embeddings", "indices"],
26 | help="Run this script in embeddings mode if you have one embedding per image \
27 | or indices mode with precomputed nearest neighbour indices in any other case",
28 | )
29 |
30 | def main(args):
31 |
32 | GPR1200_dataset = GPR1200(args.dataset_path)
33 |
34 | try:
35 | print("Trying to load evalfile with numpy")
36 | evalfile = np.load(args.evalfile_path)
37 | print("Load succesfull. Data shape:", evalfile.shape)
38 | except:
39 | print("Numpy load failed, falling back to pickle")
40 |
41 | try:
42 | with open(args.evalfile_path,'rb') as f:
43 | evalfile = pickle.load(f)
44 | evalfile = np.array(evalfile)
45 | print("Load succesfull. Data shape:", evalfile.shape)
46 | except:
47 | raise ValueError("Invalid evalfile. \
48 | Make sure that the file can be loaded with either numpy or pickle")
49 |
50 | if args.mode == "embeddings":
51 | results = GPR1200_dataset.evaluate(features=evalfile, compute_partial=True)
52 | elif args.mode == "indices":
53 | results = GPR1200_dataset.evaluate(indices=evalfile, compute_partial=True)
54 | else:
55 | raise ValueError("Invalid mode selected. \
56 | Options are embeddings and indices")
57 |
58 | print()
59 | print("---------Results:")
60 | gpr, lm, iNat, ims, instre, sop, faces = results
61 | print("GPR1200 mAP: {}".format(gpr))
62 | print("Landmarks: {}, IMSketch: {}, iNat: {}, Instre: {}, SOP: {}, faces: {}".format(lm, ims, iNat, instre, sop, faces))
63 |
64 | if __name__ == "__main__":
65 |
66 | parser = argparse.ArgumentParser(
67 | description="GPR1200 Evaluation",
68 | formatter_class=argparse.RawDescriptionHelpFormatter,
69 | )
70 |
71 | add_parser_arguments(parser)
72 |
73 | args, rest = parser.parse_known_args()
74 |
75 | main(args)
76 |
--------------------------------------------------------------------------------
/eval/utils.py:
--------------------------------------------------------------------------------
1 |
2 | import numpy as np
3 | import torch
4 |
5 | def get_sorted_distances(features_DB, features_Q=None, k=None, metric="cosine"):
6 | """
7 | Computes the similarity or distance of up to two sets of embeddings and returns
8 | similarities/distances and indices of k nearest neighbours.
9 |
10 | Parameters
11 | ----------
12 | features_DB : array-like, shape = [n_samples, dimensionality]
13 | Database feature vectors
14 | features_Q : array-like, shape = [n_samples, dimensionality]
15 | Query feature vectors. If this parameter is not given, the database fv´s are used as queries.
16 | k : int
17 | k nearest neighbours
18 | metric : str
19 | Metric to use for distance calculation. Options are "cosine" or "L2".
20 | """
21 | if features_Q is None:
22 | features_Q = features_DB
23 |
24 | if k is None:
25 | k = len(features_DB)
26 |
27 | features_DB_torch = torch.tensor(features_DB, dtype=torch.float32)
28 | features_Q_torch = torch.tensor(features_Q, dtype=torch.float32)
29 |
30 | if metric == "cosine":
31 | similarities = features_Q_torch @ features_DB_torch.T # Compute cosine similarities
32 | indices = torch.argsort(similarities, dim=1, descending=True)[:, :k] # Get top-k indices
33 | sorted_distances = torch.gather(similarities, 1, indices)
34 |
35 | elif metric == "L2":
36 |
37 | dists = torch.cdist(features_Q_torch, features_DB_torch, p=2) # Compute L2 distances using torch
38 | indices = torch.argsort(dists, dim=1)[:, :k] # Get top-k indices
39 | sorted_distances = torch.gather(dists, 1, indices)
40 |
41 | else:
42 | raise ValueError(f"Unsupported metric: {metric}. Use 'cosine' or 'L2'.")
43 |
44 | return sorted_distances.numpy(), indices.numpy()
45 |
46 |
47 |
48 |
49 | def get_average_precision_score(y_true, k=None):
50 | """
51 | Average precision at rank k
52 | Modified to only work with sorted ground truth labels
53 | From: https://gist.github.com/mblondel/7337391
54 |
55 | Parameters
56 | ----------
57 | y_true : array-like, shape = [n_samples]
58 | Binary ground truth (True if relevant, False if irrelevant), sorted by the distances.
59 | k : int
60 | Rank.
61 | Returns
62 | -------
63 | average precision @k : float
64 | """
65 | if k is None:
66 | k = np.inf
67 |
68 | n_positive = np.sum(y_true.astype(np.int32) == 1)
69 |
70 | if n_positive == 0:
71 | # early return in cases where no positives are among the ranks
72 | return 0
73 |
74 | y_true = y_true[:min(y_true.shape[0], k)].astype(np.int32)
75 |
76 | score = 0
77 | n_positive_seen = 0
78 | pos_indices = np.where(y_true == 1)[0]
79 |
80 | for i in pos_indices:
81 | n_positive_seen += 1
82 | score += n_positive_seen / (i + 1.0)
83 |
84 | return score / n_positive
85 |
86 |
87 | def compute_mean_average_precision(categories_DB,
88 | features_DB=None,
89 | features_Q=None,
90 | categories_Q=None,
91 | indices=None,
92 | metric="cosine",
93 | k=None):
94 | """
95 | Performs a search for k neirest neighboors with the specified indexing method and computes the mean average precision@k
96 |
97 | Parameters
98 | ----------
99 | features_DB : array-like, shape = [n_samples, dimensionality]
100 | Database feature vectors
101 | features_Q : array-like, shape = [n_samples, dimensionality]
102 | Query feature vectors. If this parameter is not given, the database fv´s are used as querries
103 | categories_DB : array-like, shape = [n_samples_DB]
104 | Database categories
105 | categories_Q : array-like, shape = [n_samples_Q]
106 | Query categories. If this parameter is not given, the database categories are used
107 | indices: array-lile, shape = [n_samples_Q, n_samples_DB]
108 | Nearest neighbours indices
109 | k : int
110 | Mean average precision at @k value. If np.inf, this function computes the mean average precision score
111 | Returns
112 | -------
113 | Mean average precision @k : float
114 | """
115 |
116 | if (indices is None) & (features_DB is None):
117 | raise ValueError("Either indices or features_DB has to be provided ")
118 |
119 | if features_Q is None: features_Q = features_DB
120 | if categories_Q is None: categories_Q = categories_DB
121 |
122 | if (indices is None):
123 | _, indices = get_sorted_distances(features_DB, features_Q, k=k, metric=metric)
124 |
125 | aps = []
126 | for i in range(0, len(indices)):
127 | aps.append(get_average_precision_score((categories_DB[indices[i]] == categories_Q[i]), k))
128 |
129 | return aps
130 |
--------------------------------------------------------------------------------
/images/GPR_main_pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Visual-Computing/GPR1200/bfd5a403ac244872d27d4744a752cc1b925b310b/images/GPR_main_pic.jpg
--------------------------------------------------------------------------------
/images/result_table.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Visual-Computing/GPR1200/bfd5a403ac244872d27d4744a752cc1b925b310b/images/result_table.JPG
--------------------------------------------------------------------------------
/images/result_table_description.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Visual-Computing/GPR1200/bfd5a403ac244872d27d4744a752cc1b925b310b/images/result_table_description.JPG
--------------------------------------------------------------------------------