def load_parameters(self, params):
if not os.path.isabs(params):
params = os.path.join(BNN_PARAM_DIR, params)
if os.path.isdir(params):
self.interface.load_parameters(params.encode())
self.classes = []
with open (os.path.join(params, "classes.txt")) as f:
self.classes = [c.strip() for c in f.readlines()]
filter(None, self.classes)
else:
print("\nERROR: No such parameter directory \"" + params + "\"")
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="example-pkg-your-username",
version="0.0.1",
author="Example Author",
author_email="author@example.com",
description="A small example package",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/pypa/sampleproject",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
from setuptools import setup, find_packages
import subprocess
import sys
import shutil
import bnn
import os
from glob import glob
import site
if os.environ['BOARD'] != 'Ultra96' and os.environ['BOARD'] != 'Pynq-Z1' and os.environ['BOARD'] != 'Pynq-Z2':
print("Only supported on a Ultra96, Pynq-Z1 or Pynq-Z2 Board")
exit(1)
setup(
name = "bnn-pynq",
version = bnn.__version__,
url = 'kwa/pynq',
license = 'Apache Software License',
author = "Nicholas Fraser, Giulio Gambardella, Peter Ogden, Yaman Umuroglu, Christoph Doehring",
author_email = "pynq_support@xilinx.com",
include_package_data = True,
packages = ['bnn'],
package_data = {
'' : ['*.bit','*.tcl','*.so','*.bin','*.txt', '*.cpp', '*.h', '*.sh'],
},
data_files = [(os.path.join('/home/xilinx/jupyter_notebooks/bnn',root.replace('notebooks/','')), [os.path.join(root, f) for f in files]) for root, dirs, files in os.walk('notebooks/')],
description = "Classification using a hardware accelerated neural network with different precision for weights and activation"
)
if os.environ['BOARD'] != 'Ultra96' and os.environ['BOARD'] != 'Pynq-Z1' and os.environ['BOARD'] != 'Pynq-Z2':
print("Only supported on a Ultra96, Pynq-Z1 or Pynq-Z2 Board")