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

Upgrade OpenCV Version #556

Closed
2 tasks
leeping-ng opened this issue Dec 15, 2021 · 1 comment · Fixed by #557
Closed
2 tasks

Upgrade OpenCV Version #556

leeping-ng opened this issue Dec 15, 2021 · 1 comment · Fixed by #557
Labels
dependencies Pull requests that update a dependency file

Comments

@leeping-ng
Copy link
Contributor

leeping-ng commented Dec 15, 2021

It looks like it's time to upgrade our OpenCV dependency from opencv-python==4.1.2.30, for the following reasons:

  • Allow PeekingDuck to run on M1 Mac
  • Address behavioural differences with newer opencv versions, such as cv2.resizeWindow() and input arg types for coordinates when using draw functions

We should upgrade to version 4.5 and newer, as there are some issues with the prior versions as documented below. As of now, the latest opencv-python==4.5.4.60 still works with Python 3.6, which is the lowest version of Python supported by PeekingDuck.

Version Comments
4.1.2.30 Recommended openCV version for PeekingDuck as of 15 Dec 2021. Doesn't work for M1 Mac.
From 4.2.0.32 to 4.4.0.46 Not recommended to use these versions due to a few reported issues mainly due to QT issues with MacOS, such as imshow() not showing, or segmentation fault, or QT error in MacOS
4.5.1.48 Works with M1 Mac and the issues from earlier versions have been fixed by dropping QT support for Mac. Different behaviour for cv2.resize() and cv2.resize_window() when compared to 4.1.2.30.
4.5.2.52 Coordinates need to be int instead of float for drawing
4.5.2.54 Bugfix for 4.5.2.52

Definition of done:

  • Update requirements.txt and setup.cfg with the new version
  • Update draw nodes to take in int coordinates.
@leeping-ng leeping-ng added the dependencies Pull requests that update a dependency file label Dec 15, 2021
@ongtw
Copy link
Contributor

ongtw commented Dec 15, 2021

One correction: the int instead of float coordinates changes began with version 4.5.1.
The key difference between 4.5.1 and 4.5.2 is that the former auto typecast numpy.float32 (but not python float) into int while the latter does not. This is why PeekingDuck "works" with 4.5.1, but on 4.5.2 it shows the error for drawing coordinates to be int instead of float.

@leeping-ng leeping-ng changed the title OpenCV version compatibility Upgrade OpenCV Version Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants