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

Commit 1f22ee8

Browse files
authored
Merge pull request #3 from dronedeploy/quickstart
quickstart and store in dir
2 parents 2197dc5 + 456dcbd commit 1f22ee8

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ This repository contains a description of the DroneDeploy Segmentation Dataset a
55

66
![Example](https://github.com/dronedeploy/dd-ml-segmentation-benchmark/raw/master/img/example.jpg)
77

8+
### Quickstart
9+
10+
```
11+
# clone this repository
12+
git clone https://github.com/dronedeploy/dd-ml-segmentation-benchmark.git
13+
cd dd-ml-segmentation-benchmark/
14+
# install requirements
15+
pip3 install -r requirements.txt
16+
# optional: log in to W&B to see your training metrics,
17+
# track your experiments, and submit your models to the benchmark
18+
wandb login
19+
# train Fastai model
20+
python3 main.py
21+
# train Keras model
22+
python3 main_keras.py
23+
24+
```
25+
826
### Training
927

1028
To start training a model on a small sample dataset run the following, once working you should use the *full dataset* by changing `main.py`

libs/scoring.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def wherecolor(img, color, negate = False):
2525
def plot_confusion_matrix(y_true, y_pred, classes,
2626
normalize=True,
2727
title=None,
28-
cmap=plt.cm.Blues):
28+
cmap=plt.cm.Blues,
29+
savedir="score_files"):
2930
"""
3031
This function prints and plots the confusion matrix.
3132
Normalization can be applied by setting `normalize=True`.
@@ -75,8 +76,11 @@ def plot_confusion_matrix(y_true, y_pred, classes,
7576
plt.ylim([-0.5, cm.shape[0]- 0.5])
7677

7778
fig.tight_layout()
79+
# save to directory
80+
if not os.path.isdir(savedir):
81+
os.mkdir(savedir)
82+
savefile = savedir + '/score-' + title
7883

79-
savefile = os.path.join(base, 'score-' + fname)
8084
plt.savefig(savefile)
8185
return savefile, cm
8286

0 commit comments

Comments
 (0)