Skip to content

Commit 211bb74

Browse files
author
Yifan Peng
committed
fix bugs
1 parent 9ea1a08 commit 211bb74

13 files changed

+34
-301
lines changed

README.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Prerequisites
2222

2323
* python =3.6
2424
* tensorflow >=1.6.0
25-
* keras =2.1.5
25+
* keras =2.2.4
2626
* Linux
2727

2828
Tensorflow can be downloaded from `https://www.tensorflow.org <https://www.tensorflow.org/>`_.
@@ -46,13 +46,17 @@ The easiest way is to run the following command
4646
4747
$ python examples/predict_simplified_score.py data/left_eye.jpg data/right_eye.jpg
4848
...
49-
INFO:root:Loading the model: drusen
50-
INFO:root:Loading the model: advanced_amd
51-
INFO:root:Loading the model: pigment
49+
Downloading data from https://github.com/ncbi-nlp/DeepSeeNet/releases/download/0.1/drusen_model.h5
50+
INFO:root:Loading the model: /tmp/.keras/datasets/drusen_model.h5
51+
Downloading data from https://github.com/ncbi-nlp/DeepSeeNet/releases/download/0.1/pigment_model.h5
52+
INFO:root:Loading the model: /tmp/.keras/datasets/pigment_model.h5
53+
Downloading data from https://github.com/ncbi-nlp/DeepSeeNet/releases/download/0.1/advanced_amd_model.h5
54+
INFO:root:Loading the model: /tmp/.keras/datasets/advanced_amd_model.h5
5255
...
5356
INFO:root:Processing: data/left_eye.jpg
5457
INFO:root:Processing: data/right_eye.jpg
5558
...
59+
INFO:root:Risk factors: {'pigment': (0, 0), 'advanced_amd': (0, 0), 'drusen': (2, 2)}
5660
The simplified score: 2
5761
5862
The script will
@@ -76,11 +80,12 @@ Besides grading the simplified score, we also provide individual risk factor mod
7680
7781
$ python examples/predict_drusen.py data/left_eye.jpg
7882
...
79-
INFO:root:Loading the model: drusen
83+
INFO:root:Loading the model: /tmp/.keras/datasets/drusen_model.h5
8084
...
8185
INFO:root:Processing: data/left_eye.jpg
8286
...
83-
Drusen size: large
87+
The drusen score: [[0.21020733 0.2953384 0.49445423]]
88+
The drusen size: large
8489
8590
8691
All models can be found at ``deepseenet``.

deepseenet/deepseenet_pigment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def DeepSeeNetPigment(model='areds'):
4141
Returns:
4242
A Keras model instance.
4343
"""
44-
if model == 'areds1':
44+
if model == 'areds':
4545
model = get_file(
4646
'pigment_model.h5',
4747
PIGMENT_PATH,

deepseenet/deepseenet_simplified.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def predict(self, x_left, x_right, verbose=0):
7676
Returns:
7777
Numpy array of scores of 0-5
7878
"""
79-
assert x_left.shape[0] == x_right.shape[0]
79+
# assert x_left.shape[0] == x_right.shape[0]
8080
scores = {}
8181
for model_name, (model, preprocess_image) in self.models.items():
8282
left_score = np.argmax(model.predict(preprocess_image(x_left)), axis=1)[0]

environment3.6.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/extract_feature.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

examples/predict.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

examples/predict_drusen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
predict_drusen [options] <eye_image>
66
77
Options:
8-
-d <str> Drusen model. [default: areds1]
8+
-d <str> Drusen model file. [default: areds]
99
"""
1010
import logging
1111
import sys
1212

1313
import docopt
1414

15-
from deepseenet.eyesnet_drusen import EyesNetDrusen, preprocess_image, get_drusen_size
15+
from deepseenet.deepseenet_drusen import DeepSeeNetDrusen, preprocess_image, get_drusen_size
1616
from deepseenet.utils import pick_device
1717

1818
if __name__ == '__main__':
@@ -21,7 +21,7 @@
2121
logging.debug(argv)
2222

2323
pick_device()
24-
clf = EyesNetDrusen(argv['-d'])
24+
clf = DeepSeeNetDrusen(argv['-d'])
2525
x = preprocess_image(argv['<eye_image>'])
2626
score = clf.predict(x, verbose=1)
2727
print('The drusen score:', score)

examples/predict_field2.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

examples/predict_left_right.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

examples/predict_risk_factor.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

examples/predict_simplified_score.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
predict_simplified_score [options] <left_eye_image> <right_eye_image>
66
77
Options:
8-
-d <str> Drusen model
9-
-p <str> Pigment model
10-
-a <str> Advanced AMD model
8+
-d <str> Drusen model path [default: areds]
9+
-p <str> Pigment model path [default: areds]
10+
-a <str> Advanced AMD model path [default: areds]
1111
"""
1212
import logging
1313
import sys
@@ -44,9 +44,9 @@ def preprocess_image(image_path, target_size=(224, 224)):
4444
logging.basicConfig(level=logging.DEBUG)
4545
logging.debug(argv)
4646

47-
drusen_model = argv['-d'] if '-d' in argv else None
48-
pigment_model = argv['-p'] if '-p' in argv else None
49-
advanced_amd_model = argv['-a'] if '-a' in argv else None
47+
drusen_model = argv['-d']
48+
pigment_model = argv['-p']
49+
advanced_amd_model = argv['-a']
5050

5151
pick_device()
5252
clf = deepseenet_simplified.DeepSeeNetSimplifiedScore(drusen_model, pigment_model, advanced_amd_model)

0 commit comments

Comments
 (0)