Add macOS Compatibility with CPU Support and Interactive CLI#62
Add macOS Compatibility with CPU Support and Interactive CLI#62zettai-seigi wants to merge 1 commit intoTencent:mainfrom
Conversation
- Remove CUDA dependencies and add CPU-only processing - Switch from FP16 to FP32 for CPU compatibility - Add FFmpeg-based video processing with fallbacks - Implement video trimming and frame extraction - Create interactive CLI interface with presets - Add comprehensive macOS documentation - Support Apple Silicon (M1/M2/M3) and Intel Macs - Maintain backward compatibility with CUDA systems Co-authored-by: Claude <noreply@anthropic.com>
|
Cool! I will check it when I find some time in my schedule. |
Hi @wbhu thanks for the reply. If time permits I will figure it out over the weekend, and thanks to you and the team for this wonderful project. |
|
Hi @wbhu, the function call _resize_with_antialiasing(...) uses <-- this operation is not supported by MPS backend at the moment, it gives out "UserWarning: The operator ‘aten::_upsample_bicubic2d_aa.out’ is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications." with pytorch 2.8. I tried using pytorch 2.3.1 using bilinear approach and doing antialiasing later on but the result are not pretty. |
Hi @zettai-seigi , I have checked the original implementation, it seems we don't need the resize_with_antialiasing operation. Could you please share more about where this function is called |
You’re asking about the
So... yeah.. |
|
Hi @zettai-seigi , If _resize_with_antialiasing is only used for resizing, then performing the resize on the CPU end wouldn't influence the performance too much. I think the bottleneck should be the neural layers |
macOS Compatibility Update for DepthCrafter
Summary
This PR adds full macOS support (Apple Silicon & Intel) to DepthCrafter with CPU-based processing, enhanced video handling, and an interactive CLI interface.
Key Changes
1. 🍎 macOS Compatibility
2. 🎬 Enhanced Video Processing
3. 🖥️ Interactive CLI Interface
4. 📁 Files Modified
Core Processing Files:
run.py- Added macOS device detection, FP32 support, frame limiting optionsapp.py- Updated for CPU/MPS compatibilitydepthcrafter/depth_crafter_ppl.py- Fixed device detection, removed CUDA dependenciesdepthcrafter/unet.py- Updated comments for FP32depthcrafter/utils.py- Added FFmpeg fallback, video trimming, progress trackingNew Files:
interactive_cli.py- Complete interactive CLI interfacedepthcrafter_ui- Quick launcher scriptREADME_macOS.md- Comprehensive macOS documentationCLAUDE.md- Project documentation for AI assistantsUpdated:
requirements.txt- Added opencv-python for video processingbenchmark/demo.sh- Removed CUDA_VISIBLE_DEVICESFeatures Added
Video Trimming
Interactive CLI
# Launch interactive interface python interactive_cli.pyRobust Video Handling
Performance
Memory Requirements
Processing Times (M1 MacBook Pro, 150 frames)
Testing
Tested on:
Breaking Changes
None - Original CUDA functionality preserved when available
Migration Guide
For macOS users:
brew install ffmpegDocumentation
README_macOS.mdDependencies
opencv-pythonas optional dependencyFuture Improvements
Screenshots/Demo
Interactive CLI
Video Processing
Checklist
Related Issues
Addresses common macOS user requests for:
This PR makes DepthCrafter accessible to the entire macOS community while maintaining full compatibility with the original CUDA implementation.