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

Move algorithm-specific dependencies into class definition (optical flow) #327

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

vcozzolino
Copy link
Contributor

@vcozzolino vcozzolino commented Jun 17, 2022

Signed-off-by: Vittorio Cozzolino vittorio.cozzolino@huawei.com

What type of PR is this?

/kind bug

What this PR does / why we need it:

Move algorithm-specific dependencies into the class definition for the optical flow module. This should lift the requirement to have extra dependencies in the KB image.

Which issue(s) this PR fixes:

Fixes #320

@kubeedge-bot kubeedge-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 17, 2022
@kubeedge-bot kubeedge-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 17, 2022
@@ -40,6 +37,9 @@ def __call__(self, old_frame=None, current_frame=None):

@ClassFactory.register(ClassType.OF, alias="LukasKanadeOF")
class LukasKanade(BaseFilter, abc.ABC):
import cv2
import numpy
Copy link
Contributor

@JoeyHwong-gk JoeyHwong-gk Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numpy is the basic dependency of Sedna.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I placed the numpy import inside the class because I noticed that it is imported at the function level in the FedAvg class. So I thought about following the same approach.

Anyway, I will move the import up to the module level.

@JoeyHwong-gk
Copy link
Contributor

please add the dependency cv2 into requirements.dev.txt

@vcozzolino
Copy link
Contributor Author

please add the dependency cv2 into requirements.dev.txt

Will do.

@JoeyHwong-gk
Copy link
Contributor

It looks good to me.
Suggestions:

  1. warning: lib/sedna/algorithms/optical_flow/__init__.py:105:15: E401 multiple imports on one line
  2. just rebase the commits

…low).

Signed-off-by: Vittorio Cozzolino <vittorio.cozzolino@huawei.com>

Code linting.

Signed-off-by: Vittorio Cozzolino <vittorio.cozzolino@huawei.com>

Move numpy import to module level.

Signed-off-by: Vittorio Cozzolino <vittorio.cozzolino@huawei.com>

Add opencv-python to requirements.dev
@JoeyHwong-gk
Copy link
Contributor

/lgtm

/assign @jaypume

@kubeedge-bot
Copy link
Collaborator

@JoeyHwong-gk: changing LGTM is restricted to collaborators

In response to this:

/lgtm

/assign @jaypume

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jaypume
Copy link
Member

jaypume commented Jul 14, 2022

/lgtm

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2022
@jaypume
Copy link
Member

jaypume commented Jul 14, 2022

/approve

@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jaypume

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2022
@kubeedge-bot kubeedge-bot merged commit 778a2ca into kubeedge:main Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kb v0.5.0 is in CrashLoopBackOff status
4 participants