Feature Extraction
Transformers
Safetensors
sheetsage2
audio
music
music-transcription
midi
abc-notation
custom_code
Instructions to use TechnoBaptist/SheetSage2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TechnoBaptist/SheetSage2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="TechnoBaptist/SheetSage2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TechnoBaptist/SheetSage2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| """Render existing SheetSage2 MIDI and ABC outputs without loading a model.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import sys | |
| SCRIPT_DIR = Path(__file__).absolute().parent | |
| sys.path.insert(0, str(SCRIPT_DIR)) | |
| from rendering_sheetsage2 import render_outputs | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--input", help="Transcription output directory.") | |
| parser.add_argument("--midi", help="MIDI file with original note timing.") | |
| parser.add_argument("--abc", help="ABC score file.") | |
| parser.add_argument("--output", help="Output directory; defaults to --input or rendered/.") | |
| parser.add_argument("--audio", action="store_true", help="Render piano WAV.") | |
| parser.add_argument("--score", default="", help="Comma-separated pdf,svg,png.") | |
| parser.add_argument("--parts", default="mix", help="Comma-separated mix,melody,vocal,instrumental,chords, or all (audio only).") | |
| parser.add_argument("--duration", type=float, help="Minimum audio duration in seconds; preserves trailing silence.") | |
| args = parser.parse_args() | |
| audio = args.audio | |
| score = args.score | |
| if not audio and not score: | |
| if args.input: | |
| audio, score = True, "pdf" | |
| else: | |
| audio, score = bool(args.midi), "pdf" if args.abc else "" | |
| if not args.input and not args.midi and not args.abc: | |
| parser.error("Provide --input, --midi, or --abc.") | |
| try: | |
| result = render_outputs(args.input, midi=args.midi, abc=args.abc, | |
| output_dir=args.output, audio=audio, score=score, | |
| parts=args.parts, duration=args.duration) | |
| except (ValueError, OSError, RuntimeError) as exc: | |
| print(f"Rendering failed: {exc}", file=sys.stderr) | |
| return 1 | |
| print(json.dumps(result, indent=2)) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |