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

Add video util protobuf to SDK #58

Merged
merged 10 commits into from
Apr 15, 2024
Merged

Add video util protobuf to SDK #58

merged 10 commits into from
Apr 15, 2024

Conversation

Corallo
Copy link
Contributor

@Corallo Corallo commented Mar 16, 2024

Describe your changes

High Level Changes:

  • Added support for grpc communication with acap-runtime to retrieve frames.

Details:

  • Two new stages, build-python-vdoproto-prestage and build-python-vdoproto, have been added to the Dockerfile. These stages are responsible for building the videocapture proto and installing them.
  • Introduced a new utility library, vdo_proto_utils.py, to encapsulate the grpc communication with acap-runtime.
  • Updated tf_proto_utils.py to ensure compatibility with future versions of numpy.
  • Remove vdo backend from opencv build

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

Angelo DelliSanti added 2 commits March 16, 2024 16:37
@Corallo Corallo requested a review from a team as a code owner March 16, 2024 16:16
@Corallo Corallo requested review from jojju and pataxis March 26, 2024 10:32
@@ -108,11 +108,11 @@ def build_signature_def(inputs=None, outputs=None, method_name=None):
types_pb2.DT_UINT64: np.uint64,
types_pb2.DT_INT16: np.int16,
types_pb2.DT_INT8: np.int8,
types_pb2.DT_STRING: np.object,
types_pb2.DT_STRING: object,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

np.object and np.bool are deprecated,
this is to fix future problem with NumPy compatibility

Copy link
Contributor

@pataxis pataxis left a comment

Choose a reason for hiding this comment

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

I only had a short question and a minimal suggestion so I will set approved now.

@@ -581,6 +574,7 @@ COPY --from=build-python-pytesseract $TARGET_ROOT $SDK_ROOT_DIR/python-pytessera
COPY --from=build-python-tfserving $TARGET_ROOT $SDK_ROOT_DIR/python-tfserving
COPY --from=build-python-scipy $TARGET_ROOT $SDK_ROOT_DIR/python-scipy
COPY --from=build-tesseract $TARGET_ROOT $SDK_ROOT_DIR/tesseract
COPY --from=build-python-vdoproto $TARGET_ROOT $SDK_ROOT_DIR/python-vdoproto
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Alphabetical order?

RUN python3 -m pip install protobuf==4.21.1 six==1.16.0 grpcio==1.46.3
RUN python3 -m pip install --no-dependencies grpcio-tools==1.47.0
RUN mkdir -p $TARGET_ROOT/usr/lib/$(cat /tmp/python_version)/site-packages
RUN python3 -m grpc_tools.protoc -I . --python_out=$TARGET_ROOT/usr/lib/$(cat /tmp/python_version)/site-packages --grpc_python_out=$TARGET_ROOT/usr/lib/$(cat /tmp/python_version)/site-packages videocapture.proto
Copy link
Contributor

Choose a reason for hiding this comment

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

In documentation I can only see protoc -I SRC_DIR --python_out=DST_DIR path/to/file.proto, but is this format is due to an older version of grpc_tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we started to use this solution last year because of a problem with versions compatibility between python packages.
We could revisit this when we will work on simplifying the CV SDK

Copy link
Contributor

Choose a reason for hiding this comment

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

When is this file called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used during the installation at line 396

Change-Id: I871ce471bcd1afb2e33aef7560fe480fae533850
…cations/acap-computer-vision-sdk into feature/vdo-protobuf

* 'feature/vdo-protobuf' of https://github.com/AxisCommunications/acap-computer-vision-sdk:
  tf_proto_utils: add 2 min waiting time for model (#57)

Change-Id: I04518ed1193937a5e163e231297d040d8a8c5423
Change-Id: Id0208d70b58fdc2e08ffdfa7954c698ff1295d26
@Corallo Corallo merged commit 47a2894 into main Apr 15, 2024
@Corallo Corallo deleted the feature/vdo-protobuf branch April 15, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants