artkulak / osic-pulmonary-fibrosis-progression

1st place solution of OSIC Pulmonary Fibrosis Progression competition at Kaggle
The Unlicense
24 stars 16 forks source link

[QUESTION ABOUT IGENERATOR CLASS] #2

Closed Hoang-Nam2711 closed 6 months ago

Hoang-Nam2711 commented 3 years ago

Hi,

I really interested in your project. But I have a confusion in IGenerator Class. In these line of code of getitem function why you only choose randomly one picture of each patient instead of loading all images of each patient?

`for k in keys:

        try:
            i = np.random.choice(self.train_data[k], size=1)[0]
            img = get_img(f'../input/osic-pulmonary-fibrosis-progression/train/{k}/{i}')
            x.append(img)
            a.append(self.a[k])
            tab.append(self.tab[k])`
Aku02 commented 3 years ago

I think it is cause of varied number of scans per patient, and often you end up getting into OOM resource allocation error. Some patients its as sparse as 18 but on the other hand it goes up to 400+.

Cause of Memory allocation we restrict ourselves in such a manner