cnr-isti-vclab / TagLab

A CNN based image segmentation tool oriented to marine data analysis
https://taglab.isti.cnr.it/
GNU General Public License v3.0
84 stars 33 forks source link

DefaultDictionary: fix for 'Name' issue, and lost/modified default_dictionary #157

Closed Jordan-Pierce closed 1 month ago

Jordan-Pierce commented 1 month ago

Loading a default_dict that doesn't exist on a computer (i.e., it was moved, deleted, renamed) causes TagLab to brick because the path stored in the registry points to the old default_dict, which never gets updated. TagLab will try to open the path that is stored in the registry, but it doesn't exist and never opens causing a crash.

Fix is to check that the path / value stored in the registry actually exists before trying to load (in the case that it was moved, deleted, renamed), and if it does exist, loads. If it doesn't, then it falls back on default_dict dictionaries/scripps.json, checks if it exists, then loads. If it doesn't exist, spits out an error message box an alerts the user, but still loads TagLab with an empty dict, allowing the user to actually update the old default_dict.

maxcorsini commented 1 month ago

Thank you for the fix Jordan !!