Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4d61970
email_report
munishmangla98 Mar 19, 2025
e55ca77
correct_payment_email
munishmangla98 Mar 20, 2025
4cfe472
user_ana_done
munishmangla98 Mar 21, 2025
d1de2c3
logging_import
munishmangla98 Mar 21, 2025
ef9a066
logging_import
munishmangla98 Mar 21, 2025
a4c0808
label_count
munishmangla98 Mar 21, 2025
6a6382d
label_count1
munishmangla98 Mar 21, 2025
6ba8324
updated
munishmangla98 Mar 24, 2025
3bd7a85
updated1
munishmangla98 Mar 24, 2025
c23fb82
organizatio_user_analytics_done
munishmangla98 Mar 24, 2025
84bce09
organizatio_user_analytics_done1
munishmangla98 Mar 24, 2025
a051201
organizatio_user_analytics_done2
munishmangla98 Mar 24, 2025
d42b02a
organizatio_user_analytics_done3
munishmangla98 Mar 24, 2025
60f7a64
Merge branch 'back-branch-master' into label_count
ishvindersethi22 Mar 25, 2025
29d05f2
updated
munishmangla98 Mar 25, 2025
6522ddf
updated2
munishmangla98 Mar 26, 2025
5668d0f
payment_report
munishmangla98 Mar 26, 2025
6359e86
payment_report1
munishmangla98 Mar 26, 2025
2b72fb5
payment_report2
munishmangla98 Mar 27, 2025
a56065b
payment_report_org
munishmangla98 Mar 27, 2025
1571732
payment_report_org
munishmangla98 Mar 27, 2025
9250d3d
payment_report_org
munishmangla98 Mar 27, 2025
14418d5
payment_report_org
munishmangla98 Mar 27, 2025
2b6da28
Merge branch 'back-branch-master' into Payment_report
ishvindersethi22 Apr 7, 2025
ad3e9d9
Merge branch 'back-branch-master' into Payment_report
ishvindersethi22 Apr 8, 2025
47ed20b
Merge branch 'back-branch-master' into Payment_report
ishvindersethi22 Jun 3, 2025
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ $RECYCLE.BIN/

