Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/audino v2 #5

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0e42dae
bug fix
kushalpoddar Apr 20, 2024
6589411
Email templating changes
kushalpoddar Apr 26, 2024
2d29065
Added pydub
kushalpoddar May 6, 2024
2da6517
alter col
kushalpoddar May 6, 2024
74e6743
added new audio total durstion field
kushalpoddar May 6, 2024
6a602b6
Updated migrations
kushalpoddar May 8, 2024
97a158b
Audio duration finding using av
kushalpoddar May 9, 2024
bfaebcc
local
kushalpoddar May 9, 2024
531de53
Added UI Url
kushalpoddar May 9, 2024
44df236
Bug fix
kushalpoddar May 9, 2024
c696325
Bug fix
kushalpoddar May 10, 2024
5c8895a
readded pydub
kushalpoddar May 10, 2024
0799c54
bug fix for av
kushalpoddar May 10, 2024
9991d03
Voxpopuli bug fix and segment size rechanged
kushalpoddar May 21, 2024
16e0509
added email notification when annotation is done
ashish7515 May 26, 2024
f3beafa
Bug fixes
kushalpoddar May 29, 2024
111d2b6
resolve bug for large files
ashish7515 May 30, 2024
32a065b
merge conflicts
ashish7515 May 30, 2024
0bde3ff
update
ashish7515 May 30, 2024
62e94bb
bug fix
kushalpoddar May 30, 2024
0ff4e30
Encoding bugresolved for audio
kushalpoddar May 30, 2024
4cc294c
Added chardet to requirements
kushalpoddar May 30, 2024
e2b4c07
bug fix for audios
kushalpoddar May 30, 2024
9b7d1ac
Merge pull request #2 from midas-research/my-branch
rohan220217 Jun 3, 2024
030e245
start end in download csv, mp3 format, typo error
ashish7515 Jun 5, 2024
ebe46a5
comment removed
ashish7515 Jun 6, 2024
2cf5d5a
Merge pull request #3 from midas-research/my-branch
rohan220217 Jun 6, 2024
a52c010
Merge branch 'feat/audino-v2' of https://github.com/midas-research/cv…
ashish7515 Jun 15, 2024
f23cd60
conflict resolved
ashish7515 Jun 15, 2024
a628c20
Merge pull request #4 from midas-research/feat/ground_truth
rohan220217 Jun 15, 2024
95253ff
rebased
kushalpoddar Jun 16, 2024
6779ccf
Bug fixes
kushalpoddar Jun 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Audio duration finding using av
  • Loading branch information
kushalpoddar committed May 9, 2024
commit 97a158b16c2789473f94ae11118ea81d45d9c776
24 changes: 19 additions & 5 deletions cvat/apps/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Copyright (C) 2022-2023 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from pydub import AudioSegment
# from pydub import AudioSegment
import av
import math
import itertools
import fnmatch
Expand Down Expand Up @@ -139,6 +140,8 @@ def _segments():
start_time = stop_time + 1

segments = _segments()
slogger.glob.debug("Segment length")
slogger.glob.debug(len(segments))
segment_size = 0
overlap = 0

Expand Down Expand Up @@ -1142,10 +1145,21 @@ def process_results(img_meta: list[tuple[str, int, tuple[int, int]]]):
while not futures.empty():
process_results(futures.get().result())

def get_audio_duration(audio_path):
audio = AudioSegment.from_file(audio_path)
total_duration = len(audio) # Duration in milliseconds
return total_duration
def get_audio_duration(file_path):
# Open the audio file
container = av.open(file_path)

# Find the audio stream
audio_stream = next(s for s in container.streams if s.type == 'audio')

# Get the duration of the audio stream in seconds
duration_seconds = audio_stream.duration / av.time_base

# Close the container
container.close()

return duration_seconds


db_task.data.audio_total_duration = None
if MEDIA_TYPE == "audio":
Expand Down