Skip to content

Commit

Permalink
Remove most hacks that were added to work around issues in pycocotools (
Browse files Browse the repository at this point in the history
#449)

pycocotools 2.0.4 includes changes to the build system that make it possible
to downgrade NumPy after installing pycocotools, and therefore:

* --no-binary=pycocotools is no longer necessary;
* TensorFlow can be installed in the same `pip` invocation as Datumaro.

The only hack that remains (that I know of) is the usage of
`pycocotools-windows` on Windows, since the `pycocotools` PyPI project still
doesn't provide Windows wheels (or any other wheels).
  • Loading branch information
Roman Donchenko authored Jan 10, 2022
1 parent f316af4 commit a76d815
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/health_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Installing dependencies
run: |
pip install tensorflow pytest pytest-cov
pip install -e .[default,tfds]
pip install -e '.[default,tf,tfds]' pytest pytest-cov
- name: Code instrumentation
run: |
pytest -v --cov --cov-report xml:coverage.xml
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Installing dependencies
run: |
pip install tensorflow pytest
pip install -e .[default,tfds]
pip install -e '.[default,tf,tfds]' pytest
- name: Unit testing
run: |
pytest -v
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `smooth_line` from `datumaro.util.annotation_util` - the function
is renamed to `approximate_line` and has updated interface
(<https://github.com/openvinotoolkit/datumaro/pull/592>)
- The `pycocotools` dependency lower bound is raised to `2.0.4`.
(<https://github.com/openvinotoolkit/datumaro/pull/449>)

### Deprecated
- TBD
Expand Down
2 changes: 1 addition & 1 deletion requirements-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pillow>=6.1.0
ruamel.yaml>=0.17.0
typing_extensions>=3.7.4.3

pycocotools>=2.0.2; platform_system != "Windows" or python_version >= '3.9'
pycocotools>=2.0.4; platform_system != "Windows" or python_version >= '3.9'

pycocotools-windows; platform_system == "Windows" and python_version < '3.9'
PyYAML>=5.3.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r requirements-core.txt --no-binary=pycocotools # https://github.com/openvinotoolkit/datumaro/issues/253
-r requirements-core.txt
-r requirements-default.txt

opencv-python-headless>=4.1.0.25
Expand Down
14 changes: 0 additions & 14 deletions site/content/en/docs/user-manual/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,6 @@ plugin dependencies in the [plugins](/docs/user-manual/extending) section.
This option can't be covered by extras due to Python packaging system
limitations.

- Although Datumaro excludes `pycocotools` of version 2.0.2 in
requirements, it works with this version perfectly fine. The
reason for such requirement is binary incompatibility of the `numpy`
dependency in the `TensorFlow` and `pycocotools` binary packages,
and the current workaround forces this package to be build from sources
on most platforms
(see [#253](https://github.com/openvinotoolkit/datumaro/issues/253)).
If you need to use 2.0.2, make sure it is linked with the same version
of `numpy` as `TensorFlow` by reinstalling the package:
``` bash
pip uninstall pycocotools
pip install pycocotools --no-binary=pycocotools
```

- When installing directly from the repository, you can change the
installation branch with `...@<branch_name>`. Also use `--force-reinstall`
parameter in this case. It can be useful for testing of unreleased
Expand Down

0 comments on commit a76d815

Please sign in to comment.