Skip to content

Commit 75e7a1e

Browse files
committed
Updated core, added description to setup.py
1 parent 795265b commit 75e7a1e

File tree

3 files changed

+66
-58
lines changed

3 files changed

+66
-58
lines changed

README.md

Lines changed: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,52 @@
1-
# depthai-api
1+
# DepthAI Python Library
22

3-
Host-side DepthAI source code
3+
Python bindings for C++ depthai-core library
44

5-
## Content description
5+
## Documentation
66

7-
- **host** - contains the code which runs on the host computer (Raspberry Pi or a PC that has a DepthAI device connected). This part has:
7+
Documentation is available over at [Luxonis DepthAI Python API](https://docs.luxonis.com/api/)
88

9-
- **py_module** - python module (made only with C++ code with `pybind11`). Builds an `.so` libray that can be imported with python.
10-
- **app** - C++ app for easier debugging and development.
11-
- **core** - main functionality of the host, which is used in `py_module` and `app`.
9+
## Installation
1210

13-
- **shared** - code that is shared between host and DepthAI device. This code gets also into the firmware binary `depthai.cmd`
14-
15-
## Tested platforms
16-
17-
- Ubuntu 16.04, 18.04;
18-
- Raspbian 10;
19-
- macOS 10.14.6, 10.15.4;
11+
Prebuilt wheels are available in [Luxonis repository](https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/)
12+
Make sure pip is upgraded
13+
```
14+
python3 -m pip install -U pip
15+
python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/ depthai
16+
```
17+
## Building from source
2018

21-
## Setup
19+
### Dependencies
20+
- cmake >= 3.2
21+
- C/C++11 compiler (clang, gcc, msvc, ...)
22+
- Python
2223

23-
- Install development environment dependencies:
24-
- Linux:
24+
Along these, dependencies of depthai-core are also required
25+
See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#dependencies)
2526

26-
sudo apt-get install -y git python-pip cmake cmake-gui libusb-1.0-0-dev
27-
- macOS:
2827

29-
brew install coreutils python3 cmake libusb wget opencv
28+
### Building
3029

31-
- After cloning the repo, update the third-party libraries used:
30+
To build a shared library from source perform the following:
31+
```
32+
mkdir build && cd build
33+
cmake ..
34+
cmake --build . --parallel
35+
```
3236

33-
./install_dependencies.sh
37+
To build a wheel, execute the following
38+
```
39+
python3 -m pip wheel . -w wheelhouse
40+
```
3441

3542

36-
## Build and run
43+
## Tested platforms
3744

38-
- **Windows (x64)**
39-
In seconds step, remove parameter *-A x64* for 32bit variant (Python must also be 32bit)
40-
```
41-
mkdir -p build && cd build
42-
cmake .. -A x64 -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_BINARY_DIR="C:/.hunter_bin" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%CD%\..\cmake\ToolchainConfig.cmake"
43-
cmake --build . --parallel
44-
```
45+
- Windows 10
46+
- Ubuntu 16.04, 18.04;
47+
- Raspbian 10;
48+
- macOS 10.14.6, 10.15.4;
4549

46-
- **host/py_module**
47-
48-
cd host/py_module
49-
mkdir -p build
50-
cd build
51-
cmake ..
52-
make -j
53-
Alternatively, when this repo is used as a submodule in https://github.com/luxonis/depthai, the build process can be automated with the script below, that is also copying the generated `.so` back to `depthai`:
54-
- `./build_py_module.sh`
55-
first it does a full build, then at subsequent runs compiles only the modified source files.
56-
- `./build_py_module.sh --clean`
57-
cleans up the build folder and does a full rebuild.
58-
59-
60-
- **host/app**
61-
(Note: this is currently outdated and doesn't run properly)
62-
`DEPTHAI_EXTRAS_PATH` in `main.cpp` may have to be adjusted first.
63-
64-
cd host/app
65-
mkdir -p build
66-
cd build
67-
cmake ..
68-
make -j
69-
./depthai_app
70-
71-
7250
## Troubleshooting
7351

7452
1. Build failure on Ubuntu 18.04 ("relocation ..." link error) with gcc 7.4.0 (default) - [**issue #3**](https://github.com/luxonis/depthai-api/issues/3)

setup.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import io
23
import re
34
import sys
45
import platform
@@ -54,6 +55,10 @@
5455
if len(__version__.split("+")) > 1 :
5556
buildCommitHash = __version__.split("+")[1]
5657

58+
59+
## Read description (README.md)
60+
long_description = io.open("README.md", encoding="utf-8").read()
61+
5762
class CMakeExtension(Extension):
5863
def __init__(self, name, sourcedir=''):
5964
Extension.__init__(self, name, sources=[])
@@ -157,10 +162,35 @@ def build_extension(self, ext):
157162
author='Martin Peterlin',
158163
author_email='[email protected]',
159164
description='DepthAI Python Library',
160-
long_description='',
165+
license="MIT",
166+
long_description=long_description,
167+
long_description_content_type="text/markdown",
168+
url="https://github.com/luxonis/depthai-python",
161169
ext_modules=[CMakeExtension('depthai')],
162170
cmdclass={
163171
'build_ext': CMakeBuild
164172
},
165173
zip_safe=False,
174+
classifiers=[
175+
"Development Status :: 3 - Alpha",
176+
"Intended Audience :: Developers",
177+
"Intended Audience :: Education",
178+
"Intended Audience :: Information Technology",
179+
"Intended Audience :: Science/Research",
180+
"License :: OSI Approved :: MIT License",
181+
"Operating System :: MacOS",
182+
"Operating System :: Microsoft :: Windows",
183+
"Operating System :: Unix",
184+
"Programming Language :: Python",
185+
"Programming Language :: Python :: 3",
186+
"Programming Language :: Python :: 3.5",
187+
"Programming Language :: Python :: 3.6",
188+
"Programming Language :: Python :: 3.7",
189+
"Programming Language :: Python :: 3.8",
190+
"Programming Language :: C++",
191+
"Programming Language :: Python :: Implementation :: CPython",
192+
"Topic :: Scientific/Engineering",
193+
"Topic :: Software Development",
194+
],
195+
python_requires='>=3.5',
166196
)

0 commit comments

Comments
 (0)