Fixed tracing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-04 15:00:41 +02:00
parent 188a31508e
commit 977fc98ed2
3 changed files with 15 additions and 11 deletions

View File

@@ -84,11 +84,13 @@ class Classifier(object):
return predicted_class_name, labeled_predictions
def predict(self, wav_filename: str, span: opentracing.span.Span) -> Tuple[str, dict]:
with opentracing.tracer.start_span('createSpectrogram', child_of=span):
def predict(self, wav_filename: str) -> Tuple[str, dict]:
span = opentracing.tracer.scope_manager.active().span
with opentracing.tracer.start_active_span('createSpectrogram', child_of=span):
directory, _ = self.create_spectrogram(wav_filename)
with opentracing.tracer.start_span('runPredictor', child_of=span):
with opentracing.tracer.start_active_span('runPredictor', child_of=span):
result = self._run_predictor(directory)
shutil.rmtree(directory) # The image is no longer needed