echonet / dynamic

EchoNet-Dynamic is a deep learning model for assessing cardiac function in echocardiogram videos.
https://echonet.github.io/dynamic
Other
483 stars 169 forks source link

Echo.py: erroneous calculation of "missing" files? #25

Closed varsakelis closed 3 years ago

varsakelis commented 3 years ago

echo.py line 112: missing = set(self.fnames) - set(os.listdir(self.root / "Videos"))

The set(self.fnames) gives the set of filenames without their extensions. Subtracting set(os.listdir(self.root / "Videos")) (which does include extensions) leads to all filenames being considered "missing".

This then raises a FileNotFoundError, line 117.

wondering if anyone else has encountered this...

gdims commented 3 years ago

I have also faced a conflict regarding the filenames and extensions. What I ended up doing is, I removed the ".avi" extension from all filenames, and then I modified echo.py in the:

with open(self.root / "VolumeTracings.csv") as f:

by adding

filename = os.path.splitext(filename)[0]

So that the extension is also removed there, as VolumeTracings.csv has extensions in the filenames, in contrast to FIleList.csv.

There can be other workarounds.