Update export_all.py to include PEAFrame and CLAP exports
Browse files- onnx_export/export_all.py +30 -2
onnx_export/export_all.py
CHANGED
|
@@ -7,6 +7,10 @@ This script exports:
|
|
| 7 |
2. T5 text encoder
|
| 8 |
3. DiT transformer (single-step for ODE solving)
|
| 9 |
4. Vision encoder (CLIP-based, for video-guided separation)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
python -m onnx_export.export_all --output-dir onnx_models --verify
|
| 11 |
"""
|
| 12 |
|
|
@@ -66,7 +70,17 @@ def main():
|
|
| 66 |
action="store_true",
|
| 67 |
help="Skip Vision encoder export",
|
| 68 |
)
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
args = parser.parse_args()
|
| 71 |
|
| 72 |
os.makedirs(args.output_dir, exist_ok=True)
|
|
@@ -98,7 +112,21 @@ def main():
|
|
| 98 |
if not args.skip_vision:
|
| 99 |
export_args = ["--output", args.output_dir, "--model", args.model]
|
| 100 |
results["Vision"] = run_export("onnx_export.export_vision", export_args)
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
# Print summary
|
| 103 |
print(f"\n{'='*60}")
|
| 104 |
print("Export Summary")
|
|
|
|
| 7 |
2. T5 text encoder
|
| 8 |
3. DiT transformer (single-step for ODE solving)
|
| 9 |
4. Vision encoder (CLIP-based, for video-guided separation)
|
| 10 |
+
5. PEAFrame span predictor (audio-text similarity for span detection)
|
| 11 |
+
6. CLAP reranker (audio-text similarity for candidate selection)
|
| 12 |
+
|
| 13 |
+
Usage:
|
| 14 |
python -m onnx_export.export_all --output-dir onnx_models --verify
|
| 15 |
"""
|
| 16 |
|
|
|
|
| 70 |
action="store_true",
|
| 71 |
help="Skip Vision encoder export",
|
| 72 |
)
|
| 73 |
+
parser.add_argument(
|
| 74 |
+
"--skip-peaframe",
|
| 75 |
+
action="store_true",
|
| 76 |
+
help="Skip PEAFrame export",
|
| 77 |
+
)
|
| 78 |
+
parser.add_argument(
|
| 79 |
+
"--skip-clap",
|
| 80 |
+
action="store_true",
|
| 81 |
+
help="Skip CLAP export",
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
args = parser.parse_args()
|
| 85 |
|
| 86 |
os.makedirs(args.output_dir, exist_ok=True)
|
|
|
|
| 112 |
if not args.skip_vision:
|
| 113 |
export_args = ["--output", args.output_dir, "--model", args.model]
|
| 114 |
results["Vision"] = run_export("onnx_export.export_vision", export_args)
|
| 115 |
+
|
| 116 |
+
# Export PEAFrame
|
| 117 |
+
if not args.skip_peaframe:
|
| 118 |
+
export_args = ["--output-dir", args.output_dir]
|
| 119 |
+
if args.verify:
|
| 120 |
+
export_args.append("--verify")
|
| 121 |
+
results["PEAFrame"] = run_export("onnx_export.export_peaframe", export_args)
|
| 122 |
+
|
| 123 |
+
# Export CLAP
|
| 124 |
+
if not args.skip_clap:
|
| 125 |
+
export_args = ["--output-dir", args.output_dir]
|
| 126 |
+
if args.verify:
|
| 127 |
+
export_args.append("--verify")
|
| 128 |
+
results["CLAP"] = run_export("onnx_export.export_clap", export_args)
|
| 129 |
+
|
| 130 |
# Print summary
|
| 131 |
print(f"\n{'='*60}")
|
| 132 |
print("Export Summary")
|