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 inference #84

Merged
merged 8 commits into from
Oct 2, 2024
Merged

Add video inference #84

merged 8 commits into from
Oct 2, 2024

Conversation

sokovninn
Copy link
Member

@sokovninn sokovninn commented Oct 1, 2024

This pull request includes several changes to enhance the inference capabilities of the luxonis_train module, particularly by adding support for video files and improving the handling of image and video sources. The most important changes include renaming variables for clarity, adding support for video processing, and updating the inference logic to accommodate these improvements.

Enhancements to Inference Capabilities:

  • luxonis_train/__main__.py: Renamed ImgPathType to SourcePathType and updated the help text to include video files. Updated the infer function to use source_path instead of img_path.

  • luxonis_train/core/core.py: Added process_video to the imports. Defined IMAGE_FORMATS and VIDEO_FORMATS sets for supported file types. Updated the infer method to handle video files and directories containing images.

Improvements in Utility Functions:

  • luxonis_train/core/utils/infer_utils.py: Added process_video function to handle video file inference. Refactored process_images and introduced prepare_and_infer_image for better code reuse. Updated render_visualizations to optionally return visualizations instead of displaying them.

Possible improvements:

  • Parallel video processing and batched inference
  • Webcam/stream source for inference

@sokovninn sokovninn added the enhancement New feature or request label Oct 1, 2024
@sokovninn sokovninn requested a review from a team as a code owner October 1, 2024 10:18
@sokovninn sokovninn requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team October 1, 2024 10:18
@github-actions github-actions bot added the CLI Changes affecting the CLI label Oct 1, 2024
Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

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

LGTM, left some comments

luxonis_train/core/core.py Outdated Show resolved Hide resolved
luxonis_train/core/utils/infer_utils.py Show resolved Hide resolved
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 44 lines in your changes missing coverage. Please review.

Please upload report for BASE (dev@c97f921). Learn more about missing BASE report.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
luxonis_train/core/utils/infer_utils.py 21.27% 37 Missing ⚠️
luxonis_train/core/core.py 12.50% 7 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             dev      #84   +/-   ##
======================================
  Coverage       ?   96.04%           
======================================
  Files          ?      143           
  Lines          ?     6341           
  Branches       ?        0           
======================================
  Hits           ?     6090           
  Misses         ?      251           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kozlov721 kozlov721 left a comment

Choose a reason for hiding this comment

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

LGTM

@klemen1999 klemen1999 merged commit 67497e4 into dev Oct 2, 2024
9 checks passed
@klemen1999 klemen1999 deleted the feat/video-inference branch October 2, 2024 10:03
@kozlov721 kozlov721 mentioned this pull request Oct 9, 2024
kozlov721 pushed a commit that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Changes affecting the CLI enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants