Skip to content

Commit

Permalink
add max and min reco name
Browse files Browse the repository at this point in the history
  • Loading branch information
DTDwind committed Jun 23, 2023
1 parent c5605aa commit 79e2ac2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion RTTManz.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def run(args):
total_overlap_frame = 0
max_speaker_num = 0
min_speaker_num = 1e16
max_time = 0
max_time_name = ""
min_time = 1e16
min_time_name = ""
counter = 0

for reco_id in reco_dict:
Expand All @@ -158,6 +162,13 @@ def run(args):
if speaker_number < min_speaker_num:
min_speaker_num = speaker_number

if reco_dict[reco_id].frame_num > max_time:
max_time = reco_dict[reco_id].frame_num
max_time_name = reco_id
if reco_dict[reco_id].frame_num < min_time:
min_time = reco_dict[reco_id].frame_num
min_time_name = reco_id

speaker_ratio = ":".join(map(str, reco_dict[reco_id].speaker_ratio))
row.append(speaker_ratio)
data.append(row)
Expand Down Expand Up @@ -189,10 +200,12 @@ def run(args):
row.append("{:.2%}".format(overlap_ratio))
row.append(max_speaker_num)
row.append(min_speaker_num)
row.append(max_time_name)
row.append(min_time_name)
data.append(row)

print("")
headers = ["Reco Number", "Total Time", "Total Speech Time", "Overlap Ratio", "Max Speaker Number", "Min Speaker Number"]
headers = ["Reco Number", "Total Time", "Total Speech Time", "Overlap Ratio", "Max Speaker Number", "Min Speaker Number", "Max Time Reco ", "Min Time Reco"]
print(tabulate(data, headers=headers, tablefmt="grid"))

def main():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="RTTManz",
version="1.0.0",
version="1.6.0",
author="Yu-Sen Cheng (DTDwind)",
description="A simple Python package for analyzing the necessary data in Speaker Diarization using oracle RTTM files and audio files.",
keywords="analyze rttm",
Expand Down

0 comments on commit 79e2ac2

Please sign in to comment.