# Logs
**/logs/*

# resources from admin.py in dataset
# backend/dataset/admin.py
# backend/shoonya_backend/settings.py
35 changes: 35 additions & 0 deletions backend/organizations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
get_audio_transcription_duration,
get_audio_segments_count,
ocr_word_count,
get_bounding_box_count,
calculate_word_error_rate_between_two_audio_transcription_annotation,
)
from workspaces.tasks import (
Expand Down Expand Up @@ -160,16 +161,20 @@ def get_all_annotation_reports(
total_audio_duration_list = []
total_raw_audio_duration_list = []
total_word_count_list = []
total_bounding_boxes_count_list = []

only_tasks = False
if is_translation_project:
for anno in submitted_tasks:
try:
total_word_count_list.append(anno.task.data["word_count"])
total_bounding_boxes_count_list.append(get_bounding_box_count(anno.result))
except:
pass
elif "OCRTranscription" in project_type:
for anno in submitted_tasks:
total_word_count_list.append(ocr_word_count(anno.result))
total_bounding_boxes_count_list.append(get_bounding_box_count(anno.result))
elif (
project_type in get_audio_project_types() or project_type == "AllAudioProjects"
):
Expand All @@ -185,6 +190,8 @@ def get_all_annotation_reports(
only_tasks = True

total_word_count = sum(total_word_count_list)
total_bounding_boxes_count = sum(total_bounding_boxes_count_list)

total_audio_duration = convert_seconds_to_hours(sum(total_audio_duration_list))
total_raw_audio_duration = convert_seconds_to_hours(
sum(total_raw_audio_duration_list)
Expand All @@ -202,6 +209,7 @@ def get_all_annotation_reports(
"Total Segments Duration": total_audio_duration,
"Total Raw Audio Duration": total_raw_audio_duration,
"Word Count": total_word_count,
"Total Bounding Boxes Count": total_bounding_boxes_count,
"Submitted Tasks": submitted_tasks_count,
"Language": user_lang,
"Average Word Error Rate Annotator Vs Reviewer": ar_wer_score
Expand Down Expand Up @@ -230,6 +238,7 @@ def get_all_annotation_reports(

if project_type in get_audio_project_types() or project_type == "AllAudioProjects":
del result["Word Count"]
del result["Total Bounding Boxes Count"]
elif only_tasks:
del result["Total Segments Duration"]
del result["Total Raw Audio Duration"]
Expand Down Expand Up @@ -366,6 +375,8 @@ def get_all_review_reports(
total_audio_duration_list = []
total_raw_audio_duration_list = []
total_word_count_list = []
total_bounding_boxes_count_list = []

only_tasks = False
if is_translation_project:
for anno in submitted_tasks:
Expand All @@ -376,6 +387,8 @@ def get_all_review_reports(
elif "OCRTranscription" in project_type:
for anno in submitted_tasks:
total_word_count_list.append(ocr_word_count(anno.result))
total_bounding_boxes_count_list.append(get_bounding_box_count(anno.result))

elif (
project_type in get_audio_project_types() or project_type == "AllAudioProjects"
):
Expand All @@ -391,6 +404,8 @@ def get_all_review_reports(
only_tasks = True

total_word_count = sum(total_word_count_list)
total_bounding_boxes_count = sum(total_bounding_boxes_count_list)

total_audio_duration = convert_seconds_to_hours(sum(total_audio_duration_list))
total_raw_audio_duration = convert_seconds_to_hours(
sum(total_raw_audio_duration_list)
Expand All @@ -414,6 +429,7 @@ def get_all_review_reports(
"Total Segments Duration": total_audio_duration,
"Total Raw Audio Duration": total_raw_audio_duration,
"Word Count": total_word_count,
"total bounding boxes count" : total_bounding_boxes_count,
"Submitted Tasks": submitted_tasks_count,
"Language": user_lang,
"Average Word Error Rate Reviewer Vs Superchecker": rs_wer_score
Expand All @@ -439,6 +455,7 @@ def get_all_review_reports(

if project_type in get_audio_project_types() or project_type == "AllAudioProjects":
del result["Word Count"]
del result["total bounding boxes count"]
elif only_tasks:
del result["Total Segments Duration"]
del result["Total Raw Audio Duration"]
Expand Down Expand Up @@ -508,13 +525,16 @@ def get_all_supercheck_reports(
else False
)
validated_word_count_list = []
validated_bounding_boxes_count_list = []

validated_audio_duration_list = []
validated_raw_audio_duration_list = []
only_tasks = False
if is_translation_project:
for anno in submitted_tasks:
try:
validated_word_count_list.append(anno.task.data["word_count"])
validated_bounding_boxes_count_list.append(get_bounding_box_count(anno.result))
except:
pass
elif "OCRTranscription" in project_type:
Expand All @@ -537,6 +557,8 @@ def get_all_supercheck_reports(
only_tasks = True

validated_word_count = sum(validated_word_count_list)
validated_bounding_boxes_count = sum(validated_bounding_boxes_count_list)

validated_audio_duration = convert_seconds_to_hours(
sum(validated_audio_duration_list)
)
Expand All @@ -557,6 +579,7 @@ def get_all_supercheck_reports(
"Total Segments Duration": validated_audio_duration,
"Total Raw Audio Duration": validated_raw_audio_duration,
"Word Count": validated_word_count,
"validated bounding boxes count" : validated_bounding_boxes_count,
"Submitted Tasks": submitted_tasks_count,
"Language": user_lang,
"Average Rejection Count Reviewer Vs Superchecker": cumulative_rejection_score_rs
Expand All @@ -567,6 +590,7 @@ def get_all_supercheck_reports(

if project_type in get_audio_project_types() or project_type == "AllAudioProjects":
del result["Word Count"]
del result["validated bounding boxes count"]
elif only_tasks:
del result["Total Segments Duration"]
del result["Total Raw Audio Duration"]
Expand Down Expand Up @@ -783,6 +807,9 @@ def get_counts(
accepted_wt_minor_changes = 0
accepted_wt_major_changes = 0
labeled = 0
# total_bounding_boxes = 0


if tgt_language == None:
if project_progress_stage == None:
projects_objs = Project.objects.filter(
Expand Down Expand Up @@ -834,6 +861,7 @@ def get_counts(
labeled,
avg_lead_time,
total_word_count,
# total_bounding_boxes,
total_duration,
total_raw_duration,
avg_segment_duration,
Expand Down Expand Up @@ -875,10 +903,16 @@ def get_counts(
pass

total_word_count = sum(total_word_count_list)

elif "OCRTranscription" in project_type:
total_word_count = 0
# total_bounding_boxes = 0
for each_anno in labeled_annotations:
total_word_count += ocr_word_count(each_anno.result)
# total_bounding_boxes += get_bounding_box_count(each_anno.result)




total_duration = "0:00:00"
avg_segment_duration = 0
Expand Down Expand Up @@ -948,6 +982,7 @@ def get_counts(
project_count,
no_of_workspaces_objs,
total_word_count,
# total_bounding_boxes,
total_duration,
total_raw_duration,
avg_segment_duration,
Expand Down
8 changes: 8 additions & 0 deletions backend/projects/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ def get_audio_segments_count(annotation_result):
return count


def get_bounding_box_count(annotation_label_result):
count = 0
for result in annotation_label_result:
if result["type"] == "rectangle":
count += 1

return count

def audio_word_count(annotation_result):
word_count = 0

Expand Down
1 change: 1 addition & 0 deletions backend/shoonya_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
ALLOWED_HOSTS = ["127.0.0.1", "localhost", "0.0.0.0", "*"]
else:
ALLOWED_HOSTS = [

"shoonya.ai4bharat.org",
"0.0.0.0",
"backend.shoonya.ai4bharat.org",
Expand Down
Loading
Loading