forked from lutzroeder/netron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·113 lines (107 loc) · 4.54 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/python
import distutils
import os
import setuptools
import setuptools.command
import setuptools.command.build_py
import json
TOP_DIR = os.path.realpath(os.path.dirname(__file__))
with open(os.path.join(TOP_DIR, 'package.json')) as package_file:
package_manifest = json.load(package_file)
package_version = package_manifest['version']
node_dependencies = [
( 'netron', [
'node_modules/d3/dist/d3.min.js',
'node_modules/dagre/dist/dagre.min.js',
'node_modules/handlebars/dist/handlebars.min.js',
'node_modules/marked/marked.min.js',
'node_modules/protobufjs/dist/protobuf.min.js',
'node_modules/flatbuffers/js/flatbuffers.js',
'node_modules/npm-font-open-sans/open-sans.css' ]),
( 'netron/fonts/Regular', [
'node_modules/npm-font-open-sans/fonts/Regular/OpenSans-Regular.eot',
'node_modules/npm-font-open-sans/fonts/Regular/OpenSans-Regular.svg',
'node_modules/npm-font-open-sans/fonts/Regular/OpenSans-Regular.ttf',
'node_modules/npm-font-open-sans/fonts/Regular/OpenSans-Regular.woff',
'node_modules/npm-font-open-sans/fonts/Regular/OpenSans-Regular.woff2' ]),
( 'netron/fonts/Semibold', [
'node_modules/npm-font-open-sans/fonts/Semibold/OpenSans-Semibold.eot',
'node_modules/npm-font-open-sans/fonts/Semibold/OpenSans-Semibold.svg',
'node_modules/npm-font-open-sans/fonts/Semibold/OpenSans-Semibold.ttf',
'node_modules/npm-font-open-sans/fonts/Semibold/OpenSans-Semibold.woff',
'node_modules/npm-font-open-sans/fonts/Semibold/OpenSans-Semibold.woff2' ]),
( 'netron/fonts/Bold', [
'node_modules/npm-font-open-sans/fonts/Bold/OpenSans-Bold.eot',
'node_modules/npm-font-open-sans/fonts/Bold/OpenSans-Bold.svg',
'node_modules/npm-font-open-sans/fonts/Bold/OpenSans-Bold.ttf',
'node_modules/npm-font-open-sans/fonts/Bold/OpenSans-Bold.woff',
'node_modules/npm-font-open-sans/fonts/Bold/OpenSans-Bold.woff2' ])
]
class build_py(setuptools.command.build_py.build_py):
def run(self):
result = setuptools.command.build_py.build_py.run(self)
for target, files in node_dependencies:
target = os.path.join(self.build_lib, target)
if not os.path.exists(target):
os.makedirs(target)
for file in files:
self.copy_file(file, target)
return result
setuptools.setup(
name="netron",
version=package_version,
description="Viewer for neural network models",
keywords='onnx keras tensorflow artificial intelligence machine learning deep learning neural network visualizer viewer',
license="MIT",
cmdclass={
'build_py': build_py
},
package_dir={
'netron': 'src'
},
packages=[
'netron'
],
package_data={
'netron': [
'netron', 'netron.py',
'logo.svg', 'favicon.ico', 'icon.png',
'onnx-model.js', 'onnx.js', 'onnx-operator.json',
'tf-model.js', 'tf.js', 'tf-operator.pb',
'tflite-model.js', 'tflite.js', 'tflite-operator.json',
'keras-model.js', 'keras-operator.json', 'hdf5.js',
'coreml-model.js', 'coreml-operator.json', 'coreml.js',
'caffe-model.js', 'caffe-operator.json', 'caffe.js',
'caffe2-model.js', 'caffe2-operator.json', 'caffe2.js',
'mxnet-model.js', 'mxnet-operator.json',
'view-browser.html', 'view-browser.js',
'view-render.css', 'view-render.js',
'view-node.css', 'view-node.js',
'view-template.js',
'view.js', 'view.css'
]
},
install_requires=[],
author='Lutz Roeder',
author_email='[email protected]',
url='https://github.com/lutzroeder/Netron',
scripts=[
'src/netron'
],
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence'
]
)