Skip to content

Commit

Permalink
Resolved small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
arpanmangal committed Apr 22, 2020
1 parent 6df072b commit 9fcea2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions data_tools/prepare_covid_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
test_patients = set({4, 15, 86, 59, 6, 82, 80, 78, 76, 65, 36, 32, 50, 18, 115, 152, 138, 70, 116})
val_patients = set({73, 51, 48, 11, 43, 24, 112})

print ('#Train patients:', len(set(covids.keys()).difference(test_patients.union(val_patients))))
print ('#Test patients:', len(test_patients))
print ('#Val patients:', len(val_patients))
print ()
print ('#Train data points:', sum([v for k, v in covids.items() if int(k) not in test_patients.union(val_patients)]))
print ('#Test data points:', sum([v for k, v in covids.items() if int(k) in test_patients]))
print ('#Val data points:', sum([v for k, v in covids.items() if int(k) in val_patients]))
Expand Down
2 changes: 1 addition & 1 deletion tools/covidxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ class CheXNet(DenseNet121):
Modified DenseNet network with 14 classes
"""
def __init__(self):
super(CovXNet, self).__init__(14)
super(CheXNet, self).__init__(14)
7 changes: 2 additions & 5 deletions tools/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ def __len__(self):

pred = pred.cpu().numpy()

# print (pred, type(pred))
# print (names, type(names))

assert len(pred) == len(names)
assert len(pred) == len(pred_names)

scores = []
for p, n in zip(pred, names):
for p, n in zip(pred, pred_names):
p = ["%.1f %%" % (i * 100) for i in p]
scores.append([n] + p)

Expand Down

0 comments on commit 9fcea2e

Please sign in to comment.