KeyError: 0
Traceback:
File "/home/stef/python/unraphael/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
result = func()
^^^^^^
File "/home/stef/python/unraphael/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
exec(code, module.__dict__)
File "/home/stef/python/unraphael/src/unraphael/dash/pages/1_preprocess.py", line 196, in <module>
main()
File "/home/stef/python/unraphael/src/unraphael/dash/pages/1_preprocess.py", line 184, in main
processed_nobg, processed_mask = remove_background_widget(processed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/stef/python/unraphael/src/unraphael/dash/pages/1_preprocess.py", line 134, in remove_background_widget
background_params['bgcolor'] = col1.radio(
^^^^^^^^^^^
File "/home/stef/python/unraphael/.venv/lib/python3.12/site-packages/streamlit/runtime/metrics_util.py", line 408, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/stef/python/unraphael/.venv/lib/python3.12/site-packages/streamlit/elements/widgets/radio.py", line 228, in radio
return self._radio(
^^^^^^^^^^^^
File "/home/stef/python/unraphael/.venv/lib/python3.12/site-packages/streamlit/elements/widgets/radio.py", line 280, in _radio
options=[str(format_func(option)) for option in opt],
^^^^^^^^^^^^^^^^^^^
File "/home/stef/python/unraphael/src/unraphael/dash/pages/1_preprocess.py", line 137, in <lambda>
format_func=lambda x: bgmap[x],
~~~~~^^^
I get this error with the example files:
Python 3.12, Streamlit 1.37