Loading custom background image from a path containing uppercase letters will crash
Hello,
I tried to load a background image generate during a previous run and I'm getting "CRITICAL Could not read the image file"
I ran a test and it seems that the only reason this problem occurs is because there are capital letters in the path.
With background image in /tmp/test/background.png: Working
(idtrackerai) yohann@fractalant:~$ idtrackerai --load '/media/AntGate/user/test/idtracker_mask.toml' --background_subtraction_stat /tmp/test/background.png
15:46:43 Welcome to idtracker.ai 6.0.11 logging_utils.py:184
Date: 2025-11-25 15:46:43 logging_utils.py:188
Running Python '3.13.7' in 'Linux-6.8.0-87-generic-x86_64-with-glibc2.35'
Writing log in /home/yohann/idtrackerai.log logging_utils.py:193
Using NumPy 2.1.2 logging_utils.py:196
Using headless OpenCV 4.12.0.88 logging_utils.py:199
Regular OpenCV not found logging_utils.py:208
Using "forkserver" multiprocessing start method logging_utils.py:210
Loading parameters from /media/AntGate/user/test/idtracker_mask.toml: py_utils.py:84
name='idtracker_mask'
video_paths=['/media/AntGate/user/test/000000.mp4',
'/media/AntGate/user/test/000001.mp4',
'/media/AntGate/user/test/000002.mp4',
'/media/AntGate/user/test/000003.mp4',
'/media/AntGate/user/test/000004.mp4',
'/media/AntGate/user/test/000005.mp4',
'/media/AntGate/user/test/000006.mp4',
'/media/AntGate/user/test/000007.mp4',
'/media/AntGate/user/test/000008.mp4',
'/media/AntGate/user/test/000009.mp4',
'/media/AntGate/user/test/000010.mp4']
intensity_ths=[23, 255]
area_ths=[620.0, inf]
tracking_intervals=[[25750, 173475]]
number_of_animals=4
use_bkg=True
check_segmentation=False
track_wo_identities=False
roi_list=None
torch_compile=True
background_subtraction_stat='/media/AntGate/user/test/session_idtracker/preprocessing/background.png'
Terminal arguments: __main__.py:47
background_subtraction_stat='/tmp/test/background.png'
inotify_add_watch(/home/yohann/.config/ibus/bus/f2b7f1186a8146f587b548bc11bd6be5-unix-1) failed: (No space left on device)
Initializing SegmentationGUI with PyQt6 6.9.1 GUI_main_base.py:51
Saving GUI settings in /home/yohann/.config/idtrackerai/idtrackerai_GUI.conf GUI_main_base.py:62
15:46:45 Loading custom background from /tmp/test/background.png
With background image in /tmp/Test/background.png: Not working
(idtrackerai) yohann@fractalant:~$ idtrackerai --load '/media/AntGate/user/test/idtracker_mask.toml' --background_subtraction_stat /tmp/Test/background.png
15:47:07 Welcome to idtracker.ai 6.0.11 logging_utils.py:184
Date: 2025-11-25 15:47:07 logging_utils.py:188
Running Python '3.13.7' in 'Linux-6.8.0-87-generic-x86_64-with-glibc2.35'
Writing log in /home/yohann/idtrackerai.log logging_utils.py:193
Using NumPy 2.1.2 logging_utils.py:196
Using headless OpenCV 4.12.0.88 logging_utils.py:199
Regular OpenCV not found logging_utils.py:208
Using "forkserver" multiprocessing start method logging_utils.py:210
Loading parameters from /media/AntGate/user/test/idtracker_mask.toml: py_utils.py:84
name='idtracker_mask'
video_paths=['/media/AntGate/user/test/000000.mp4',
'/media/AntGate/user/test/000001.mp4',
'/media/AntGate/user/test/000002.mp4',
'/media/AntGate/user/test/000003.mp4',
'/media/AntGate/user/test/000004.mp4',
'/media/AntGate/user/test/000005.mp4',
'/media/AntGate/user/test/000006.mp4',
'/media/AntGate/user/test/000007.mp4',
'/media/AntGate/user/test/000008.mp4',
'/media/AntGate/user/test/000009.mp4',
'/media/AntGate/user/test/000010.mp4']
intensity_ths=[23, 255]
area_ths=[620.0, inf]
tracking_intervals=[[25750, 173475]]
number_of_animals=4
use_bkg=True
check_segmentation=False
track_wo_identities=False
roi_list=None
torch_compile=True
background_subtraction_stat='/media/AntGate/user/test/session_idtracker/preprocessing/background.png'
Terminal arguments: __main__.py:47
background_subtraction_stat='/tmp/Test/background.png'
Initializing SegmentationGUI with PyQt6 6.9.1 GUI_main_base.py:51
Saving GUI settings in /home/yohann/.config/idtrackerai/idtrackerai_GUI.conf GUI_main_base.py:62
15:47:09 Loading custom background from /tmp/test/background.png segmentation.py:371
CRITICAL Could not read the image file: /tmp/test/background.png. Please select a valid image file. (from animals_detection/segmentation.py:377)