358256a
11921054 5 years ago
6 changed file(s) with 579 addition(s) and 38 deletion(s). Raw diff Collapse all Expand all
1616 " - ```_README.md```*-----说明文档*\n",
1717 " - ```app_spec.yml```*-----定义项目的输入输出,为部署服务*\n",
1818 " - ```coding_here.ipynb```*-----输入并运行代码*"
19 ]
20 },
21 {
22 "cell_type": "code",
23 "execution_count": null,
24 "metadata": {},
25 "outputs": [],
26 "source": [
27 "def handle(conf):\n",
28 " \"\"\"\n",
29 " 该方法是部署之后,其他人调用你的服务时候的处理方法。\n",
30 " 请按规范填写参数结构,这样我们就能替你自动生成配置文件,方便其他人的调用。\n",
31 " 范例:\n",
32 " params['key'] = value # value_type: str # description: some description\n",
33 " value_type 可以选择:img, video, audio, str, int, float, [int], [str], [float]\n",
34 " 参数请放到params字典中,我们会自动解析该变量。\n",
35 " \"\"\"\n",
36 "\n",
37 " param1 = conf['param1'] # value_type: str # description: some description\n",
38 " # add your code\n",
39 " return {'ret1': 'cat'}\n",
40 " "
1941 ]
2042 },
2143 {
4163 "左侧和右侧工具栏都可根据使用需要进行收合。\n",
4264 "<img src='https://imgbed.momodel.cn/collapse_tab.2019-09-06 11_07_44.gif' width=100% height=100%>"
4365 ]
66 },
67 {
68 "cell_type": "code",
69 "execution_count": null,
70 "metadata": {},
71 "outputs": [],
72 "source": [
73 "ls /home/jovyan/work/datasets/sumansid-facemask-dataset-momodel"
74 ]
75 },
76 {
77 "cell_type": "code",
78 "execution_count": null,
79 "metadata": {},
80 "outputs": [],
81 "source": []
4482 },
4583 {
4684 "cell_type": "markdown",
137175 "pycharm": {
138176 "stem_cell": {
139177 "cell_type": "raw",
140 "source": [],
141178 "metadata": {
142179 "collapsed": false
143 }
180 },
181 "source": []
144182 }
145183 }
146184 },
0 input:
1 param1:
2 name: param1
3 value_type: str
4 description: ''
5 output:
6 ret1:
7 name: ret1
8 value_type: str
9 description: ''
0
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": null,
6 "metadata": {},
7 "outputs": [],
8 "source": [
9 "print('Hello Mo!')"
10 ]
11 }
12 ],
13 "metadata": {
14 "kernelspec": {
15 "display_name": "Python 3",
16 "language": "python",
17 "name": "python3"
18 },
19 "language_info": {
20 "codemirror_mode": {
21 "name": "ipython",
22 "version": 3
23 },
24 "file_extension": ".py",
25 "mimetype": "text/x-python",
26 "name": "python",
27 "nbconvert_exporter": "python",
28 "pygments_lexer": "ipython3",
29 "version": "3.5.2"
30 }
31 },
32 "nbformat": 4,
33 "nbformat_minor": 2
34 }
35
0 {
1 "cells": [
2 {
3 "cell_type": "code",
4 "execution_count": 1,
5 "metadata": {},
6 "outputs": [
7 {
8 "name": "stdout",
9 "output_type": "stream",
10 "text": [
11 "Hello Mo!\n"
12 ]
13 }
14 ],
15 "source": [
16 "print('Hello Mo!')"
17 ]
18 },
19 {
20 "cell_type": "code",
21 "execution_count": 5,
22 "metadata": {},
23 "outputs": [
24 {
25 "name": "stdout",
26 "output_type": "stream",
27 "text": [
28 "3\n"
29 ]
30 }
31 ],
32 "source": [
33 "b=2\n",
34 "a = b +1\n",
35 "print(a)"
36 ]
37 },
38 {
39 "cell_type": "code",
40 "execution_count": 6,
41 "metadata": {},
42 "outputs": [],
43 "source": [
44 "import torch"
45 ]
46 },
47 {
48 "cell_type": "code",
49 "execution_count": 9,
50 "metadata": {},
51 "outputs": [
52 {
53 "name": "stdout",
54 "output_type": "stream",
55 "text": [
56 "tensor([0., 0., 0.])\n"
57 ]
58 }
59 ],
60 "source": [
61 "a = torch.zeros(3)\n",
62 "print(a)"
63 ]
64 },
65 {
66 "cell_type": "code",
67 "execution_count": 1,
68 "metadata": {},
69 "outputs": [
70 {
71 "ename": "ImportError",
72 "evalue": "No module named 'mindspore'",
73 "output_type": "error",
74 "traceback": [
75 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
76 "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
77 "\u001b[0;32m<ipython-input-1-39d0ce7864e1>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mmindspore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnn\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mnn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
78 "\u001b[0;31mImportError\u001b[0m: No module named 'mindspore'"
79 ]
80 }
81 ],
82 "source": [
83 "import mindspore.nn as nn"
84 ]
85 },
86 {
87 "cell_type": "code",
88 "execution_count": 1,
89 "metadata": {},
90 "outputs": [
91 {
92 "name": "stdout",
93 "output_type": "stream",
94 "text": [
95 "Looking in indexes: https://mirrors.aliyun.com/pypi/simple\n",
96 "Collecting mindspore\n",
97 "\u001b[31m ERROR: Could not find a version that satisfies the requirement mindspore (from versions: none)\u001b[0m\n",
98 "\u001b[31mERROR: No matching distribution found for mindspore\u001b[0m\n",
99 "\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
100 "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
101 "Note: you may need to restart the kernel to use updated packages.\n"
102 ]
103 }
104 ],
105 "source": [
106 "pip install mindspore"
107 ]
108 },
109 {
110 "cell_type": "code",
111 "execution_count": 2,
112 "metadata": {},
113 "outputs": [
114 {
115 "name": "stdout",
116 "output_type": "stream",
117 "text": [
118 "Looking in indexes: https://mirrors.aliyun.com/pypi/simple\n",
119 "Collecting mindspore\n",
120 "\u001b[31m ERROR: Could not find a version that satisfies the requirement mindspore (from versions: none)\u001b[0m\n",
121 "\u001b[31mERROR: No matching distribution found for mindspore\u001b[0m\n",
122 "\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
123 "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
124 "Note: you may need to restart the kernel to use updated packages.\n"
125 ]
126 }
127 ],
128 "source": [
129 "pip install mindspore"
130 ]
131 },
132 {
133 "cell_type": "code",
134 "execution_count": 2,
135 "metadata": {},
136 "outputs": [
137 {
138 "name": "stdout",
139 "output_type": "stream",
140 "text": [
141 "Package Version \n",
142 "-------------------- ------------\n",
143 "absl-py 0.7.1 \n",
144 "alembic 1.4.2 \n",
145 "appdirs 1.4.4 \n",
146 "astor 0.7.1 \n",
147 "async-generator 1.10 \n",
148 "attrs 19.3.0 \n",
149 "Augmentor 0.2.8 \n",
150 "backcall 0.2.0 \n",
151 "baytune 0.3.10 \n",
152 "bleach 3.1.5 \n",
153 "boto3 1.14.34 \n",
154 "botocore 1.17.34 \n",
155 "certifi 2020.6.20 \n",
156 "certipy 0.1.3 \n",
157 "cffi 1.14.1 \n",
158 "chardet 3.0.4 \n",
159 "click 7.1.2 \n",
160 "configparser 4.0.2 \n",
161 "cryptography 3.0 \n",
162 "cycler 0.10.0 \n",
163 "Cython 0.29.20 \n",
164 "decorator 4.4.2 \n",
165 "defusedxml 0.6.0 \n",
166 "distlib 0.3.1 \n",
167 "docutils 0.15.2 \n",
168 "entrypoints 0.3 \n",
169 "et-xmlfile 1.0.1 \n",
170 "filelock 3.0.12 \n",
171 "func-timeout 4.3.5 \n",
172 "future 0.18.2 \n",
173 "gast 0.2.2 \n",
174 "graphviz 0.14 \n",
175 "grpcio 1.20.1 \n",
176 "h5py 2.9.0 \n",
177 "idna 2.10 \n",
178 "imageio 2.8.0 \n",
179 "imgaug 0.4.0 \n",
180 "importlib-metadata 0.23 \n",
181 "importlib-resources 3.0.0 \n",
182 "ipdb 0.13.2 \n",
183 "ipykernel 5.3.4 \n",
184 "ipython 7.9.0 \n",
185 "ipython-genutils 0.2.0 \n",
186 "ipywidgets 7.4.0 \n",
187 "jdcal 1.4.1 \n",
188 "jedi 0.17.2 \n",
189 "jieba 0.42.1 \n",
190 "Jinja2 2.11.2 \n",
191 "jmespath 0.10.0 \n",
192 "joblib 0.14.1 \n",
193 "jsonschema 3.2.0 \n",
194 "jupyter-client 6.1.6 \n",
195 "jupyter-core 4.6.3 \n",
196 "jupyterhub 1.0.0 \n",
197 "jupyterlab 1.0.0a1 \n",
198 "jupyterlab-server 0.2.0 \n",
199 "Keras 2.3.1 \n",
200 "Keras-Applications 1.0.7 \n",
201 "Keras-Preprocessing 1.0.9 \n",
202 "kiwisolver 1.1.0 \n",
203 "Mako 1.1.3 \n",
204 "Markdown 3.1 \n",
205 "MarkupSafe 1.1.1 \n",
206 "matplotlib 3.0.3 \n",
207 "minepy 1.2.4 \n",
208 "minio 5.0.10 \n",
209 "mistune 0.8.4 \n",
210 "mock 2.0.0 \n",
211 "more-itertools 7.2.0 \n",
212 "nbconvert 5.6.1 \n",
213 "nbformat 5.0.7 \n",
214 "networkx 2.4 \n",
215 "nltk 3.5 \n",
216 "notebook 6.0.3 \n",
217 "numpy 1.16.0 \n",
218 "oauthlib 3.1.0 \n",
219 "opencv-python 4.2.0.34 \n",
220 "openpyxl 2.6.4 \n",
221 "packaging 20.4 \n",
222 "pamela 1.0.0 \n",
223 "pandas 0.24.2 \n",
224 "pandocfilters 1.4.2 \n",
225 "parso 0.7.1 \n",
226 "pbr 5.2.0 \n",
227 "pexpect 4.8.0 \n",
228 "pickleshare 0.7.5 \n",
229 "Pillow 7.2.0 \n",
230 "pip 19.1.1 \n",
231 "plotly 4.8.1 \n",
232 "prometheus-client 0.8.0 \n",
233 "prompt-toolkit 2.0.10 \n",
234 "protobuf 3.12.4 \n",
235 "ptyprocess 0.6.0 \n",
236 "pycparser 2.20 \n",
237 "pydot 1.4.1 \n",
238 "pyenchant 3.1.1 \n",
239 "Pygments 2.6.1 \n",
240 "pyOpenSSL 19.1.0 \n",
241 "pyparsing 2.4.7 \n",
242 "pyrsistent 0.16.0 \n",
243 "python-dateutil 2.8.0 \n",
244 "python-editor 1.0.4 \n",
245 "pytz 2020.1 \n",
246 "PyWavelets 1.1.1 \n",
247 "PyYAML 5.3.1 \n",
248 "pyzmq 19.0.2 \n",
249 "regex 2020.7.14 \n",
250 "requests 2.24.0 \n",
251 "retrying 1.3.3 \n",
252 "s3transfer 0.3.3 \n",
253 "sacremoses 0.0.43 \n",
254 "scikit-image 0.15.0 \n",
255 "scikit-learn 0.22.2.post1\n",
256 "scipy 1.4.1 \n",
257 "seaborn 0.9.1 \n",
258 "Send2Trash 1.5.0 \n",
259 "sentencepiece 0.1.91 \n",
260 "setuptools 49.2.0 \n",
261 "Shapely 1.7.0 \n",
262 "six 1.12.0 \n",
263 "SQLAlchemy 1.3.18 \n",
264 "stevedore 1.32.0 \n",
265 "tensorboard 1.13.1 \n",
266 "tensorboardX 2.0 \n",
267 "tensorflow 1.13.1 \n",
268 "tensorflow-estimator 1.13.0 \n",
269 "termcolor 1.1.0 \n",
270 "terminado 0.8.3 \n",
271 "testpath 0.4.4 \n",
272 "tokenizers 0.5.2 \n",
273 "torch 1.4.0+cpu \n",
274 "torchtext 0.6.0 \n",
275 "torchvision 0.5.0+cpu \n",
276 "tornado 6.0.4 \n",
277 "tqdm 4.46.1 \n",
278 "traitlets 4.3.3 \n",
279 "transformers 2.5.1 \n",
280 "urllib3 1.25.10 \n",
281 "virtualenv 20.0.29 \n",
282 "virtualenv-clone 0.5.4 \n",
283 "virtualenvwrapper 4.8.4 \n",
284 "wcwidth 0.2.5 \n",
285 "webencodings 0.5.1 \n",
286 "Werkzeug 0.15.2 \n",
287 "wheel 0.34.2 \n",
288 "widgetsnbextension 3.4.2 \n",
289 "word2vec 0.10.6 \n",
290 "xlrd 1.2.0 \n",
291 "yellowbrick 1.1 \n",
292 "zipp 0.6.0 \n",
293 "\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
294 "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
295 ]
296 }
297 ],
298 "source": [
299 "!pip list --format=columns"
300 ]
301 },
302 {
303 "cell_type": "code",
304 "execution_count": 3,
305 "metadata": {},
306 "outputs": [
307 {
308 "name": "stdout",
309 "output_type": "stream",
310 "text": [
311 "/bin/sh: 1: 7zx: not found\n"
312 ]
313 }
314 ],
315 "source": [
316 "!7zx ./datasets/sumansid-facemask-dataset-momodel/facemask-dataset.zip -d"
317 ]
318 },
319 {
320 "cell_type": "code",
321 "execution_count": 4,
322 "metadata": {},
323 "outputs": [
324 {
325 "name": "stdout",
326 "output_type": "stream",
327 "text": [
328 "/bin/sh: 1: 7zx: not found\n"
329 ]
330 }
331 ],
332 "source": [
333 "!7zx ./datasets/sumansid-facemask-dataset-momodel/facemask-dataset.zip"
334 ]
335 },
336 {
337 "cell_type": "code",
338 "execution_count": null,
339 "metadata": {},
340 "outputs": [],
341 "source": []
342 }
343 ],
344 "metadata": {
345 "kernelspec": {
346 "display_name": "Python 3",
347 "language": "python",
348 "name": "python3"
349 },
350 "language_info": {
351 "codemirror_mode": {
352 "name": "ipython",
353 "version": 3
354 },
355 "file_extension": ".py",
356 "mimetype": "text/x-python",
357 "name": "python",
358 "nbconvert_exporter": "python",
359 "pygments_lexer": "ipython3",
360 "version": "3.5.2"
361 }
362 },
363 "nbformat": 4,
364 "nbformat_minor": 2
365 }
0 def handle(conf):
1 """
2 该方法是部署之后,其他人调用你的服务时候的处理方法。
3 请按规范填写参数结构,这样我们就能替你自动生成配置文件,方便其他人的调用。
4 范例:
5 params['key'] = value # value_type: str # description: some description
6 value_type 可以选择:img, video, audio, str, int, float, [int], [str], [float]
7 参数请放到params字典中,我们会自动解析该变量。
8 """
9
10 param1 = conf['param1'] # value_type: str # description: some description
11 # add your code
12 return {'ret1': 'cat'}
13
0 absl-py==0.7.1
1 alembic==1.4.2
2 appdirs==1.4.4
3 astor==0.7.1
4 async-generator==1.10
5 attrs==19.3.0
6 Augmentor==0.2.8
7 backcall==0.2.0
8 baytune==0.3.10
9 bleach==3.1.5
10 boto3==1.14.34
11 botocore==1.17.34
12 certifi==2020.6.20
13 certipy==0.1.3
14 cffi==1.14.1
15 chardet==3.0.4
16 click==7.1.2
17 configparser==4.0.2
18 cryptography==3.0
19 cycler==0.10.0
20 Cython==0.29.20
21 decorator==4.4.2
22 defusedxml==0.6.0
23 distlib==0.3.1
24 docutils==0.15.2
25 entrypoints==0.3
26 et-xmlfile==1.0.1
27 filelock==3.0.12
28 func-timeout==4.3.5
29 future==0.18.2
30 gast==0.2.2
31 graphviz==0.14
32 grpcio==1.20.1
33 h5py==2.9.0
34 idna==2.10
35 imageio==2.8.0
36 imgaug==0.4.0
37 importlib-metadata==0.23
38 importlib-resources==3.0.0
39 ipdb==0.13.2
40 ipykernel==5.3.4
41 ipython==7.9.0
42 ipython-genutils==0.2.0
43 ipywidgets==7.4.0
44 jdcal==1.4.1
45 jedi==0.17.2
46 jieba==0.42.1
47 Jinja2==2.11.2
48 jmespath==0.10.0
49 joblib==0.14.1
50 jsonschema==3.2.0
51 jupyter-client==6.1.6
52 jupyter-core==4.6.3
53 jupyterhub==1.0.0
54 jupyterlab==1.0.0a1
55 jupyterlab-server==0.2.0
56 Keras==2.3.1
57 Keras-Applications==1.0.7
58 Keras-Preprocessing==1.0.9
59 kiwisolver==1.1.0
60 Mako==1.1.3
61 Markdown==3.1
62 MarkupSafe==1.1.1
63 matplotlib==3.0.3
64 minepy==1.2.4
65 minio==5.0.10
66 mistune==0.8.4
67 mock==2.0.0
68 more-itertools==7.2.0
69 nbconvert==5.6.1
70 nbformat==5.0.7
71 networkx==2.4
72 nltk==3.5
73 notebook==6.0.3
74 numpy==1.16.0
75 oauthlib==3.1.0
76 opencv-python==4.2.0.34
77 openpyxl==2.6.4
78 packaging==20.4
79 pamela==1.0.0
80 pandas==0.24.2
81 pandocfilters==1.4.2
82 parso==0.7.1
83 pbr==5.2.0
84 pexpect==4.8.0
85 pickleshare==0.7.5
86 Pillow==7.2.0
87 plotly==4.8.1
88 prometheus-client==0.8.0
89 prompt-toolkit==2.0.10
90 protobuf==3.12.4
91 ptyprocess==0.6.0
92 pycparser==2.20
93 pydot==1.4.1
94 pyenchant==3.1.1
95 Pygments==2.6.1
96 pyOpenSSL==19.1.0
97 pyparsing==2.4.7
98 pyrsistent==0.16.0
99 python-dateutil==2.8.0
100 python-editor==1.0.4
101 pytz==2020.1
102 PyWavelets==1.1.1
103 PyYAML==5.3.1
104 pyzmq==19.0.2
105 regex==2020.7.14
106 requests==2.24.0
107 retrying==1.3.3
108 s3transfer==0.3.3
109 sacremoses==0.0.43
110 scikit-image==0.15.0
111 scikit-learn==0.22.2.post1
112 scipy==1.4.1
113 seaborn==0.9.1
114 Send2Trash==1.5.0
115 sentencepiece==0.1.91
116 Shapely==1.7.0
117 six==1.12.0
118 SQLAlchemy==1.3.18
119 stevedore==1.32.0
120 tensorboard==1.13.1
121 tensorboardX==2.0
122 tensorflow==1.13.1
123 tensorflow-estimator==1.13.0
124 termcolor==1.1.0
125 terminado==0.8.3
126 testpath==0.4.4
127 tokenizers==0.5.2
128 torch==1.4.0+cpu
129 torchtext==0.6.0
130 torchvision==0.5.0+cpu
131 tornado==6.0.4
132 tqdm==4.46.1
133 traitlets==4.3.3
134 transformers==2.5.1
135 urllib3==1.25.10
136 virtualenv==20.0.29
137 virtualenv-clone==0.5.4
138 virtualenvwrapper==4.8.4
139 wcwidth==0.2.5
140 webencodings==0.5.1
141 Werkzeug==0.15.2
142 widgetsnbextension==3.4.2
143 word2vec==0.10.6
144 xlrd==1.2.0
145 yellowbrick==1.1
146 zipp==0.6.0
0 Please store your training checkpoints or results here
1 请在此处存储 checkpoints 和结果文件