chrisdonahue / sheetsage

Transcribe music into lead sheets!
https://chrisdonahue.com/sheetsage
Other
297 stars 65 forks source link

Dynamic chunking not implemented. #18

Open vaclavmuller opened 1 year ago

vaclavmuller commented 1 year ago

vboxuser@ubuntu22:~/sheetsage$ sudo ./sheetsage.sh Imanuel.m4a Copying input file Imanuel.m4a to container as ./output/input Running Sheet Sage via Docker with args: /sheetsage/output/input INFO:root:Loading audio from /sheetsage/output/input INFO:root:DETECTING_BEATS Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/sheetsage/sheetsage/infer.py", line 851, in tqdm=tqdm, File "/sheetsage/sheetsage/infer.py", line 673, in sheetsage legacy_behavior, File "/sheetsage/sheetsage/infer.py", line 338, in _split_into_chunks "Dynamic chunking not implemented. Try halving measures_per_chunk." NotImplementedError: Dynamic chunking not implemented. Try halving measures_per_chunk.

designzwang commented 1 year ago

@vaclavmuller Do you think that creating an issue by simply dumping error messages or one-liners will motivate the developer (or others) to jump in and help out? If I were the developer, I wouldn't. However, to help the developer dealing with the issue, or for others who read this, I recommend to 1) run sheetsage.sh without argument to see the lest of its accepted parameters and 2) use --measures_per_chunk 4 if you get the chunking error ( where halving the chunk size is mentioned) Regards Ulrich

vaclavmuller commented 1 year ago

Being a lazy user I tried to create a simple Python script - a simple GUI for the Sheet Sage.

` import tkinter as tk from tkinter import filedialog import subprocess

def run_script(): if url_radio_var.get() == 1: arg = filedialog.askopenfilename() else: arg = url_entry.get() if check_var.get() == 1: subprocess.call(["sudo", "./sheetsage.sh", "--measures_per_chunk", "4", arg]) else: subprocess.call(["sudo", "./sheetsage.sh", arg])

def on_url_entry_change(event): url_radio_button.select()

root = tk.Tk() root.title("Sheet Sage GUI")

url_radio_var = tk.IntVar(value=1) url_radio_button = tk.Radiobutton(root, text="Enter youtube video URL:", variable=url_radio_var, value=2) url_radio_button.pack()

url_entry = tk.Entry(root, width=50) url_entry.pack() url_entry.insert(0, "https://www.youtube.com/watch?v=") url_entry.bind('', on_url_entry_change)

file_radio_button = tk.Radiobutton(root, text="Select local file:", variable=url_radio_var, value=1) file_radio_button.pack()

check_var = tk.BooleanVar(value=False) check_button = tk.Checkbutton(root, text="4 measures per chunk", variable=check_var) check_button.pack()

button = tk.Button(root, text="Transcribe", command=run_script) button.pack()

root.mainloop()

`

ag108 commented 1 month ago

@vaclavmuller thanks! Very convenient! I really had to adjust the Tabs.

import tkinter as tk
from tkinter import filedialog
import subprocess

def run_script():
    if url_radio_var.get() == 1:
        arg = filedialog.askopenfilename()
    else:
        arg = url_entry.get()

    if check_var.get() == 1:
        subprocess.call(["sudo", "./sheetsage.sh", "--measures_per_chunk", "4", arg])
    else:
        subprocess.call(["sudo", "./sheetsage.sh", arg])

def on_url_entry_change(event):
    url_radio_button.select()

root = tk.Tk()
root.title("Sheet Sage GUI")

url_radio_var = tk.IntVar(value=1)

url_radio_button = tk.Radiobutton(root, text="Enter youtube video URL:", variable=url_radio_var, value=2)
url_radio_button.pack()

url_entry = tk.Entry(root, width=50)
url_entry.pack()
url_entry.insert(0, "https://www.youtube.com/watch?v=")
url_entry.bind('<FocusIn>', on_url_entry_change)  # Добавляем событие, если нужно

file_radio_button = tk.Radiobutton(root, text="Select local file:", variable=url_radio_var, value=1)
file_radio_button.pack()

check_var = tk.BooleanVar(value=False)
check_button = tk.Checkbutton(root, text="4 measures per chunk", variable=check_var)
check_button.pack()

button = tk.Button(root, text="Transcribe", command=run_script)
button.pack()

root.mainloop()