Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat_testing' into dev_refactor
- Loading branch information
Showing
14 changed files
with
340 additions
and
993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import RHS2007, domijan2015, murray2020 | ||
__all__ = ["RHS2007", "domijan2015", "murray2020"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import json | ||
from hashlib import md5 | ||
|
||
import numpy as np | ||
|
||
|
||
def arrs_to_checksum(stim, keys=["img", "mask"]): | ||
# Hash (md5) values, and save only the hex | ||
for key in keys: | ||
stim[key] = md5(np.ascontiguousarray(stim[key])).hexdigest() | ||
|
||
return stim | ||
|
||
|
||
def to_json(stim, filename): | ||
# stimulus-dict(s) as (pretty) JSON | ||
with open(filename, "w", encoding="utf-8") as f: | ||
json.dump(stim, f, ensure_ascii=False, indent=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"WE_thick": { | ||
"img": "4e6d0130b6f37eeaff7f568c31c68325", | ||
"mask": "b523788d266b5f7ded635717acad5a54" | ||
}, | ||
"WE_thin_wide": { | ||
"img": "d0540819930d454dd272f9ee91739114", | ||
"mask": "82738b790feeb3d762822cf13136abd5" | ||
}, | ||
"WE_dual": { | ||
"img": "0eb7042718b74b8973d8e945f0454867", | ||
"mask": "88a5faacb4e5db2d7f5761066dc92f38" | ||
}, | ||
"WE_anderson": { | ||
"img": "34284f8560d01e2231fe30b9362e8577", | ||
"mask": "ec5671221e98b96b6b35622424266eaf" | ||
}, | ||
"WE_howe": { | ||
"img": "f68a1210ae539a0dd4976bc8eaa701a8", | ||
"mask": "c05d4411f96114b3b7ffe73254ff2875" | ||
}, | ||
"WE_radial_thick_small": { | ||
"img": "b92d533177eed4a009625d6d2cb0da59", | ||
"mask": "78da2d5ec63b48e53f5bdbd90d2b82b9" | ||
}, | ||
"WE_radial_thick": { | ||
"img": "d0067dfb57016354f7b107ae410d217c", | ||
"mask": "482a1a903b54df01f3e16cb284b8bfeb" | ||
}, | ||
"WE_radial_thin_small": { | ||
"img": "94e6b546f8ad5c6b95a502a8b409c00d", | ||
"mask": "38a4da8d63237ac33b1a7f5e1cd021ec" | ||
}, | ||
"WE_circular1": { | ||
"img": "2ecc5cb5ad9cfef50de681ee3b923f46", | ||
"mask": "32f876b2d56ce7a9f712f7784dc60289" | ||
}, | ||
"WE_circular05": { | ||
"img": "5d09c011b57d3afffcaf82e7aea84b34", | ||
"mask": "dde7cc1ee48b2d47b37fbe9422e0f677" | ||
}, | ||
"WE_circular025": { | ||
"img": "ec3feee88c49aed0a5554c3838be8519", | ||
"mask": "e4e9c650c9a247180211dbcde0e38fb2" | ||
}, | ||
"grating_induction": { | ||
"img": "da62004fdc198660b44529f8b6358362", | ||
"mask": "40f02639e692658b9f357b09c11e9df1" | ||
}, | ||
"sbc_large": { | ||
"img": "8c1d036742bdf01159177f42625fe144", | ||
"mask": "6f1f89e7d2a6d1b88c29c051ef3a2dd0" | ||
}, | ||
"sbc_small": { | ||
"img": "ae061d71fede147fcc8e7680e14e82c9", | ||
"mask": "f4f124cbfae47fd81b7d398c09836495" | ||
}, | ||
"todorovic_equal": { | ||
"img": "caecfb4065b54222e8d810e00da685af", | ||
"mask": "2821bec9b23503e1598696d0ab418f3b" | ||
}, | ||
"todorovic_in_large": { | ||
"img": "ba9c3382426f8e0e9864d4b999c7979c", | ||
"mask": "265174ba6cc11c8a90fe9c822b18dfeb" | ||
}, | ||
"todorovic_in_small": { | ||
"img": "0ab88dbeb1419b4b786134cc432d73d7", | ||
"mask": "a711607fc494557ce2b52e984dc103b4" | ||
}, | ||
"checkerboard_016": { | ||
"img": "cffb926181df5cea95608b95bbc163f1", | ||
"mask": "1eb12e597ac5c454830dc2873730ccc1" | ||
}, | ||
"checkerboard_0938": { | ||
"img": "ffe0d07c218fa56eecce2a9386908ff5", | ||
"mask": "845b86fd98823fc4778f76a360da6d52" | ||
}, | ||
"checkerboard209": { | ||
"img": "3058e7c3d03899760fede8aba1c940ac", | ||
"mask": "1172e323e0af65b431a4641be9836b7b" | ||
}, | ||
"bullseye_thin": { | ||
"img": "59c97cb1feffb4c9c502b143c5699fb3", | ||
"mask": "08cfee34814f232afda08e138da10661" | ||
}, | ||
"bullseye_thick": { | ||
"img": "59c97cb1feffb4c9c502b143c5699fb3", | ||
"mask": "08cfee34814f232afda08e138da10661" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"dungeon": { | ||
"img": "23859250c9f5a895de48c20e7095f4e9", | ||
"mask": "1954462ad5eeb864935b349630f918f9" | ||
}, | ||
"cube": { | ||
"img": "59ac0095ba9c17a2cdd98ffff6613447", | ||
"mask": "3a6543daa69e82047d0b84b76a446312" | ||
}, | ||
"grating": { | ||
"img": "44286e04ca4f44fe98930722c0d45b1a", | ||
"mask": "cb796a47e9ca6c8426a2585c9b604989" | ||
}, | ||
"rings": { | ||
"img": "38a7bc014428864fffcee590d0953465", | ||
"mask": "3c5c395de3b4cae5b6956314624ea012" | ||
}, | ||
"bullseye": { | ||
"img": "e30fb79cf7897dfed4ce04983b36ba28", | ||
"mask": "721937af54e313931f38a22b7a6ce885" | ||
}, | ||
"simultaneous_brightness_contrast": { | ||
"img": "a0e0353cd1fb9a829241ddecc51fbc64", | ||
"mask": "c46a87aa52c48192ce96c90fbe10c062" | ||
}, | ||
"white": { | ||
"img": "377a2903002d526da2ba1d052eb193d2", | ||
"mask": "306423f9e89e6d3bd21a946881ef684a" | ||
}, | ||
"benary": { | ||
"img": "4c3f2278ac91effebf1db9f580a24db6", | ||
"mask": "c790aa14edddb57f8054a4f330c7ddc6" | ||
}, | ||
"todorovic": { | ||
"img": "1b9d5b09475aace9b97f599c5731177b", | ||
"mask": "2eeeeb428daf6be031c64ef841e7c897" | ||
}, | ||
"checkerboard_contrast_contrast": { | ||
"img": "246c282926e1a0b390eb4bca6bd00b16", | ||
"mask": "487c5cbe9dfd08719ead98ea9a7e901c" | ||
}, | ||
"checkerboard": { | ||
"img": "6891d301caf87043b99c199f13fdf607", | ||
"mask": "70844521cd62275df0cab9a7c1184d9d" | ||
}, | ||
"checkerboard_extended": { | ||
"img": "570e9597fa49a33a6e96687a007ad3e0", | ||
"mask": "f6ee08aeab807602449271ee7367cc44" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from os.path import abspath, dirname | ||
|
||
from stimuli.papers import * | ||
from stimuli.papers import __all__ as papers | ||
from stimuli.utils import export | ||
|
||
d = dirname(abspath(__file__)) | ||
|
||
# Generate the ground_truth dict for each paper; save as .JSON | ||
for paper in papers: | ||
# Get a reference to the actual module, from the name-string | ||
paper_module = globals()[paper] | ||
|
||
# Generate all the stimulus-dicts (skip over NotImplemented) | ||
stims = paper_module.gen_all(skip=True) | ||
|
||
# Convert "img", "mask" to checksums | ||
for stim in stims.values(): | ||
export.arrs_to_checksum(stim, ["img", "mask"]) | ||
|
||
# Save all as .JSON | ||
export.to_json(stims, f"{d}/{paper}.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"argyle": { | ||
"img": "cb4ed25c9e5d878c4daf41a57656e4ba", | ||
"mask": "b9c1760d980dc13c5bb2fda8ebe537c2" | ||
}, | ||
"argyle_control": { | ||
"img": "e3e1e33d7eb3f1e4ea2c0100e551b3e6", | ||
"mask": "91dbc28e28a6209bcd187a11e0321cae" | ||
}, | ||
"argyle_long": { | ||
"img": "ce09cf6536bc04037536c767c973ef9c", | ||
"mask": "83ffc7391ddcbebfe6cec7b0944c6dc0" | ||
}, | ||
"snake": { | ||
"img": "06337656c123eeb36dd75963639adaa2", | ||
"mask": "02636e9e6289b9ae0bb36e518fc20e3f" | ||
}, | ||
"snake_control": { | ||
"img": "3473bf614bdf0eb68b4c7c8ce1b29697", | ||
"mask": "02636e9e6289b9ae0bb36e518fc20e3f" | ||
}, | ||
"koffka_adelson": { | ||
"img": "16f09cb37a170053a73f5183f289b6df", | ||
"mask": "ecf8713ae03549fa9ee16b1462ff5bf1" | ||
}, | ||
"koffka_broken": { | ||
"img": "f710a7d1ceb75d1f6cac9d91e1c2a821", | ||
"mask": "40c249e4d8835580b7f57d04e0df65c4" | ||
}, | ||
"koffka_connected": { | ||
"img": "9ffb69c20afbaf731877b4626d61c404", | ||
"mask": "4e4fa0cbe12df9fa7bdab6b0fc073270" | ||
}, | ||
"checkassim": { | ||
"img": "ef5b9b410280b3f2e2ff45ee165e32d7", | ||
"mask": "4bc92371e105629f30513c1050f99cf4" | ||
}, | ||
"simcon": { | ||
"img": "87da2163dcd4ce3ef214c48fa243c787", | ||
"mask": "99fbc73e5c8aefd70501838130b806e9" | ||
}, | ||
"simcon_articulated": { | ||
"img": "61685f75a7352ff756d566a6ffcc8faf", | ||
"mask": "99fbc73e5c8aefd70501838130b806e9" | ||
}, | ||
"white": { | ||
"img": "0fb691c397d4bdcbb0eb5f89134be5aa", | ||
"mask": "b0f4ec00fd2d12d15f005af9b53b29f8" | ||
} | ||
} |
Oops, something went wrong.