3315 Commits

Author SHA1 Message Date
Jonathan Thomas 8f1f091c1d Merge pull request #1079 from OpenShot/cmake-cleanup
Clean-up and modernization of our cmake build system
2026-05-24 22:59:10 -05:00
Jonathan Thomas e3151d577b Clean-up and modernization of our cmake build system
- Modernized SWIG policy handling for Python, Ruby, and Java without raising the project-wide CMake policy version.
- Switched Python discovery to Python3 on CMake 3.12+, with legacy PythonInterp/PythonLibs fallback for older CMake.
- Removed dead pre-CMake-3.8 SWIG branches.
- Quieted optional babl pkg-config probing.
- Changed FFmpeg probing so avresample is only checked if swresample is unavailable.
- Cleaned Java binding debug configure messages.
- Addressed the SWIG build warnings:
  - Added SWIG-only juce::Thread declaration for Python/Ruby/Java.
  - Added Python QWidget typecheck precedence.
  - Filtered known Ruby binding limitations for multiple inheritance and unexposed Profile operators.
  - Suppressed Java-only SWIG categories for unsupported operators/proxy limitations via Java SWIG flags.
2026-05-24 17:31:52 -05:00
Jonathan Thomas 0a68c884e2 Merge pull request #1078 from OpenShot/object-mask-effect
New "Object Mask" Effect: Segment Anything / Track Anything
2026-05-22 14:50:34 -05:00
Jonathan Thomas 8d9b8c22bf Improve Cutie object mask memory and aspect handling
- Preserve the first seeded Cutie memory frame as a permanent memory slot and
  use the remaining slots as rolling working memory. This keeps the initial
  prompted mask available during later propagation instead of evicting it from
  the FIFO window.
- Also letterbox frames and masks into the fixed Cutie ONNX input size instead
  of stretching them, unletterbox propagated masks back to source dimensions,
  and mark padded memory regions invalid for memory readout.
2026-05-21 14:43:55 -05:00
Jonathan Thomas d01ffe1ea8 Merge pull request #1077 from OpenShot/black-frames
Avoid Black Frames (Adding a new clip - and it does not appear)
2026-05-20 23:15:32 -05:00
Jonathan Thomas cf354e19f3 Merge pull request #1075 from OpenShot/object-detection-v2
Object detection migration to Yolo v5 (ONNX)
2026-05-20 22:34:45 -05:00
Jonathan Thomas da35707966 Merge branch 'object-detection-v2' into object-mask-effect 2026-05-20 21:42:07 -05:00
Jonathan Thomas 5dc3724bba Fixing Codacy nitpicks
- Reordered the bounds check before indexing predictedBoxes in sort.cpp
- Marked SortTracker constructor explicit
- Removed TrackingBox::classScores from the public result struct and moved it into a private DetectionBox helper in sort.cpp
- Replaced the raw prototype scan loop with std::find_if
2026-05-20 21:41:45 -05:00
Jonathan Thomas 9f228c923b Improve Object Mask prompts and conservative GPU selection
- Supports multiple positive rect prompts instead of only the first rect.
- Preserves negative rects as ranking filters instead of collapsing them to center points.
- Ranks EfficientSAM candidates with soft penalties for negative point hits and negative rect overlap.
- Unions separate EfficientSAM passes for multiple positive rects so multiple target objects can remain selected.
- Makes GPU_AUTO conservative:
    - CUDA if available
    - otherwise CPU
    - OpenCL only when explicitly requested with GPU_OPENCL
