czyoung commited on
Commit
c16308c
·
verified ·
1 Parent(s): 6d71669

Add device change methods

Browse files
Files changed (1) hide show
  1. sonogram.py +9 -1
sonogram.py CHANGED
@@ -219,4 +219,12 @@ class Sonogram():
219
  def __call__(self,audioPath):
220
  annotation, totalTimeInSeconds, waveform, sampleRate = self.processFile(audioPath)
221
 
222
- return annotation, totalTimeInSeconds, waveform, sampleRate
 
 
 
 
 
 
 
 
 
219
  def __call__(self,audioPath):
220
  annotation, totalTimeInSeconds, waveform, sampleRate = self.processFile(audioPath)
221
 
222
+ return annotation, totalTimeInSeconds, waveform, sampleRate
223
+
224
+ def toDevice():
225
+ self.pipeline.to(self.device)
226
+ print(f"Sonogram moved to {self.device}")
227
+
228
+ def toCPU():
229
+ self.pipeline.to('cpu')
230
+ print(f"Sonogram moved to CPU")