Giter Site home page Giter Site logo

Comments (4)

hayabhay avatar hayabhay commented on August 23, 2024 2

Apologies for the delay. This is now implemented. Each audio file is saved locally and transcriptions on all formats are saved to the same directory (#13)

from frogbase.

hayabhay avatar hayabhay commented on August 23, 2024 1

Yup! That should be doable! I'll be releasing a big update in the next few days and will add this in :)

from frogbase.

TyCooper2010 avatar TyCooper2010 commented on August 23, 2024

Any update on this? I didn't see the option available (but then again, I'm a noob and my "Instructions" page is broken due to some operator error, lol). I'd love to be able to export SRT captions straight from this awesome app!

from frogbase.

dorjeduck avatar dorjeduck commented on August 23, 2024

I was just looking for the exactly same feature and as it seems not yet included I just added it to the file transcribe.py as follows (just elaborating on the answer by Cate9021 so that it works with the current version)

on the top of transcribe.py add the following two imports

    import os 
    from whisper.utils import write_srt,write_vtt,write_txt

and in the method def transcribe add

    self.text = self.raw_output["text"]
    self.language = self.raw_output["language"]
    self.segments = self.raw_output["segments"]
    
    ## -----------new code start

    transcript_basename = self.name + '__' + whisper_model  

    # save TXT
    with open(os.path.join(self.save_dir, transcript_basename + ".txt"), "w", encoding="utf-8") as txt:
        write_txt(self.segments, file=txt)

    # save VTT
    with open(os.path.join(self.save_dir, transcript_basename + ".vtt"), "w", encoding="utf-8") as vtt:
        write_vtt(self.segments, file=vtt)

    # save SRT
    with open(os.path.join(self.save_dir, transcript_basename + ".srt"), "w", encoding="utf-8") as srt:
        write_srt(self.segments, file=srt)
  
    ## -----------new code end

    # Remove token ids from the output
    for segment in self.segments:
        del segment["tokens"]

This creates the transcript files in the folder local/[Audio/Video Name] when you are transcribing an audio/video. The variable transcript_basename sets the file name which you might want to change according to your preferences (i added the model name as i am evaluating the different models right now)

from frogbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.