- Adds simple requested/selected DNN device logging for Object Detection, EfficientSAM, and Cutie.
2026-05-20 18:45:57 -05:00
Jonathan Thomas 395f66253c Improve Object Mask model compatibility
- Removing XMem as a backend for Object Mask effect (replacing with Cutie model)
- Detect Cutie model dimensions from selected model filenames instead of relying on a fixed propagation size.
- Support multiple Cutie quality tiers with matching encode/decode/readout dimensions.
- Add fallback mask threshold behavior for EfficientSAM when the default threshold produces an empty mask.
- Reduce Object Mask preview/export failures with larger Cutie model variants.
2026-05-20 14:22:28 -05:00
Jonathan Thomas 8bd98a592b Replace ObjectMask EdgeSAM seed masks with EfficientSAM ONNX
- Use a single EfficientSAM ONNX model for ObjectMask seed mask generation
- Add EfficientSAM prompt preprocessing and mask candidate selection
- Keep seed-frame output as the raw EfficientSAM mask while still seeding XMem
- Add ClipProcessingJobs::PreviewObjectMask for single-frame interactive previews
- Accept EfficientSAM model JSON keys while preserving legacy encoder_model aliases
- Remove ObjectMask protobuf shutdown call that could destabilize Python teardown
- Add ObjectMask ONNX validation coverage
2026-05-18 19:18:56 -05:00
Jonathan Thomas 1f0b1b9698 Add Object Mask effect with EdgeSAM and XMem propagation
- Add ObjectMask effect for rendering and exposing generated object masks
- Add EdgeSAM preprocessing path for prompt-based seed and reseed masks
- Add XMem ONNX propagation between seed frames for single-object tracking
- Support positive/negative points, positive rect prompts, and prompt keyframes
- Store generated masks in protobuf data for playback and downstream effects
- Add mask color/alpha plus stroke color/alpha/width effect controls
- Register ObjectMask with effect discovery and clip preprocessing jobs
- Add focused ObjectMask effect tests
2026-05-18 16:28:13 -05:00
Jonathan Thomas ec370404d9 Add YOLO segmentation mask support to Object Detection
- Support YOLO segmentation ONNX outputs, persist sparse RLE masks in object-detection protobuf data, and render configurable mask overlays in the Object Detection effect.
- Also normalize tracked object classes at save time, smooth short mask gaps, and expose Draw Mask / Mask Color / Mask Alpha only when mask data is available.
2026-05-15 17:51:16 -05:00
Jonathan Thomas 9fbe600244 Updated compatibility for CVObjectDetection to support:
- YOLOv5: [1, num_boxes, 5 + classes]
- YOLO26 no-end2end export: [1, attributes, candidates], e.g. [1,116,8400]
-Also kept the YOLOv5-seg safety fix: when a classes file exists, mask coefficients are not treated as extra classes.
2026-05-15 09:15:09 -05:00
Jonathan Thomas 30e3ba6b34 Repair rpath for new OpenCV 4.13.0 version on Mac, during libopenshot build, so it's linked correctly. 2026-05-14 13:20:35 -05:00
Jonathan Thomas d1aa207335 Updating GitLab CI to use parallel builds, dynamic cpu counts, so each build server is using all available cores. 2026-05-14 13:14:59 -05:00
Jonathan Thomas 8a5fd4d8b4 Updating Mac builder to use OpenCV 4.13.0, and passing in correct paths for it in our CI build 2026-05-14 12:17:24 -05:00
Jonathan Thomas f7586af1be Fallback to CPU backend for OpenCV when CUDA backend not available. 2026-05-13 23:20:31 -05:00
Jonathan Thomas c9380a8c0e Updating OpenCV on Linux and Windows builders to use a newly installed 4.13.0 version (built from source) 2026-05-13 22:48:08 -05:00
Jonathan Thomas 47d1784b1c Validate YOLO ONNX models in libopenshot
- Add libopenshot-side ONNX model validation for object detection
- Return user-displayable error text instead of throwing through callers
- Share ONNX load/error handling between validation and object detection processing
- Fail early for YOLOv5 on OpenCV older than 4.3
- Expose validation through ClipProcessingJobs for Python bindings
2026-05-13 14:30:40 -05:00
Jonathan Thomas 4f6cb7c50f Updating gitlab builder for Linux to use new /opt installed OpenCV 4.5.5 folder, and return error message on < 4.3.0 OpenCV versions for Object Detection effect. 2026-05-13 00:00:29 -05:00
Jonathan Thomas 195632ac86 Fix persistent black frames after clip open failure
- Only mark timeline clips as open after Clip::Open() succeeds
- Allow later GetFrame() calls to retry opening clips after transient failures
- Prevent cache rebuilds from repeatedly generating blank frames for closed clips
- Add regression coverage for a failed first open followed by a successful retry
2026-05-12 22:31:12 -05:00
Jonathan Thomas ae3d769f0a Fix stale timeline cache after adding clips
- Invalidate affected final_cache frames in AddClip()
- Remove duplicate JSON insert invalidation
- Add regression test for stale black frames
2026-05-12 18:38:45 -05:00
Jonathan Thomas 14c63f3714 Fix margin-bounded effects to avoid invalid image access
- Clamp and validate Blur, Bars, and Pixelate margin-derived regions
- Add regression coverage for collapsed/out-of-range margin cases
- Verify focused Bars, Blur, and Pixelate tests pass
2026-05-12 15:15:15 -05:00
Jonathan Thomas 4f289bc442 Fix saturation stride and parent effect updates
- Respect QImage::bytesPerLine() in saturation and mask blending
- Preserve child effect IDs when inheriting parent effect changes
- Propagate parent updates correctly through nested child effects
- Add regression tests for padded image stride and parent effect inheritance
2026-05-12 14:22:06 -05:00