Media Reporting

This example demonstrates reporting (uploading) audio and video media, from a source by URL (already uploaded to some location), or in a local file. Trains reports these HTML debug samples in the Trains Web (UI), experiment details, RESULTS tab, DEBUG SAMPLES sub-tab. When the script runs, it creates an experiment named audio and video reporting, which is associated with the examples project.

Report by calling the Logger.report_media method and specify the media using one of the following parameters:

  • local_path - Image file.
  • stream and file_extension - BytesIO stream.
  • url - A URL for the location of a pre-uploaded image.

Reporting (uploading) media from a source by URL

Report by calling the Logger.report_media method using the url parameter.

# report video, an already uploaded video media (url)
    'video', 'big bunny', iteration=1,

#  report audio, report an already uploaded audio media (url)
    'audio', 'pink panther', iteration=1,

Reporting (uploading) media from a local file

Use the local_path parameter.

#  report audio, report local media audio file
    'audio', 'tada', iteration=1,
    local_path=os.path.join('data_samples', 'sample.mp3'))