Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 805af37

Browse files
authored
Merge pull request #5 from dronedeploy/polish
minor polish
2 parents a4566a2 + 129573b commit 805af37

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

libs/scoring.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def plot_confusion_matrix(y_true, y_pred, classes,
2626
normalize=True,
2727
title=None,
2828
cmap=plt.cm.Blues,
29-
savedir="score_files"):
29+
savedir="predictions"):
3030
"""
3131
This function prints and plots the confusion matrix.
3232
Normalization can be applied by setting `normalize=True`.
@@ -79,8 +79,7 @@ def plot_confusion_matrix(y_true, y_pred, classes,
7979
# save to directory
8080
if not os.path.isdir(savedir):
8181
os.mkdir(savedir)
82-
savefile = savedir + '/score-' + title
83-
82+
savefile = title
8483
plt.savefig(savefile)
8584
return savefile, cm
8685

@@ -119,7 +118,7 @@ def score_masks(labelfile, predictionfile):
119118

120119
return precision, recall, f1, savefile
121120

122-
def score_predictions(dataset, basedir='.'):
121+
def score_predictions(dataset, basedir='predictions'):
123122

124123
scores = []
125124

main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# dataset = 'dataset-medium' # 9.0 GB download
1212

1313
config = {
14-
'name' : 'baseline',
14+
'name' : 'baseline-fastai',
1515
'dataset' : dataset,
1616
}
1717

@@ -28,7 +28,8 @@
2828
# scores all the test images compared to the ground truth labels then
2929
# send the scores (f1, precision, recall) and prediction images to wandb
3030
score, predictions = scoring.score_predictions(dataset)
31-
wandb.config.update(score)
31+
print(score)
32+
wandb.log(score)
3233

3334
for f1, f2 in predictions:
3435
wandb.save( f1 )

main_keras.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if __name__ == '__main__':
1010
dataset = 'dataset-sample' # 0.5 GB download
11-
# dataset = 'dataset-medium' # 9.0 GB download
11+
#dataset = 'dataset-medium' # 9.0 GB download
1212

1313
config = {
1414
'name' : 'baseline-keras',
@@ -29,4 +29,5 @@
2929
# scores all the test images compared to the ground truth labels then
3030
# send the scores (f1, precision, recall) and prediction images to wandb
3131
score, _ = scoring.score_predictions(dataset, basedir=wandb.run.dir)
32-
wandb.config.update(score)
32+
print(score)
33+
wandb.log(score)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keras
44
numpy==1.17.1
55
opencv_python==3.4.3.18
66
sklearn
7-
tensorflow
7+
tensorflow-gpu
88
torch
99
typing==3.6.6
1010
wandb

0 commit comments

Comments
 (0)