Skip to content

Commit 1ad9947

Browse files
committed
Public Release v1.0
travis test links fix readme Public Release v1.0
0 parents  commit 1ad9947

File tree

5,174 files changed

+6473
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,174 files changed

+6473
-0
lines changed

.firebaserc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "alzheimersai-2121"
4+
}
5+
}

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
venv/
2+
3+
*.pyc
4+
__pycache__/
5+
6+
instance/
7+
8+
.pytest_cache/
9+
.coverage
10+
htmlcov/
11+
12+
dist/
13+
build/
14+
*.egg-info/
15+
16+
.vscode/
17+
18+
page_design/
19+
20+
.firebase/
21+
22+
firebase-debug.log
23+
node_modules/
24+
functions/node_modules/
25+
26+
package-lock.json
27+
28+
*.pth
29+
30+
static/assets/usr/*
31+
!.keep
32+
33+
server/src/templates/usr_data/*
34+
!.keep
35+
36+
export.pkl

.travis.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
matrix:
2+
include:
3+
- language: generic
4+
python: "3.7"
5+
node_js: "12.12.0"
6+
services: docker
7+
env:
8+
- GCP_PROJECT_ID=alzheimersai-2121
9+
- IMAGE=gcr.io/alzheimersai-2121/alzheimersai
10+
- CLOUD_RUN_SERVICE=alzheimersai
11+
- CLOUD_RUN_REGION=us-central1
12+
- CLOUDSDK_CORE_DISABLE_PROMPTS=1 # prevent gcloud from prompting
13+
before_install:
14+
- nvm install node
15+
- npm i -g firebase-tools
16+
- pip install gdown --user
17+
- python travis_builder.py
18+
- openssl aes-256-cbc -K $encrypted_98d237b7dbf4_key -iv $encrypted_98d237b7dbf4_iv -in google-key.json.enc -out google-key.json -d
19+
- curl https://sdk.cloud.google.com | bash > /dev/null
20+
- source "$HOME/google-cloud-sdk/path.bash.inc"
21+
- gcloud auth activate-service-account --key-file=google-key.json
22+
- gcloud auth configure-docker # enable "docker push" to gcr
23+
- gcloud config set project "${GCP_PROJECT_ID}"
24+
- gcloud config set builds/use_kaniko True
25+
- gcloud components install beta # until Cloud Run is generally available (GA)
26+
install: true
27+
script:
28+
- |
29+
set -ex;
30+
docker build -t "${IMAGE}:${TRAVIS_COMMIT}" ./server && \
31+
docker push "${IMAGE}:${TRAVIS_COMMIT}" && \
32+
gcloud beta run deploy "${CLOUD_RUN_SERVICE}" --memory=1Gi \
33+
--image="${IMAGE}:${TRAVIS_COMMIT}" \
34+
--platform=managed \
35+
--region="${CLOUD_RUN_REGION}" \
36+
--allow-unauthenticated;
37+
set +x
38+
deploy:
39+
provider: firebase
40+
token:
41+
secure: "WWs0UiXF9x2wU8Xbxu3CLcz9uUdVXRYV/RiSzBLg6BC2GgWwoGD2s0dD0s+CCneJua4G/mLfapaZ+4DZIhgiLl87KVNEfR6l99ydQf7VknFaq8cqqB91C53lv6AJUmdra6ny8hT6Bo1Q9vdCAAX0VKbkx/2sYboxNJs10rQ6FCCc+GRVOqTpYI0Mb97Lc1ck704CwrKgkla0KmroIdHJa70TrT7iuDQIz1f5BUOPrY7TvNqgKYLNZXBIUVQkGRrQkQKQH3FHHCSn5AlJxv2ZaM4QPOF45Iqz8ZX4Q452Z8ITtjOcT9vrsUUzf0HpJsgYEVzGa7YRfbv7J5nsQyHK8Jj4RdnnirAvTUhh3dAWeowoFQvmmqYC51Efk2WTl6mT8j9IEkV+GAZKrfbginr6kVtH25dMvffCFyEYzhIUF7qF5cWhJvv8A2YPcbe4CCBVQF4lsb371Xu6F7tAgEw2QTY3/Fi4OUdEABXa96cp1qrhx6+XMV7ERUxGo4qZfAXvhJCl/qVjd2Q8AiSmarwAbeey3egUde2xPzaP7TP5gnd+aa7s69xdUQBW6wermZ5uJ+76Hq1l76/zM899xh4A7Tf+Svinqqhgp+l4nk9Ba6CCvr7xn1h1BZCdeUqfSymEX3mAeSYGdT4MhICmk9Z+9ErPYQoqwN+Uq12qIB1zwlI="
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 4
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from fastai.vision import *\n",
10+
"import numpy as np\n",
11+
"import pandas as pd"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": null,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"path = Path('../data/train')\n",
21+
"path.ls()"
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": null,
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"np.random.seed(42)\n",
31+
"data = ImageDataBunch.from_folder(path, train=\".\", valid_pct=0.2,\n",
32+
" ds_tfms=get_transforms(), size=128, num_workers=4).normalize(imagenet_stats)"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"data.classes"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": null,
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"data.classes, data.c, len(data.train_ds), len(data.valid_ds)\n"
51+
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": null,
56+
"metadata": {},
57+
"outputs": [],
58+
"source": [
59+
"learn = cnn_learner(data, models.resnet101, metrics=error_rate)\n"
60+
]
61+
},
62+
{
63+
"cell_type": "code",
64+
"execution_count": null,
65+
"metadata": {},
66+
"outputs": [],
67+
"source": [
68+
"learn.fit_one_cycle(4)\n"
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": null,
74+
"metadata": {},
75+
"outputs": [],
76+
"source": [
77+
"learn.save('stage-1')"
78+
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"metadata": {},
84+
"outputs": [],
85+
"source": []
86+
}
87+
],
88+
"metadata": {
89+
"kernelspec": {
90+
"display_name": "Python 3",
91+
"language": "python",
92+
"name": "python3"
93+
},
94+
"language_info": {
95+
"codemirror_mode": {
96+
"name": "ipython",
97+
"version": 3
98+
},
99+
"file_extension": ".py",
100+
"mimetype": "text/x-python",
101+
"name": "python",
102+
"nbconvert_exporter": "python",
103+
"pygments_lexer": "ipython3",
104+
"version": "3.7.6"
105+
}
106+
},
107+
"nbformat": 4,
108+
"nbformat_minor": 4
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 4
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 4
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 46,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from fastai.vision import *\n",
10+
"import pandas as pd\n",
11+
"import numpy as np\n",
12+
"import torch"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 47,
18+
"metadata": {},
19+
"outputs": [],
20+
"source": [
21+
"path = Path('../data/train')"
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": 48,
27+
"metadata": {},
28+
"outputs": [
29+
{
30+
"data": {
31+
"text/plain": [
32+
"[WindowsPath('../data/train/MildDemented'),\n",
33+
" WindowsPath('../data/train/models'),\n",
34+
" WindowsPath('../data/train/ModerateDemented'),\n",
35+
" WindowsPath('../data/train/NonDemented'),\n",
36+
" WindowsPath('../data/train/VeryMildDemented')]"
37+
]
38+
},
39+
"execution_count": 48,
40+
"metadata": {},
41+
"output_type": "execute_result"
42+
}
43+
],
44+
"source": [
45+
"path.ls()"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": null,
51+
"metadata": {},
52+
"outputs": [],
53+
"source": [
54+
"np.random.seed(42)\n",
55+
"data = ImageDataBunch.from_folder(path, train=\".\", valid_pct=0.2,\n",
56+
" size=128, num_workers=4).normalize(imagenet_stats)"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"metadata": {},
63+
"outputs": [],
64+
"source": [
65+
"data.classes"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": null,
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"data.classes, data.c, len(data.train_ds), len(data.valid_ds)\n"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": null,
80+
"metadata": {},
81+
"outputs": [],
82+
"source": [
83+
"learn = cnn_learner(data, models.resnet101, metrics=error_rate)"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"metadata": {},
90+
"outputs": [],
91+
"source": [
92+
"learn.fit_one_cycle(4)\n"
93+
]
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": null,
98+
"metadata": {},
99+
"outputs": [],
100+
"source": [
101+
"learn.save('stage-1') # Save the first stage of the model\n"
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": null,
107+
"metadata": {},
108+
"outputs": [],
109+
"source": []
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"metadata": {},
115+
"outputs": [],
116+
"source": []
117+
}
118+
],
119+
"metadata": {
120+
"kernelspec": {
121+
"display_name": "Python 3.7.7 64-bit ('python36': conda)",
122+
"language": "python",
123+
"name": "python37764bitpython36condadac793e125124000a42e65e438db1e77"
124+
},
125+
"language_info": {
126+
"codemirror_mode": {
127+
"name": "ipython",
128+
"version": 3
129+
},
130+
"file_extension": ".py",
131+
"mimetype": "text/x-python",
132+
"name": "python",
133+
"nbconvert_exporter": "python",
134+
"pygments_lexer": "ipython3",
135+
"version": "3.7.7"
136+
}
137+
},
138+
"nbformat": 4,
139+
"nbformat_minor": 4
140+
}

0 commit comments

Comments
 (0)