danifranco / TIMISE

Toolbox for Identifying Mitochondria Instance Segmentation Errors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileNotFoundError: [Errno 2] No such file or directory: ''

perdigao1 opened this issue · comments

Running TIMISE toolbox with two h5 files in seperate folders, predicted labels and ground truth.

from timise import TIMISE
timise = TIMISE()
timise.evaluate(
    "<folder>/pred",
    "<folder>/GT",
    "<folder>/output",
    data_resolution=[30,8,8])

as per README instructions

I get the error above
FileNotFoundError: [Errno 2] No such file or directory: ''

There appears to be an error in assuming some values

In
https://github.com/danifranco/TIMISE/blob/507e9cef68eb0bda5f2c0eceef30364e6c313aa0/timise/engine.py#L220C21-L220C21

pred_grouping_file = ''

means that sometimes this variable will be empty string.

However in function calculate_matching_metrics()

df_pred = pd.read_csv(pred_group_file, names=['pred_id', 'category'], index_col=False, sep=' ')

it tries to load a Pandas Dataframe without checking the string is empty
df_pred = pd.read_csv(pred_group_file, names=['pred_id', 'category'], index_col=False, sep=' ')

Hello! Thank you for reporting the issue. We will try to fix it as soon as possible!

Hello!

We have just commited some changes to avoid the error you pointed out.

Please feel free to close the issue.

Best,

Dani

Thank you

I think there are still issues in the way folders are handled

I just tried to run, using the suggested command in README

timise0.evaluate("pred",
                "GT",
                "output", 
                data_resolution=[30,8,8])

with one predicted annotation in the ./pred folder and its ground truthe in the /GT folder (it appears that there is no requirement of the filenames being identical). It runs to the stage

####### Computing association metrics #######
	Calculating associations . . .

and then throws an error

OSError: Cannot save file into a non-existent directory: 'output/pred/output/pred'

Clearly the output folder is trying to save to is wrong, but it has created a folder called /output/pred

Hello,

I've reproduced the issue. The problem was that TIMISE expects absolute paths and not relative paths. I've just commit a few changes so relative paths can be used too.

On the other hand, as you mentioned, the filenames are not required to be the same, as currently only one prediction file and one GT file is expected.

Best,

Dani