Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to install opencv-python-headless instead opencv-python #62

Merged
merged 3 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `CamVid` dataset format (<https://github.com/openvinotoolkit/datumaro/pull/57>)
- Ability to install `opencv-python-headless` dependency with `DATUMARO_HEADLESS=1`
enviroment variable instead of `opencv-python` (<https://github.com/openvinotoolkit/datumaro/pull/62>)

### Changed
-
Expand Down
37 changes: 23 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: MIT

from distutils.util import strtobool
import os
import os.path as osp
import re
import setuptools
Expand All @@ -27,6 +29,26 @@ def find_version(file_path=None):
version = version_text[match.start(1) : match.end(1)]
return version

def get_requirements():
requirements = [
'attrs>=19.3.0',
'defusedxml',
'GitPython',
'lxml',
'matplotlib',
'numpy>=1.17.3',
'Pillow',
'pycocotools',
'PyYAML',
'scikit-image',
'tensorboardX',
]
if strtobool(os.getenv('DATUMARO_HEADLESS', '0').lower()):
requirements.append('opencv-python-headless')
else:
requirements.append('opencv-python')

return requirements

with open('README.md', 'r') as fh:
long_description = fh.read()
Expand All @@ -51,20 +73,7 @@ def find_version(file_path=None):
"Operating System :: OS Independent",
],
python_requires='>=3.5',
install_requires=[
'attrs>=19.3.0',
'defusedxml',
'GitPython',
'lxml',
'matplotlib',
'numpy>=1.17.3',
'opencv-python',
'Pillow',
'pycocotools',
'PyYAML',
'scikit-image',
'tensorboardX',
],
install_requires=get_requirements(),
extras_require={
'tf': ['tensorflow'],
'tf-gpu': ['tensorflow-gpu'],
Expand Down