syncnet-python 0.1.1__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/INSTALL.md +1 -1
  2. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/PKG-INFO +70 -9
  3. syncnet_python-0.2.1/README.md +170 -0
  4. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/pyproject.toml +1 -1
  5. syncnet_python-0.2.1/requirements.txt +11 -0
  6. syncnet_python-0.2.1/syncnet/core/__init__.py +208 -0
  7. syncnet_python-0.2.1/syncnet/core/audio.py +260 -0
  8. syncnet_python-0.2.1/syncnet/core/base.py +271 -0
  9. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/core/compat.py +37 -2
  10. syncnet_python-0.2.1/syncnet/core/config.py +293 -0
  11. syncnet_python-0.2.1/syncnet/core/exceptions.py +151 -0
  12. syncnet_python-0.2.1/syncnet/core/logging.py +266 -0
  13. syncnet_python-0.2.1/syncnet/core/models.py +289 -0
  14. syncnet_python-0.2.1/syncnet/core/sync_analyzer.py +393 -0
  15. syncnet_python-0.2.1/syncnet/core/utils.py +364 -0
  16. syncnet_python-0.2.1/syncnet/core/video.py +393 -0
  17. syncnet_python-0.2.1/syncnet/detectors/__init__.py +5 -0
  18. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python/syncnet_pipeline.py +49 -12
  19. syncnet_python-0.2.1/syncnet_python/test_lse_metrics.py +95 -0
  20. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/PKG-INFO +70 -9
  21. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/SOURCES.txt +9 -10
  22. syncnet_python-0.1.1/README.md +0 -109
  23. syncnet_python-0.1.1/requirements.txt +0 -0
  24. syncnet_python-0.1.1/script/syncnet_pipeline.py +0 -332
  25. syncnet_python-0.1.1/syncnet/core/__init__.py +0 -12
  26. syncnet_python-0.1.1/syncnet/core/models.py +0 -195
  27. syncnet_python-0.1.1/syncnet/detectors/__init__.py +0 -1
  28. syncnet_python-0.1.1/syncnet_python/SyncNetInstance.py +0 -210
  29. syncnet_python-0.1.1/syncnet_python/SyncNetModel.py +0 -99
  30. syncnet_python-0.1.1/syncnet_python/detectors/__init__.py +0 -1
  31. syncnet_python-0.1.1/syncnet_python/detectors/s3fd/__init__.py +0 -66
  32. syncnet_python-0.1.1/syncnet_python/detectors/s3fd/box_utils.py +0 -233
  33. syncnet_python-0.1.1/syncnet_python/detectors/s3fd/nets.py +0 -177
  34. syncnet_python-0.1.1/syncnet_python/run_syncnet_pipeline_on_1example.py +0 -28
  35. syncnet_python-0.1.1/syncnet_python/run_syncnet_pipeline_on_mocha_generation_on_mocha_bench.py +0 -157
  36. syncnet_python-0.1.1/syncnet_python/run_syncnet_pipeline_on_your_own_model_results.py +0 -158
  37. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/CLAUDE.md +0 -0
  38. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/LICENSE +0 -0
  39. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/MANIFEST.in +0 -0
  40. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/example/speech.wav +0 -0
  41. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/example/video.avi +0 -0
  42. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/scripts/run_batch.py +0 -0
  43. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/scripts/run_example.py +0 -0
  44. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/setup.cfg +0 -0
  45. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/setup.py +0 -0
  46. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/__init__.py +0 -0
  47. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/cli.py +0 -0
  48. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/core/inference.py +0 -0
  49. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/core/types.py +0 -0
  50. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/detectors/s3fd/__init__.py +0 -0
  51. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/detectors/s3fd/detector.py +0 -0
  52. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/detectors/s3fd/utils.py +0 -0
  53. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/pipeline/__init__.py +0 -0
  54. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/pipeline/config.py +0 -0
  55. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/pipeline/pipeline.py +0 -0
  56. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/utils/__init__.py +0 -0
  57. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/utils/exceptions.py +0 -0
  58. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/utils/face_detection.py +0 -0
  59. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet/utils/video.py +0 -0
  60. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/SyncNetInstance.py +0 -0
  61. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/SyncNetModel.py +0 -0
  62. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python/__init__.py +0 -0
  63. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python/cli.py +0 -0
  64. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/detectors/__init__.py +0 -0
  65. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/detectors/s3fd/__init__.py +0 -0
  66. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/detectors/s3fd/box_utils.py +0 -0
  67. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/detectors/s3fd/nets.py +0 -0
  68. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/run_syncnet_pipeline_on_1example.py +0 -0
  69. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/run_syncnet_pipeline_on_mocha_generation_on_mocha_bench.py +0 -0
  70. {syncnet_python-0.1.1/script → syncnet_python-0.2.1/syncnet_python}/run_syncnet_pipeline_on_your_own_model_results.py +0 -0
  71. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/dependency_links.txt +0 -0
  72. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/entry_points.txt +0 -0
  73. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/requires.txt +0 -0
  74. {syncnet_python-0.1.1 → syncnet_python-0.2.1}/syncnet_python.egg-info/top_level.txt +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Prerequisites
