Skip to content

Commit 68a7463

Browse files
author
yusuke-a-uchida
committed
Merge branch 'xjdeng_patch-1'
2 parents 5166a34 + 534f485 commit 68a7463

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,14 @@ Tested on:
1717

1818
## Usage
1919

20-
### Use pretrained model
21-
Download pretrained model weights for TensorFlow backend:
22-
23-
```sh
24-
mkdir -p pretrained_models
25-
wget -P pretrained_models https://www.dropbox.com/s/rf8hgoev8uqjv3z/weights.18-4.06.hdf5
26-
```
27-
28-
Run demo script (requires web cam)
20+
### Use pretrained model for demo
21+
Run demo the script (requires web cam)
2922

3023
```sh
3124
python3 demo.py
3225
```
3326

34-
Model weights for Theano backend is also available from [here](https://drive.google.com/file/d/0B_cG1nzvVZlQWGJMc2JjdzkwcVk/view?usp=sharing).
27+
The pretrained model for TensorFlow backend will be automatically downloaded to the `pretrained_models` directory.
3528

3629
### Train a model using the IMDB-WIKI dataset
3730

demo.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import numpy as np
55
import argparse
66
from wide_resnet import WideResNet
7+
from keras.utils.data_utils import get_file
8+
9+
pretrained_model = "https://www.dropbox.com/s/rf8hgoev8uqjv3z/weights.18-4.06.hdf5?dl=1"
10+
modhash = '89f56a39a78454e96379348bddd78c0d'
711

812

913
def get_args():
@@ -35,7 +39,8 @@ def main():
3539
weight_file = args.weight_file
3640

3741
if not weight_file:
38-
weight_file = os.path.join("pretrained_models", "weights.18-4.06.hdf5")
42+
weight_file = get_file("weights.18-4.06.hdf5", pretrained_model, cache_subdir="pretrained_models",
43+
file_hash=modhash, cache_dir=os.path.dirname(os.path.abspath(__file__)))
3944

4045
# for face detection
4146
detector = dlib.get_frontal_face_detector()

0 commit comments

Comments
 (0)