-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/kurianbenoy/Indic-Subtitler
- Loading branch information
Showing
10 changed files
with
256 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import whisperx | ||
|
||
device = "cuda" | ||
batch_size = 16 # reduce if low on GPU mem | ||
compute_type = "float16" # change to "int8" if low on GPU mem (may reduce accuracy) | ||
|
||
# 1. Transcribe with original whisper (batched) | ||
model = whisperx.load_model("large-v2", device, compute_type=compute_type) | ||
|
||
# save model to local path (optional) | ||
# model_dir = "/path/" | ||
# model = whisperx.load_model("large-v2", device, compute_type=compute_type, download_root=model_dir) | ||
|
||
audio = whisperx.load_audio( | ||
"Bishop Thomas Tharayil speaks about Dr Shashi Tharoor at Lourdes Forane Church Thiruvananthapuram.mp4" | ||
) # noqa | ||
result = model.transcribe(audio, batch_size=batch_size) | ||
print(result["segments"]) # before alignment | ||
|
||
# delete model if low on GPU resources | ||
# import gc; gc.collect(); torch.cuda.empty_cache(); del model | ||
|
||
# 2. Align whisper output | ||
model_a, metadata = whisperx.load_align_model( | ||
language_code=result["language"], device=device | ||
) | ||
result = whisperx.align( | ||
result["segments"], model_a, metadata, audio, device, return_char_alignments=False | ||
) | ||
|
||
print(result["segments"]) # after alignment | ||
|
||
# delete model if low on GPU resources | ||
# import gc; gc.collect(); torch.cuda.empty_cache(); del model_a | ||
|
||
# 3. Assign speaker labels | ||
# diarize_model = whisperx.DiarizationPipeline(use_auth_token=YOUR_HF_TOKEN, device=device) | ||
|
||
# add min/max number of speakers if known | ||
# diarize_segments = diarize_model(audio) | ||
# diarize_model(audio, min_speakers=min_speakers, max_speakers=max_speakers) | ||
|
||
# result = whisperx.assign_word_speakers(diarize_segments, result) | ||
# print(diarize_segments) | ||
# print(result["segments"]) # segments are now assigned speaker IDs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import { TEAM } from "@components/constants"; | ||
import { | ||
IconBrandGithub, | ||
IconBrandLinkedin, | ||
IconBrandTwitter, | ||
} from "@tabler/icons-react"; | ||
import Image from "next/image"; | ||
import React, { useEffect, useRef, useState } from "react"; | ||
|
||
export default function Gallery() { | ||
const carouselRef = useRef(null); | ||
const [activeIndex, setActiveIndex] = useState(0); | ||
|
||
useEffect(() => { | ||
const handleScroll = () => { | ||
const carousel = carouselRef.current; | ||
const scrollPosition = carousel.scrollTop; | ||
const itemHeight = carousel.clientHeight; | ||
const newIndex = Math.round(scrollPosition / itemHeight); | ||
setActiveIndex(newIndex); | ||
}; | ||
const carousel = carouselRef.current; | ||
carousel.addEventListener("scroll", handleScroll); | ||
|
||
return () => { | ||
carousel.removeEventListener("scroll", handleScroll); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<section className="hidden md:flex"> | ||
<div className="flex flex-col py-2 gap-2 self-center "> | ||
{[1, 2, 3].map((index) => ( | ||
<button | ||
key={index} | ||
className={`btn btn-xs ${ | ||
activeIndex === index - 1 ? "bg-blue-500" : "" | ||
}`} | ||
> | ||
{index} | ||
</button> | ||
))} | ||
</div> | ||
|
||
<div | ||
className="max-h-min md:h-[540px] carousel carousel-vertical " | ||
ref={carouselRef} | ||
> | ||
{TEAM.map((element, index) => ( | ||
<div | ||
key={index} | ||
className="carousel-item h-full flex items-center md:justify-around flex-col md:flex-row" | ||
> | ||
<div className="w-[40%] flex items-center justify-center"> | ||
<Image | ||
src={element.img} | ||
className="rounded-2xl" | ||
height={350} | ||
width={350} | ||
/> | ||
</div> | ||
<aside className="w-[40%] flex flex-col justify-between lg:py-16 py-4"> | ||
<div> | ||
<h2 className="text-4xl mb-4 font-medium">{element.name}</h2> | ||
<p className="mb-4 text-gray-600 md:leading-9 text-lg"> | ||
{element.description} | ||
</p> | ||
</div> | ||
<div className="flex self-end gap-4 "> | ||
<a | ||
target="_blank" | ||
href={element.github} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandGithub /> | ||
</a> | ||
<a | ||
target="_blank" | ||
href={element.linkedin} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandLinkedin /> | ||
</a> | ||
<a | ||
target="_blank" | ||
href={element.twitter} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandTwitter /> | ||
</a> | ||
</div> | ||
</aside> | ||
</div> | ||
))} | ||
</div> | ||
</section> | ||
<section className="flex flex-col items-center justify-center md:hidden"> | ||
{TEAM.map((element, index) => ( | ||
<div | ||
key={index} | ||
className="card card-compact w-96 bg-base-100 shadow-xl my-14" | ||
> | ||
<figure> | ||
<img src={element.img} alt={`Picture of ${element.name}`} /> | ||
</figure> | ||
<div className="card-body"> | ||
<h2 className="card-title">{element.name}</h2> | ||
<p>{element.description}</p> | ||
<div className="card-actions justify-end"> | ||
<a | ||
target="_blank" | ||
href={element.github} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandGithub /> | ||
</a> | ||
<a | ||
target="_blank" | ||
href={element.linkedin} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandLinkedin /> | ||
</a> | ||
<a | ||
target="_blank" | ||
href={element.twitter} | ||
className="hover:text-primary-900 transition-all duration-300" | ||
> | ||
<IconBrandTwitter /> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</section> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
function about() { | ||
return <div>about</div>; | ||
import Gallery from "@components/components/Gallery"; | ||
|
||
function About() { | ||
return ( | ||
<main className="md:mx-28 mx-2"> | ||
<section className="mb-7 md:mt-14"> | ||
<h1 className="text-3xl font-medium">Meet Our Team</h1> | ||
<p className="text-gray-400 md:w-[80ch] leading-7 mt-2"> | ||
The Indic Subtitler team spearheads a movement aimed at facilitating | ||
the seamless generation of Indic subtitles. We value{" "} | ||
<span className="text-primary-900 font-medium">Open Source</span>,{" "} | ||
<span className="text-primary-900 font-medium">Learning</span>, and{" "} | ||
<span className="text-primary-900 font-medium"> | ||
Open Communication | ||
</span> | ||
</p> | ||
</section> | ||
<Gallery /> | ||
</main> | ||
); | ||
} | ||
|
||
export default about; | ||
export default About; |