4
4
 
5
- - Python 3.13 or higher
5
+ - Python 3.9 or higher
6
6
  - CUDA-capable GPU (optional, but recommended)
7
7
  - FFmpeg
8
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncnet-python
3
- Version: 0.1.1
3
+ Version: 0.2.1
4
4
  Summary: SyncNet: Audio-visual synchronization detection using deep learning. Updated version of https://github.com/joonson/syncnet_python for modern Python versions.
5
5
  Author: SyncNet Python Contributors
6
6
  Maintainer: SyncNet Python Contributors
@@ -47,9 +47,14 @@ Dynamic: license-file
47
47
 
48
48
  # SyncNet Python
49
49
 
50
- Audio-visual synchronization detection using deep learning.
50
+ [![PyPI version](https://badge.fury.io/py/syncnet-python.svg)](https://badge.fury.io/py/syncnet-python)
51
+ [![Python](https://img.shields.io/pypi/pyversions/syncnet-python.svg)](https://pypi.org/project/syncnet-python/)
52
+ [![Downloads](https://pepy.tech/badge/syncnet-python)](https://pepy.tech/project/syncnet-python)
53
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
54
 
52
- This is an updated version of the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung, compatible with modern Python versions (3.9+).
55
+ Audio-visual synchronization detection using deep learning with modern Python architecture.
56
+
57
+ This is a **refactored and enhanced version** of the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung, updated for Python 3.9+ with clean architecture, comprehensive error handling, and performance optimizations.
53
58
 
54
59
  ## Overview
55
60
 
@@ -57,11 +62,20 @@ SyncNet Python is a PyTorch implementation of the SyncNet model, which detects a
57
62
 
58
63
  ## Features
59
64
 
65
+ ### Core Functionality
60
66
  - 🎥 **Audio-Visual Sync Detection**: Accurately detect synchronization between audio and video
61
67
  - 🔍 **Face Detection**: Automatic face detection and tracking using S3FD
68
+ - 📊 **Detailed Analysis**: Per-crop offsets, confidence scores, and minimum distances
62
69
  - 🚀 **Batch Processing**: Process multiple videos efficiently
63
- - 🐍 **Python API**: Easy-to-use Python interface
64
- - 📊 **Confidence Scores**: Get confidence metrics for sync quality
70
+ - 🐍 **Python API**: Easy-to-use Python interface with proper error handling
71
+
72
+ ### Architecture Improvements
73
+ - 🏗️ **Clean Architecture**: Abstract base classes and factory patterns
74
+ - ⚡ **Performance Optimized**: Parallel processing and memory management
75
+ - 🛡️ **Robust Error Handling**: Comprehensive exception hierarchy
76
+ - ⚙️ **Configuration Management**: YAML/JSON configuration support
77
+ - 📝 **Advanced Logging**: Structured logging with progress tracking
78
+ - 🔄 **Backward Compatibility**: Maintains compatibility with original API
65
79
 
66
80
  ## Installation
67
81
 
@@ -102,10 +116,30 @@ results = pipeline.inference(
102
116
  audio_path=None # Extract from video
103
117
  )
104
118
 
105
- # Get results
106
- offset, confidence = results['offset'], results['confidence']
119
+ # Extract results (returns tuple)
120
+ offset_list, confidence_list, min_dist_list, best_confidence, best_min_dist, detections_json, success = results
121
+
122
+ # Get best results
123
+ offset = offset_list[0] # AV offset in frames
124
+ confidence = confidence_list[0] # Confidence score
125
+ min_distance = min_dist_list[0] # Minimum distance
126
+
107
127
  print(f"AV Offset: {offset} frames")
108
128
  print(f"Confidence: {confidence:.3f}")
129
+ print(f"Min Distance: {min_distance:.3f}")
130
+ ```
131
+
132
+ ### Detailed Analysis
133
+
134
+ ```python
135
+ # For detailed per-crop analysis
136
+ for i, (offset, conf, dist) in enumerate(zip(offset_list, confidence_list, min_dist_list)):
137
+ print(f"Crop {i+1}: offset={offset}, confidence={conf:.3f}, min_dist={dist:.3f}")
138
+
139
+ # Parse face detections
140
+ import json
141
+ detections = json.loads(detections_json)
142
+ print(f"Total frames with face detection: {len(detections)}")
109
143
  ```
110
144
 
111
145
  ## Command Line Usage
@@ -121,16 +155,43 @@ syncnet-python video1.mp4 video2.mp4 --output results.json
121
155
  syncnet-python video.mp4 --device cpu
122
156
  ```
123
157
 
158
+ ## Performance
159
+
160
+ Tested with example files:
161
+ - **Processing Speed**: 191.4 fps
162
+ - **Face Detection**: 100% success rate
163
+ - **Accuracy**: Detects 1-frame offsets with high confidence (4.5+)
164
+ - **Compute Time**: ~0.65 seconds for 134 frames
165
+
166
+ ## Architecture
167
+
168
+ ### Refactored Core Modules
169
+ - `syncnet/core/` - Modern refactored implementation
170
+ - `base.py` - Abstract base classes and interfaces
171
+ - `models.py` - Enhanced SyncNet model with factory pattern
172
+ - `audio.py` - MFCC audio processing with streaming support
173
+ - `video.py` - Parallel video processing with OpenCV
174
+ - `sync_analyzer.py` - Optimized sync analysis with caching
175
+ - `config.py` - Configuration management system
176
+ - `exceptions.py` - Comprehensive error handling
177
+ - `logging.py` - Advanced logging with progress tracking
178
+ - `utils.py` - Memory management and utility functions
179
+
180
+ ### Legacy Compatibility
181
+ - `syncnet_python/` - Maintains original API compatibility
182
+ - Full backward compatibility with existing code
183
+
124
184
  ## Requirements
125
185
 
126
- - Python 3.9+
186
+ - Python 3.9+ (tested on 3.13)
127
187
  - PyTorch 2.0+
128
188
  - CUDA (optional but recommended)
129
189
  - FFmpeg
190
+ - Additional dependencies: OpenCV, SciPy, NumPy, pandas
130
191
 
131
192
  ## Credits
132
193
 
133
- This package is based on the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung.
194
+ This package is based on the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung, enhanced with modern Python architecture and performance optimizations.
134
195
 
135
196
  ## Citation
136
197
 
@@ -0,0 +1,170 @@
1
+ # SyncNet Python
2
+
3
+ [![PyPI version](https://badge.fury.io/py/syncnet-python.svg)](https://badge.fury.io/py/syncnet-python)
4
+ [![Python](https://img.shields.io/pypi/pyversions/syncnet-python.svg)](https://pypi.org/project/syncnet-python/)
5
+ [![Downloads](https://pepy.tech/badge/syncnet-python)](https://pepy.tech/project/syncnet-python)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ Audio-visual synchronization detection using deep learning with modern Python architecture.
9
+
10
+ This is a **refactored and enhanced version** of the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung, updated for Python 3.9+ with clean architecture, comprehensive error handling, and performance optimizations.
11
+
12
+ ## Overview
13
+
14
+ SyncNet Python is a PyTorch implementation of the SyncNet model, which detects audio-visual synchronization in videos. It can identify lip-sync errors by analyzing the correspondence between mouth movements and spoken audio.
15
+
16
+ ## Features
17
+
18
+ ### Core Functionality
19
+ - 🎥 **Audio-Visual Sync Detection**: Accurately detect synchronization between audio and video
20
+ - 🔍 **Face Detection**: Automatic face detection and tracking using S3FD
21
+ - 📊 **Detailed Analysis**: Per-crop offsets, confidence scores, and minimum distances
22
+ - 🚀 **Batch Processing**: Process multiple videos efficiently
23
+ - 🐍 **Python API**: Easy-to-use Python interface with proper error handling
24
+
25
+ ### Architecture Improvements
26
+ - 🏗️ **Clean Architecture**: Abstract base classes and factory patterns
27
+ - ⚡ **Performance Optimized**: Parallel processing and memory management
28
+ - 🛡️ **Robust Error Handling**: Comprehensive exception hierarchy
29
+ - ⚙️ **Configuration Management**: YAML/JSON configuration support
30
+ - 📝 **Advanced Logging**: Structured logging with progress tracking
31
+ - 🔄 **Backward Compatibility**: Maintains compatibility with original API
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install syncnet-python
37
+ ```
38
+
39
+ ### Additional Requirements
40
+
41
+ 1. **FFmpeg**: Required for video processing
42
+ ```bash
43
+ # Ubuntu/Debian
44
+ sudo apt-get install ffmpeg
45
+
46
+ # macOS
47
+ brew install ffmpeg
48
+ ```
49
+
50
+ 2. **Model Weights**: Download pre-trained weights
51
+ - Download `sfd_face.pth` and `syncnet_v2.model`
52
+ - Place them in a `weights/` directory
53
+
54
+ ## Quick Start
55
+
56
+ ```python
57
+ from syncnet_python import SyncNetPipeline
58
+
59
+ # Initialize pipeline
60
+ pipeline = SyncNetPipeline(
61
+ s3fd_weights="weights/sfd_face.pth",
62
+ syncnet_weights="weights/syncnet_v2.model",
63
+ device="cuda" # or "cpu"
64
+ )
65
+
66
+ # Process video
67
+ results = pipeline.inference(
68
+ video_path="video.mp4",
69
+ audio_path=None # Extract from video
70
+ )
71
+
72
+ # Extract results (returns tuple)
73
+ offset_list, confidence_list, min_dist_list, best_confidence, best_min_dist, detections_json, success = results
74
+
75
+ # Get best results
76
+ offset = offset_list[0] # AV offset in frames
77
+ confidence = confidence_list[0] # Confidence score
78
+ min_distance = min_dist_list[0] # Minimum distance
79
+
80
+ print(f"AV Offset: {offset} frames")
81
+ print(f"Confidence: {confidence:.3f}")
82
+ print(f"Min Distance: {min_distance:.3f}")
83
+ ```
84
+
85
+ ### Detailed Analysis
86
+
87
+ ```python
88
+ # For detailed per-crop analysis
89
+ for i, (offset, conf, dist) in enumerate(zip(offset_list, confidence_list, min_dist_list)):
90
+ print(f"Crop {i+1}: offset={offset}, confidence={conf:.3f}, min_dist={dist:.3f}")
91
+
92
+ # Parse face detections
93
+ import json
94
+ detections = json.loads(detections_json)
95
+ print(f"Total frames with face detection: {len(detections)}")
96
+ ```
97
+
98
+ ## Command Line Usage
99
+
100
+ ```bash
101
+ # Process single video
102
+ syncnet-python video.mp4
103
+
104
+ # Process multiple videos
105
+ syncnet-python video1.mp4 video2.mp4 --output results.json
106
+
107
+ # Use CPU instead of GPU
108
+ syncnet-python video.mp4 --device cpu
109
+ ```
110
+
111
+ ## Performance
112
+
113
+ Tested with example files:
114
+ - **Processing Speed**: 191.4 fps
115
+ - **Face Detection**: 100% success rate
116
+ - **Accuracy**: Detects 1-frame offsets with high confidence (4.5+)
117
+ - **Compute Time**: ~0.65 seconds for 134 frames
118
+
119
+ ## Architecture
120
+
121
+ ### Refactored Core Modules
122
+ - `syncnet/core/` - Modern refactored implementation
123
+ - `base.py` - Abstract base classes and interfaces
124
+ - `models.py` - Enhanced SyncNet model with factory pattern
125
+ - `audio.py` - MFCC audio processing with streaming support
126
+ - `video.py` - Parallel video processing with OpenCV
127
+ - `sync_analyzer.py` - Optimized sync analysis with caching
128
+ - `config.py` - Configuration management system
129
+ - `exceptions.py` - Comprehensive error handling
130
+ - `logging.py` - Advanced logging with progress tracking
131
+ - `utils.py` - Memory management and utility functions
132
+
133
+ ### Legacy Compatibility
134
+ - `syncnet_python/` - Maintains original API compatibility
135
+ - Full backward compatibility with existing code
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.9+ (tested on 3.13)
140
+ - PyTorch 2.0+
141
+ - CUDA (optional but recommended)
142
+ - FFmpeg
143
+ - Additional dependencies: OpenCV, SciPy, NumPy, pandas
144
+
145
+ ## Credits
146
+
147
+ This package is based on the original [SyncNet implementation](https://github.com/joonson/syncnet_python) by Joon Son Chung, enhanced with modern Python architecture and performance optimizations.
148
+
149
+ ## Citation
150
+
151
+ If you use this code in your research, please cite the original paper:
152
+
153
+ ```bibtex
154
+ @inproceedings{chung2016out,
155
+ title={Out of time: automated lip sync in the wild},
156
+ author={Chung, Joon Son and Zisserman, Andrew},
157
+ booktitle={Asian Conference on Computer Vision},
158
+ year={2016}
159
+ }
160
+ ```
161
+
162
+ ## License
163
+
164
+ MIT License - see LICENSE file for details.
165
+
166
+ ## Links
167
+
168
+ - GitHub: https://github.com/yourusername/syncnet-python
169
+ - Documentation: https://syncnet-python.readthedocs.io
170
+ - Issues: https://github.com/yourusername/syncnet-python/issues
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "syncnet-python"
7
- version = "0.1.1"
7
+ version = "0.2.1"
8
8
  description = "SyncNet: Audio-visual synchronization detection using deep learning. Updated version of https://github.com/joonson/syncnet_python for modern Python versions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -0,0 +1,11 @@
1
+ torch>=2.0.0
2
+ torchvision>=0.15.0
3
+ numpy>=1.24.0
4
+ scipy>=1.10.0
5
+ pandas>=2.0.0
6
+ scenedetect[opencv]>=0.6.0
7
+ opencv-contrib-python>=4.8.0
8
+ python-speech-features>=0.6
9
+ ffmpeg-python>=0.2.0
10
+ pyyaml>=6.0
11
+ psutil>=5.9.0
@@ -0,0 +1,208 @@
1
+ """Core components for SyncNet.
2
+
3
+ This module provides the refactored, modern implementation of SyncNet
4
+ with clean architecture, proper error handling, and optimizations.
5
+ """
6
+
7
+ # Base classes and interfaces
8
+ from .base import (
9
+ BaseModel,
10
+ AudioEncoder,
11
+ VisualEncoder,
12
+ AVSyncModel,
13
+ FaceDetector,
14
+ AudioProcessor,
15
+ VideoProcessor,
16
+ SyncAnalyzer,
17
+ ModelFactory,
18
+ Pipeline,
19
+ )
20
+
21
+ # Configuration
22
+ from .config import (
23
+ ModelConfig,
24
+ FaceDetectorConfig,
25
+ AudioConfig,
26
+ VideoConfig,
27
+ SyncConfig,
28
+ PipelineConfig,
29
+ load_config,
30
+ save_config,
31
+ )
32
+
33
+ # Exceptions
34
+ from .exceptions import (
35
+ SyncNetError,
36
+ ModelError,
37
+ ModelLoadError,
38
+ ProcessingError,
39
+ VideoProcessingError,
40
+ AudioProcessingError,
41
+ FaceDetectionError,
42
+ ValidationError,
43
+ ConfigurationError,
44
+ )
45
+
46
+ # Type definitions
47
+ from .types import (
48
+ BBox,
49
+ Frame,
50
+ AudioData,
51
+ MFCCFeatures,
52
+ Detection,
53
+ Track,
54
+ SyncResult,
55
+ PipelineResult,
56
+ )
57
+
58
+ # Models
59
+ from .models import (
60
+ SyncNetModel,
61
+ SyncNetModelFactory,
62
+ create_syncnet_model,
63
+ load_syncnet_model,
64
+ )
65
+
66
+ # Audio processing
67
+ from .audio import (
68
+ MFCCAudioProcessor,
69
+ StreamingAudioProcessor,
70
+ create_audio_processor,
71
+ )
72
+
73
+ # Video processing
74
+ from .video import (
75
+ OpenCVVideoProcessor,
76
+ ParallelVideoProcessor,
77
+ create_video_processor,
78
+ )
79
+
80
+ # Synchronization analysis
81
+ from .sync_analyzer import (
82
+ SlidingWindowAnalyzer,
83
+ OptimizedSyncAnalyzer,
84
+ CachedSyncAnalyzer,
85
+ create_sync_analyzer,
86
+ )
87
+
88
+ # Utilities
89
+ from .utils import (
90
+ torch_memory_manager,
91
+ get_memory_usage,
92
+ ensure_tensor,
93
+ batch_iterator,
94
+ Timer,
95
+ validate_video_path,
96
+ validate_audio_path,
97
+ compute_confidence,
98
+ )
99
+
100
+ # Logging
101
+ from .logging import (
102
+ get_logger,
103
+ LoggerManager,
104
+ ProgressLogger,
105
+ )
106
+
107
+ # Legacy compatibility
108
+ from .compat import (
109
+ load_legacy_model,
110
+ convert_legacy_config,
111
+ )
112
+
113
+ # Keep backward compatibility
114
+ from .inference import SyncNetInstance, InferenceConfig
115
+ from .models import save_model, load_model
116
+
117
+
118
+ __all__ = [
119
+ # Base classes
120
+ "BaseModel",
121
+ "AudioEncoder",
122
+ "VisualEncoder",
123
+ "AVSyncModel",
124
+ "FaceDetector",
125
+ "AudioProcessor",
126
+ "VideoProcessor",
127
+ "SyncAnalyzer",
128
+ "ModelFactory",
129
+ "Pipeline",
130
+
131
+ # Configuration
132
+ "ModelConfig",
133
+ "FaceDetectorConfig",
134
+ "AudioConfig",
135
+ "VideoConfig",
136
+ "SyncConfig",
137
+ "PipelineConfig",
138
+ "load_config",
139
+ "save_config",
140
+
141
+ # Exceptions
142
+ "SyncNetError",
143
+ "ModelError",
144
+ "ModelLoadError",
145
+ "ProcessingError",
146
+ "VideoProcessingError",
147
+ "AudioProcessingError",
148
+ "FaceDetectionError",
149
+ "ValidationError",
150
+ "ConfigurationError",
151
+
152
+ # Types
153
+ "BBox",
154
+ "Frame",
155
+ "AudioData",
156
+ "MFCCFeatures",
157
+ "Detection",
158
+ "Track",
159
+ "SyncResult",
160
+ "PipelineResult",
161
+
162
+ # Models
163
+ "SyncNetModel",
164
+ "SyncNetModelFactory",
165
+ "create_syncnet_model",
166
+ "load_syncnet_model",
167
+ "save_model",
168
+ "load_model",
169
+
170
+ # Processors
171
+ "MFCCAudioProcessor",
172
+ "StreamingAudioProcessor",
173
+ "create_audio_processor",
174
+ "OpenCVVideoProcessor",
175
+ "ParallelVideoProcessor",
176
+ "create_video_processor",
177
+
178
+ # Analyzers
179
+ "SlidingWindowAnalyzer",
180
+ "OptimizedSyncAnalyzer",
181
+ "CachedSyncAnalyzer",
182
+ "create_sync_analyzer",
183
+
184
+ # Utilities
185
+ "torch_memory_manager",
186
+ "get_memory_usage",
187
+ "ensure_tensor",
188
+ "batch_iterator",
189
+ "Timer",
190
+ "validate_video_path",
191
+ "validate_audio_path",
192
+ "compute_confidence",
193
+
194
+ # Logging
195
+ "get_logger",
196
+ "LoggerManager",
197
+ "ProgressLogger",
198
+
199
+ # Compatibility
200
+ "load_legacy_model",
201
+ "convert_legacy_config",
202
+ "SyncNetInstance",
203
+ "InferenceConfig",
204
+ ]
205
+
206
+
207
+ # Package version
208
+ __version__ = "0.1.1"