Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrinjenson committed Feb 21, 2024
2 parents f92e44a + 9e16e5d commit 461f485
Show file tree
Hide file tree
Showing 10 changed files with 256 additions and 7 deletions.
8 changes: 8 additions & 0 deletions Indic_subtitler_audio_evals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ git clone https://huggingface.co/datasets/kurianbenoy/Indic-subtitler-audio_eval
1. [Mamata Banerjee Questions Change to 'Bharat' in G20 Summit Dinner Invitations | India Name Change](https://www.youtube.com/watch?v=JbjcgzTMbn0)
2. [STEVE JOBS: Stanford Speech In Bangla by Nagar Bioscope](https://www.youtube.com/watch?v=EaGBd4proc4)


#### Telgu

1. [JAYALALITHA amma Superb TELUGU Speech in Taminadu assembly | Soul Of Bharat](https://www.youtube.com/watch?v=nTFqsTPArRk)
2. [Dhanush Superb Telugu Speech @ #SIR - #Vaathi Trailer Launch Event | Manastars](https://www.youtube.com/watch?v=zBFlmJNj8xU)
3. [Revanth Reddy Speech at Rythu Sangharshana Sabha Live | Telangna Congress Party Live | Ntv](https://www.youtube.com/watch?v=B5s3E9LtYwM)



## Thanks

1. Mayank kumar for allowing using his private video for benchmarking purpose in Hindi.
2. All other youtube sources which we used for benchmarking.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ B. faster-whisper
| Marathi | mr |
| Punjabi | pa |
| Tamil | ta |
| Telgu | te |
| Urdu | ur |

C. WhisperX
Expand Down
45 changes: 45 additions & 0 deletions _experiments/test_whisperx.py
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
Binary file added ui/public/aldrin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/kurain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/nabeel.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions ui/src/components/Gallery.jsx
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>
</>
);
}
2 changes: 1 addition & 1 deletion ui/src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Header() {
<header
className={`
${isHome && "top-0"}
flex md:flex-row flex-col space-y-4 flex-wrap md:space-y-0 justify-between pt-5 items-center sticky py-5 z-20 bg-white md:px-20 px-2 `}
flex md:flex-row flex-col space-y-4 flex-wrap md:space-y-0 justify-between pt-5 md:items-center sticky py-5 z-20 bg-white md:px-20 px-2 `}
>
<h1
onClick={scrollToTop}
Expand Down
44 changes: 41 additions & 3 deletions ui/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,47 @@ export const SOURCE_LANGUAGES = [
{ id: "urd", name: "Urdu" },
];

// export const TARGET_LANGUAGES = [
// ]

export const TEAM = [
{
name: "Kurain Benoy",
img: "/kurain.jpg",
description: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni
blanditiis voluptate repellendus unde, tempora perferendis
quisquam quidem, saepe at autem harum maxime sequi praesentium
aliquam dignissimos quasi nemo nam obcaecati ratione porro?
Doloremque commodi, facilis ratione amet qui recusandae? Illo
nostrum esse tenetur.`,
github: "https://github.com/kurianbenoy",
linkedin: "https://www.linkedin.com/in/kurianbenoy/",
twitter: "https://twitter.com/kurianbenoy2",
},
{
name: "Aldrin",
img: "/aldrin.jpeg",
description: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni
blanditiis voluptate repellendus unde, tempora perferendis
quisquam quidem, saepe at autem harum maxime sequi praesentium
aliquam dignissimos quasi nemo nam obcaecati ratione porro?
Doloremque commodi, facilis ratione amet qui recusandae? Illo
nostrum esse tenetur.`,
github: "https://github.com/aldrinjenson",
linkedin: "https://www.linkedin.com/in/aldrinjenson/",
twitter: "https://twitter.com/aldrinjenson",
},
{
name: "Nabeel Boda",
img: "/nabeel.jpeg",
description: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni
blanditiis voluptate repellendus unde, tempora perferendis
quisquam quidem, saepe at autem harum maxime sequi praesentium
aliquam dignissimos quasi nemo nam obcaecati ratione porro?
Doloremque commodi, facilis ratione amet qui recusandae? Illo
nostrum esse tenetur.`,
github: "https://github.com/BodaNabeel",
linkedin: "https://www.linkedin.com/in/nabeel-boda-0858b2234",
twitter: "https://twitter.com/BodaNabeel",
},
];
export const translation = [
{
start: 0.1,
Expand Down
24 changes: 21 additions & 3 deletions ui/src/pages/about.js
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;

0 comments on commit 461f485

Please sign in to comment.