Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit 8c91bd4

Browse files
time in osc app
1 parent 29beb6d commit 8c91bd4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pytorch-osc/pytorch-osc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import asyncio
99
import fire
10-
from notepredictor import PitchPredictor
10+
from notepredictor import NotePredictor
1111
from osc import OSC
1212

1313
def predictor_handler(address, *args):
@@ -19,14 +19,14 @@ def predictor_handler(address, *args):
1919
if(address[2] == "load"):
2020
print(f"/load {args}")
2121
global predictor
22-
predictor = PitchPredictor.from_checkpoint(*args)
22+
predictor = NotePredictor.from_checkpoint(*args)
2323
predictor.eval()
2424

2525
elif(address[2] == "predict"):
2626
print(f"/predict {args}")
2727
r = predictor.predict(*args) # sanity check args
2828
print(r)
29-
osc.send_message('/prediction', (r,))
29+
osc.send_message('/prediction', (r['pitch'], r['time']))
3030

3131
elif(address[2] == "reset"):
3232
print(f"/reset {args}")
@@ -60,7 +60,7 @@ def main(ip="127.0.0.1", send=57120, receive=9999, checkpoint=None):
6060
osc = OSC(ip, send, receive)
6161

6262
if checkpoint is not None:
63-
predictor = PitchPredictor.from_checkpoint(checkpoint)
63+
predictor = NotePredictor.from_checkpoint(checkpoint)
6464
predictor.eval()
6565

6666
asyncio.run(init_main())

0 commit comments

Comments
 (0)