Skip to content

Conversation

@dnth
Copy link
Owner

@dnth dnth commented Apr 2, 2025

This PR introduces significant enhancements and refactoring across the codebase, focusing on improving the inference pipeline, streamlining ONNX export, enhancing core module efficiency, and updating documentation and setup.

Key Changes:

  • Inference & Visualization:
    • Refactored scripts/live_inference.py for improved performance, readability, and added support for video file input alongside existing webcam and image options.
    • Enhanced the draw_boxes function for clearer object detection visualization using OpenCV, including accurate scaling/padding adjustments for bounding boxes.
    • Improved the Gradio demo (gradio_demo.py) visualization logic.
    • Added FPS, provider, and resolution display overlays to live inference outputs.
  • ONNX Export:
    • Introduced a PreprocessingModule to optionally embed image preprocessing steps (resizing, color conversion, normalization) directly into the exported ONNX graph.
    • Updated the export.ipynb notebook with detailed instructions and options for ONNX model export.
  • Core Module Refactoring & Fixes:
    • Optimized tensor concatenation in box_ops.py (box_xyxy_to_cxcywh) and dfine_utils.py (distance2bbox) using torch.cat.
    • Improved tensor flattening in hybrid_encoder.py using reshape.
    • Updated the PostProcessor in postprocess.py to handle orig_target_sizes as an optional input.
    • Refactored components within the DFINE Transformer (dfine_transformer.py).
    • Corrected label format handling in coco_eval.py (CocoEvaluator).
  • Training & Configuration:
    • Updated dataset paths and configurations in train.py for the Rock Paper Scissors dataset.
    • Adjusted the flat_epoch value in deim_hgnetv2_n_coco.yml.

@dnth dnth merged commit 6317d66 into main Apr 2, 2025
3 checks passed
@dnth dnth deleted the pinto branch April 2, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants