Skip to content

ralcant/urop_spring_transcribe

Repository files navigation

urop_spring_transcribe

Computes forced-alignment for processing videos given .csv files with their respective transcript.

Requirements

  1. moviepy (https://zulko.github.io/moviepy/install.html)
  2. aeneas (https://www.readbeyond.it/aeneas/docs/libtutorial.html#dependencies)

Setup

  1. Clone the repo by running git clone https://github.com/ralcant/urop_spring_transcribe.git
  2. cd urop_spring_transcribe
  3. Go to forced_alignment.py and see the bottom part, uncomment the line that says HELLO, UNCOMMENT ME :), and run python forced_alignment.py. This will create the directories you need to run this script. Now, go to the folder of the videos of 5s and download one of the folders (with all videos in it). For starters, you can try the first one, as that one worked well for me (Spoiler alert: not all of them did :( ).
  4. Once it downloads, unzip the folder and place it into the videos folder of the repo
  5. Now go to the drive of all the transcripts and download the csv file of THE SAME session you downloaded before.
  6. They HAVE to have the same name (the only difference is that one of them is a folder and the other is a .csv file). Are you sure they are t-h-e s-a-m-e?
  7. Totally sure? Okay, fine. Continue.
  8. Now we are all setup! (yayyyy)

Run the code

  1. Go to forced_alignment.py and comment the project.make_folders() line and uncomment the other 3 lines below.
  2. Before running, change the value of family_number, session_number and num_parts as needed.
  3. Run python forced_alignment.py and see magic happen in front of your eyes.

Problems

  1. As surprising as this might sound, this has a bug. It worked well for me for the first file but after that I get the error

numpy.core._exceptions.MemoryError: Unable to allocate array with shape (35430069,) and data type float64

aaaaand I personally don't know how to fix it, and trust me I've been trying. (insert sad face)

This is why I am coming to you.

Update

(April 30) The bug is fixed!

  1. I realized that the memory error I was getting days ago was because I was trying to work with the 5s video and process them to audio (all preprocessing stuff) AND do the forced alignment task at the same time. I guess this used too much memory and that's why my computer was constantly crying about it.
  2. This is why I did the whole process in two parts, first preprocessing and then do the forced alignment ... and now it worked!
  3. Yes, this means that the transcript division is not necessary anymore. However, you can technically divide it however you want if necessary (even tho I dont see why) just by setting a variable num_parts = 2,3, or 89 instead of 1.

To-do

  • Fix the bug commented above ^
  • Try to see if there is a way to avoid downloading all the videos, as this takes a lot of time
  • Try to see if maybe there is something different than aeneas that can help us do forced alignment?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages