Compare commits

10 Commits

Author SHA1 Message Date
Kristofer Söderström 7799d03960 bug fixes 2023-11-06 09:31:53 +01:00
Kristofer Rolf Söderström f88186dacc Update app.py 2023-10-19 09:26:43 +02:00
Kristofer Rolf Söderström 3f5c1491ac Delete build.zip 2023-10-19 09:20:55 +02:00
Kristofer Rolf Söderström c83e15bdba Update README.md 2023-10-19 09:20:29 +02:00
Kristofer Rolf Söderström ff16ad30e1 Merge pull request #2 from ValentinFunk/patch-1
Fix mac instructions link
2023-10-19 09:09:01 +02:00
Valentin 622165b3e6 Update Mac_instructions.md 2023-09-08 10:11:02 +02:00
Valentin 0e9cbdca58 Fix mac instructions link 2023-09-08 10:09:15 +02:00
Kristofer Söderström 87cb509b14 added windows exe in as zip 2023-06-30 17:26:24 +02:00
Kristofer Söderström ba935cafb7 formatting 2023-06-30 16:32:37 +02:00
Kristofer Söderström 6497508b7a fix formatting 2023-06-30 16:23:07 +02:00
5 changed files with 15 additions and 26 deletions
+1
View File
@@ -0,0 +1 @@
*.zip filter=lfs diff=lfs merge=lfs -text
+1 -1
View File
@@ -5,5 +5,5 @@ Unfortunately, I have not found a permament solution for this, not being a Mac u
1. You can also right-click (or equivalent) on the root folder to open a Terminal within the folder. 1. You can also right-click (or equivalent) on the root folder to open a Terminal within the folder.
2. Run the following command: 2. Run the following command:
``` ```
python main.py python app.py
``` ```
+4 -11
View File
@@ -8,7 +8,6 @@ Local Transcribe with Whisper is a user-friendly desktop application that allows
3. Model selection: Now a dropdown option that includes most models for typical use. 3. Model selection: Now a dropdown option that includes most models for typical use.
2. New and improved GUI. 2. New and improved GUI.
![python GUI.py](images/gui-windows.png) ![python GUI.py](images/gui-windows.png)
3. Executable: On Windows and don't want to install python? Try the Exe file! See below for instructions (Experimental)
## Features ## Features
* Select the folder containing the audio or video files you want to transcribe. Tested with m4a video. * Select the folder containing the audio or video files you want to transcribe. Tested with m4a video.
@@ -22,17 +21,11 @@ Local Transcribe with Whisper is a user-friendly desktop application that allows
## Installation ## Installation
### Get the files ### Get the files
Download the zip folder and extract it to your preferred working folder. Download the zip folder and extract it to your preferred working folder.
![](Picture1.png) ![](images/Picture1.png)
Or by cloning the repository with: Or by cloning the repository with:
``` ```
git clone https://github.com/soderstromkr/transcribe.git git clone https://github.com/soderstromkr/transcribe.git
``` ```
### Executable Version **(Experimental. Windows only)**
The executable version of Local Transcribe with Whisper is a standalone program and should work out of the box. This experimental version is available if you have Windows, and do not have (or don't want to install) python and additional dependencies. However, it requires more disk space (around 1Gb), has no GPU acceleration and has only been lightly tested for bugs, etc. Let me know if you run into any issues!
1. Download the project folder. As the image above shows.
2. Navigate to build.
3. Unzip the folder (get a coffee or a tea, this might take a while depending on your computer)
3. Run the executable (app.exe) file.
### Python Version **(any platform including Mac users)** ### Python Version **(any platform including Mac users)**
This is recommended if you don't have Windows. Have Windows and use python, or want to use GPU acceleration (Pytorch and Cuda) for faster transcriptions. I would generally recommend this method anyway, but I can understand not everyone wants to go through the installation process for Python, Anaconda and the other required packages. This is recommended if you don't have Windows. Have Windows and use python, or want to use GPU acceleration (Pytorch and Cuda) for faster transcriptions. I would generally recommend this method anyway, but I can understand not everyone wants to go through the installation process for Python, Anaconda and the other required packages.
1. This script was made and tested in an Anaconda environment with Python 3.10. I recommend this method if you're not familiar with Python. 1. This script was made and tested in an Anaconda environment with Python 3.10. I recommend this method if you're not familiar with Python.
@@ -46,9 +39,9 @@ conda install -c conda-forge ffmpeg-python
``` ```
pip install -U openai-whisper pip install -U openai-whisper
``` ```
4. To run the app built on TKinter and TTKthemes. If using these options, make sure they are installed in your Python build. You can install them via pip. 4. To run the app built on TKinter and TTKthemes. If using these options, make sure they are installed in your Python build. You can install them and colorama via pip.
``` ```
pip install tkinter pip install colorama
``` ```
and and
``` ```
@@ -56,7 +49,7 @@ pip install customtkinter
``` ```
5. Run the app: 5. Run the app:
1. For **Windows**: In the same folder as the *app.py* file, run the app from terminal by running ```python app.py``` or with the batch file called run_Windows.bat (for Windows users), which assumes you have conda installed and in the base environment (This is for simplicity, but users are usually adviced to create an environment, see [here](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) for more info) just make sure you have the correct environment (right click on the file and press edit to make any changes). If you want to download a model first, and then go offline for transcription, I recommend running the model with the default sample folder, which will download the model locally. 1. For **Windows**: In the same folder as the *app.py* file, run the app from terminal by running ```python app.py``` or with the batch file called run_Windows.bat (for Windows users), which assumes you have conda installed and in the base environment (This is for simplicity, but users are usually adviced to create an environment, see [here](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) for more info) just make sure you have the correct environment (right click on the file and press edit to make any changes). If you want to download a model first, and then go offline for transcription, I recommend running the model with the default sample folder, which will download the model locally.
2. For **Mac**: Haven't figured out a better way to do this, see [the instructions here](Mac_instructions.txt) 2. For **Mac**: Haven't figured out a better way to do this, see [the instructions here](Mac_instructions.md)
## Usage ## Usage
1. When launched, the app will also open a terminal that shows some additional information. 1. When launched, the app will also open a terminal that shows some additional information.
2. Select the folder containing the audio or video files you want to transcribe by clicking the "Browse" button next to the "Folder" label. This will open a file dialog where you can navigate to the desired folder. Remember, you won't be choosing individual files but whole folders! 2. Select the folder containing the audio or video files you want to transcribe by clicking the "Browse" button next to the "Folder" label. This will open a file dialog where you can navigate to the desired folder. Remember, you won't be choosing individual files but whole folders!
+6 -11
View File
@@ -5,9 +5,10 @@ from tkinter import messagebox
from src._LocalTranscribe import transcribe, get_path from src._LocalTranscribe import transcribe, get_path
import customtkinter import customtkinter
import threading import threading
from colorama import Back, Fore from colorama import Back
import colorama import colorama
colorama.init(autoreset=True) colorama.init(autoreset=True)
import os
@@ -72,7 +73,8 @@ class App:
# Helper functions # Helper functions
# Browsing # Browsing
def browse(self): def browse(self):
folder_path = filedialog.askdirectory() initial_dir = os.getcwd()
folder_path = filedialog.askdirectory(initialdir=initial_dir)
self.path_entry.delete(0, tk.END) self.path_entry.delete(0, tk.END)
self.path_entry.insert(0, folder_path) self.path_entry.insert(0, folder_path)
# Start transcription # Start transcription
@@ -92,22 +94,15 @@ class App:
self.progress_bar.start() self.progress_bar.start()
# Setting path and files # Setting path and files
glob_file = get_path(path) glob_file = get_path(path)
info_path = 'I will transcribe all eligible audio/video files in the path: {}\n\nContinue?'.format(path) messagebox.showinfo("Message", "Starting transcription!")
answer = messagebox.askyesno("Confirmation", info_path)
if not answer:
self.progress_bar.stop()
self.progress_bar.pack_forget()
self.transcribe_button.configure(state=tk.NORMAL)
return
# Start transcription # Start transcription
error_language = 'https://github.com/openai/whisper#available-models-and-languages'
try: try:
output_text = transcribe(path, glob_file, model, language, verbose) output_text = transcribe(path, glob_file, model, language, verbose)
except UnboundLocalError: except UnboundLocalError:
messagebox.showinfo("Files not found error!", 'Nothing found, choose another folder.') messagebox.showinfo("Files not found error!", 'Nothing found, choose another folder.')
pass pass
except ValueError: except ValueError:
messagebox.showinfo("Language error!", 'See {} for supported languages'.format(error_language)) messagebox.showinfo("Invalid language name, you might have to clear the default text to continue!")
# Hide progress bar # Hide progress bar
self.progress_bar.stop() self.progress_bar.stop()
self.progress_bar.pack_forget() self.progress_bar.pack_forget()
Binary file not shown.